This interface represents const pointers. More...
#include <ipointer.h>
Public Member Functions | |
virtual Sint32 | set_pointer (const base::IInterface *pointer)=0 |
Sets the const pointer. More... | |
virtual const base::IInterface * | get_pointer () const =0 |
Returns the const pointer. More... | |
template<class T> | |
const T * | get_pointer () const |
Returns the const pointer. More... | |
Public Member Functions inherited from mi::IData | |
virtual const char * | get_type_name () const =0 |
Returns the type name. More... | |
Public Member Functions inherited from mi::base::IInterface | |
virtual Uint32 | retain () const =0 |
Increments the reference count. More... | |
virtual Uint32 | release () const =0 |
Decrements the reference count. More... | |
virtual const IInterface * | get_interface (const Uuid &interface_id) const =0 |
Acquires a const interface from another. More... | |
template<class T> | |
const T * | get_interface () const |
Acquires a const interface from another. More... | |
virtual IInterface * | get_interface (const Uuid &interface_id)=0 |
Acquires a mutable interface from another. More... | |
template<class T> | |
T * | get_interface () |
Acquires a mutable interface from another. More... | |
virtual Uuid | get_iid () const =0 |
Returns the interface ID of the most derived interface. More... | |
Additional Inherited Members | |
Public Types inherited from mi::base::Interface_declare< 0x67bfc3ef, ... > | |
typedef Interface_declare< id1, ... > | Self |
Own type. More... | |
typedef Uuid_t< id1, ... > | IID |
Declares the interface ID (IID) of this interface. More... | |
Public Types inherited from mi::base::Interface_declare< 0xc33c5a05, ... > | |
typedef Interface_declare< id1, ... > | Self |
Own type. More... | |
typedef Uuid_t< id1, ... > | IID |
Declares the interface ID (IID) of this interface. More... | |
Public Types inherited from mi::base::Interface_declare< 0x2e5f84bc, ... > | |
typedef Interface_declare< id1, ... > | Self |
Own type. More... | |
typedef Uuid_t< id1, ... > | IID |
Declares the interface ID (IID) of this interface. More... | |
Public Types inherited from mi::base::IInterface | |
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> | IID |
Declares the interface ID (IID) of this interface. More... | |
Static Public Member Functions inherited from mi::base::Interface_declare< 0x67bfc3ef, ... > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Static Public Member Functions inherited from mi::base::Interface_declare< 0xc33c5a05, ... > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Static Public Member Functions inherited from mi::base::Interface_declare< 0x2e5f84bc, ... > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Static Public Member Functions inherited from mi::base::IInterface | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface. More... | |
This interface represents const pointers.
Const pointers in the sense of this interface are const interface pointers, not const
void*
pointers.
Pointers are either typed or untyped. Typed pointers enforce the target to be of a certain type derived from mi::IData. The type name of a typed const pointer is "Const_pointer<"
, followed by the type name of the target, and finally ">"
, e.g., "Const_pointer<Sint32>"
for a const pointer to an instance of mi::ISint32.
Untyped pointers simply store a const pointer of type mi::base::IInterface. The type name of an untyped const pointer is "Const_pointer<Interface>"
.
The additional level of indirection can be used to use const interface pointers with data collections while maintaining const correctness. E.g., the setters of mi::IData_collection, mi::IArray, mi::IDynamic_array, and mi::IMap take mutable interface pointers. If you want to store a const interface pointer you have to wrap it in an instance of mi::IConst_pointer before using it with these interfaces.
|
inline |
Returns the const pointer.
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.
T | The interface type of the element to return |
|
pure virtual |
Returns the const pointer.
|
pure virtual |
Sets the const pointer.
Note that a NULL
pointer is a valid parameter value that clears the previously set pointer. Subsequent get_pointer() calls will return NULL
then.
pointer
has the wrong type.