ADTF  3.18.2
object< Base, 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. More...

Inheritance diagram for object< Base, Bases... >:
[legend]

Detailed Description

template<typename Base, typename... Bases>
class adtf::ucom::catwo::object< Base, 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:

class Interface1: public ucom::IObject
{
public:
ADTF_IID(Interface1, "Interface1");
};
class Interface2: public ucom::IObject
{
public:
ADTF_IID(Interface2, "Interface2");
};
class Interface3: public ucom::IObject
{
public:
ADTF_IID(Interface3, "Interface3");
};
class cImplementsOneTwo: public ucom::object<Interface1, Interface2>
{
//implement methods from Interface1 and Interface2 here
};
class cImplementsOneTwoThree: public ucom::object<cImplementsOneTwo, Interface3>
{
//implement methods from Interface3 here
};
#define ADTF_IID(_interface, _striid)
Common macro to enable correct treatment of interface classes by the adtf::ucom::ucom_cast<>
Definition: adtf_iid.h:17
ant::IObject IObject
Alias always bringing the latest version of ant::IObject into scope.
Definition: object_intf.h:102

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:

class IParent: public ucom::IObject
{
public:
ADTF_IID(IParent, "Parent");
};
class IChild1: public IParent
{
public:
ADTF_IID(IChild1, "Child1");
};
class IChild2: public IChild1
{
public:
ADTF_IID(IChild2, "Child2");
};
class cImplementation: public ucom::object<IParent, IChild1, IChild2>
{
//implement methods from IChild2 here (including those of IParent and IChild1)
};
Template Parameters
BasesThe base classes and/or interfaces.

Definition at line 409 of file object.h.