ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
extend_object< BASE_OBJECT, EXTEND_INTERFACE, Child >

Used to implement IObject::GetInterface() methods with given interfaces to expose. More...

#include <adtf_iid.h>

Inheritance diagram for extend_object< BASE_OBJECT, EXTEND_INTERFACE, Child >:
[legend]

Public Types

typedef BASE_OBJECT base_type
 base object type
 

Protected Member Functions

virtual ~extend_object ()
 Protected destructor --> Only the final implementation can be destroyed!
 
virtual tResult GetInterface (const char *i_strIID, void *&o_pInterface)
 Default implementation of IObject::GetInterface()
 
virtual tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const
 Default implementation of IObject::GetInterface() provided for const correctness.
 
virtual void Destroy () const
 Default implementation to destroy an object of this type.
 

Detailed Description

template<typename BASE_OBJECT, typename EXTEND_INTERFACE, typename Child>
class adtf::ucom::ant::extend_object< BASE_OBJECT, EXTEND_INTERFACE, Child >

Used to implement IObject::GetInterface() methods with given interfaces to expose.

Template Parameters
BASE_OBJECTThe implemented object to extend.
EXTEND_INTERFACEThe interface to extend the BASE_OBJECT with.
Ifmultiple inheritance leads to ambiguous calls, use a hierarchy here. Otherwise only EXTEND_INTERFACE is allowed.
ChildChild type of this extend_object and is only needed if UCOM_RESOLVE() is given in child class Child.

This template class is intended as subclass of a concrete implementation of IObject. When inheriting from this class, two template parameters of type inherit_from and expose_interfaces, both being variadic templates themselves, must be given. With struct inherit_from those types are given which default_object itself uses as its parents in form of multiple inheritance. As default_object itself must be inherited by the concrete implementation of the given subclassed interfaces, it marks some kind of intermediate layer only used to implement IObject::GetInterface() methods. With struct expose_interfaces the interfaces to expose are given.

See also
Section The "elaborate" way (aka "object<>") in page The ucom_cast<> in depth explanation

Definition at line 732 of file adtf_iid.h.

Member Typedef Documentation

◆ base_type

template<typename BASE_OBJECT, typename EXTEND_INTERFACE, typename Child>
typedef BASE_OBJECT base_type

base object type

Definition at line 735 of file adtf_iid.h.

Constructor & Destructor Documentation

◆ ~extend_object()

template<typename BASE_OBJECT, typename EXTEND_INTERFACE, typename Child>
virtual ~extend_object ( )
inlineprotectedvirtual

Protected destructor --> Only the final implementation can be destroyed!

Definition at line 739 of file adtf_iid.h.

Member Function Documentation

◆ Destroy()

template<typename BASE_OBJECT, typename EXTEND_INTERFACE, typename Child>
virtual void Destroy ( ) const
inlineprotectedvirtual

Default implementation to destroy an object of this type.

Definition at line 802 of file adtf_iid.h.

◆ GetInterface() [1/2]

template<typename BASE_OBJECT, typename EXTEND_INTERFACE, typename Child>
virtual tResult GetInterface ( const char * i_strIID,
const void *& o_pInterface ) const
inlineprotectedvirtual

Default implementation of IObject::GetInterface() provided for const correctness.

Using the interface types given with expose_interfaces, meta struct template interface_expose is used to evaluate whether the interface identified with i_strIID is exposed by this.

Parameters
[in]i_strIIDIdentifier of the interface being requested.
[out]o_pInterfaceAddress 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_NOERRORThe interface identified by i_strIID was implemented and exposed by the implementation of *this. o_pInterface points to the queried interface.
ERR_NO_INTERFACEThe requested interface is not exposed. o_pInterface==NULL

Definition at line 784 of file adtf_iid.h.

◆ GetInterface() [2/2]

template<typename BASE_OBJECT, typename EXTEND_INTERFACE, typename Child>
virtual tResult GetInterface ( const char * i_strIID,
void *& o_pInterface )
inlineprotectedvirtual

Default implementation of IObject::GetInterface()

Using the interface types given with expose_interfaces, meta struct template interface_expose is used to evaluate whether the interface identified with i_strIID is exposed by this.

Parameters
[in]i_strIIDIdentifier of the interface being requested.
[out]o_pInterfaceAddress 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_NOERRORThe interface identified by i_strIID was implemented and exposed by the implementation of *this. o_pInterface points to the queried interface.
ERR_NO_INTERFACEThe requested interface is not exposed. o_pInterface==NULL

Definition at line 756 of file adtf_iid.h.