Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::IRef Class Referenceabstract

A reference is an object that acts as a pointer to other database elements. More...

Inheritance diagram for mi::IRef:
mi::base::Interface_declare< 0x3572250a, 0x605e, 0x4b6c, 0xa0, 0xc3, 0xae, 0xd5, 0x7e, 0x24, 0x69, 0x9b, IData_simple > mi::IData_simple mi::base::Interface_declare< 0xc33c5a05, 0xe7a5, 0x4154, 0xb8, 0x87, 0xee, 0x1f, 0x4d, 0x5b, 0x02, 0x02, IData > mi::IData mi::base::Interface_declare< 0x2e5f84bc, 0x783a, 0x4551, 0x9f, 0xca, 0x72, 0x2f, 0xb8, 0x38, 0xc4, 0x7c > mi::base::IInterface

Public Member Functions

virtual Sint32 set_reference (const base::IInterface *db_element)=0
 Sets the reference to db_element. More...
 
virtual Sint32 set_reference (const char *name)=0
 Sets the reference to the database element named name. More...
 
virtual const base::IInterfaceget_reference () const =0
 Returns the reference. More...
 
template<class T >
const T * get_reference () const
 Returns the reference. More...
 
virtual base::IInterfaceget_reference ()=0
 Returns the reference. More...
 
template<class T >
T * get_reference ()
 Returns the reference. More...
 
virtual const char * get_reference_name () const =0
 Returns the name of the referenced element. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x3572250a, 0x605e, 0x4b6c, 0xa0, 0xc3, 0xae, 0xd5, 0x7e, 0x24, 0x69, 0x9b, IData_simple >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IData_simple
Self
 Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x3572250a, 0x605e, 0x4b6c, 0xa0, 0xc3, 0xae, 0xd5, 0x7e, 0x24, 0x69, 0x9b, IData_simple >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

A reference is an object that acts as a pointer to other database elements.

It can be used for example to store references to other database elements as an attribute of a given database element.

Member Function Documentation

virtual const base::IInterface* mi::IRef::get_reference ( ) const
pure virtual

Returns the reference.

template<class T >
const T* mi::IRef::get_reference ( ) const
inline

Returns the reference.

This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid&) on the returned pointer, since the return type already is a pointer to the type T specified as template parameter.

Template Parameters
TThe requested interface type
virtual base::IInterface* mi::IRef::get_reference ( )
pure virtual

Returns the reference.

template<class T >
T* mi::IRef::get_reference ( )
inline

Returns the reference.

This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid&) on the returned pointer, since the return type already is a pointer to the type T specified as template parameter.

Template Parameters
TThe requested interface type
virtual const char* mi::IRef::get_reference_name ( ) const
pure virtual

Returns the name of the referenced element.

virtual Sint32 mi::IRef::set_reference ( const base::IInterface db_element)
pure virtual

Sets the reference to db_element.

Note that a NULL pointer is a valid parameter value that clears the previously set reference. Subsequent get_reference() calls will return NULL then.

If a literal 0 is passed for db_element, the call is ambiguous. You need to explicitly cast the value to const IInterface* or const char*.

Returns
  • 0: Success.
  • -2: db_element does not point to a DB element.
  • -3: db_element points to a DB element that has not yet been stored in the DB.
  • -4: The reference can not be set to the element because the element is in a more private scope than the reference.
virtual Sint32 mi::IRef::set_reference ( const char *  name)
pure virtual

Sets the reference to the database element named name.

Note that a NULL pointer is a valid parameter value that clears the previously set reference. Subsequent get_reference() calls will return NULL then.

If a literal 0 is passed for name, the call is ambiguous. You need to explicitly cast the value to const IInterface* or const char*.

Returns
  • 0: Success.
  • -2: There is no element with that name.
  • -4: The reference can not be set to the element because the element is in a more private scope than the reference.