template<typename ... Bases>
class adtf::ucom::catwo::object< Bases >
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an existing class that implements ucom::ant::IObject.
In fact you can pass any class as a template parameter and your new class will be publicly derived from it. All specified interfaces including those implemented and exposed by all base classes will be exposed via adtf::ucom::ant::IObject. Take a look at the following example:
{
public:
};
{
public:
};
{
public:
};
class cImplementsOneTwo:
public ucom::object<Interface1, Interface2>
{
};
class cImplementsOneTwoThree: public ucom::object<cImplementsOneTwo, Interface3>
{
};
#define ADTF_IID(_interface, _striid)
Common macro to enable correct treatment of interface classes by the adtf::ucom::ucom_cast<>
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
ant::IObject IObject
Alias always bringing the latest version of ant::IObject into scope.
If you want to expose a hierachy of interfaces make sure that you specify the parent interfaces before their children (compilation will fail with an appropriate message if the prerequisite is not met). For example:
{
public:
};
class IChild1: public IParent
{
public:
};
class IChild2: public IChild1
{
public:
};
class cImplementation:
public ucom::object<IParent, IChild1, IChild2>
{
};
- Template Parameters
-
Bases | The base classes and/or interfaces. |
Definition at line 395 of file object.h.
template<typename ... Bases>
tResult GetInterface |
( |
const char * | i_strIID, |
|
|
const void *& | o_pInterface ) const |
|
inlineoverridevirtual |
Provides const correct interface querying.
Query interfaces on an object.
The IObject::GetInterface method returns a pointer to a specified interface on an object to which a client currently holds an interface pointer. Due to the fact that this querying of interfaces is not at all type safe, the IObject::GetInterface methods reside inside the private section of the interface and can only be accessed by ucom_cast()
function template.
- Parameters
-
[in] | i_strIID | Identifier of the interface being requested. |
[out] | o_pInterface | Address of pointer variable that receives the interface pointer requested in idInterface. Upon successful return, *o_pInterface contains the requested interface pointer to the object. If the object does not expose the interface specified in i_strIID , i_pInterface is set to NULL. |
- Returns
- Standard error.
- Return values
-
ERR_NOERROR | The interface identified by i_strIID was implemented and exposed by the implementation of *this. o_pInterface points to the queried interface. |
ERR_NO_INTERFACE | The requested interface is not exposed. o_pInterface==NULL |
- See also
ucom_cast()
function template
-
The ucom_cast<> in depth explanation
Implements IObject.
Definition at line 406 of file object.h.
template<typename ... Bases>
tResult GetInterface |
( |
const char * | i_strIID, |
|
|
void *& | o_pInterface ) |
|
inlineoverridevirtual |
Query interfaces on an object.
The IObject::GetInterface method returns a pointer to a specified interface on an object to which a client currently holds an interface pointer. Due to the fact that this querying of interfaces is not at all type safe, the IObject::GetInterface methods reside inside the private section of the interface and can only be accessed by ucom_cast()
function template.
- Parameters
-
[in] | i_strIID | Identifier of the interface being requested. |
[out] | o_pInterface | Address of pointer variable that receives the interface pointer requested in idInterface. Upon successful return, *o_pInterface contains the requested interface pointer to the object. If the object does not expose the interface specified in i_strIID , i_pInterface is set to NULL. |
- Returns
- Standard error.
- Return values
-
ERR_NOERROR | The interface identified by i_strIID was implemented and exposed by the implementation of *this. o_pInterface points to the queried interface. |
ERR_NO_INTERFACE | The requested interface is not exposed. o_pInterface==NULL |
- See also
ucom_cast()
function template
-
The ucom_cast<> in depth explanation
Implements IObject.
Definition at line 401 of file object.h.