ADTF  3.15.1
object_intf.h
Go to the documentation of this file.
1 
8 #ifndef _ADTF_UCOM_ANT_OBJECT_INTERFACE_INCLUDES_HEADER_
9 #define _ADTF_UCOM_ANT_OBJECT_INTERFACE_INCLUDES_HEADER_
10 
11 namespace adtf
12 {
13 namespace ucom
14 {
15 namespace ant
16 {
17 namespace detail
18 {
19 
20 //forward declaration needed for friend classes in different namespaces
21 class object_reference_counter;
22 
23 }//ns detail
24 
30 class IObject
31 {
32 public:
37  ADTF_IID(IObject, "object.ant.ucom.adtf.iid");
38 
39 private:
41  friend class detail::object_reference_counter;
42 
44  template<typename InterfaceType, bool>
45  friend struct detail::ucom_cast_to_implicit_cast;
46 
47  //ucom_cast functionality
68  virtual tResult GetInterface(const char* i_strIID, void*& o_pInterface) = 0;
69 
74  virtual tResult GetInterface(const char* i_strIID, const void*& o_pInterface) const = 0;
75 
92  virtual void Destroy() const = 0;
93 
94 protected:
96  ~IObject() = default;
97 };//class IObject
98 
99 }//ns ant
100 
103 
104 }//ns ucom
105 }//ns adtf
106 
107 //*************************************************************************************************
108 #endif // _ADTF_UCOM_ANT_OBJECT_INTERFACE_INCLUDES_HEADER_
A common result class usable as return value throughout.
Base class for every interface type within the uCOM.
Definition: object_intf.h:31
virtual tResult GetInterface(const char *i_strIID, const void *&o_pInterface) const =0
Provides const correct interface querying.
ADTF_IID(IObject, "object.ant.ucom.adtf.iid")
Marks the IObject to be castable with the ucom_cast()
virtual tResult GetInterface(const char *i_strIID, void *&o_pInterface)=0
Query interfaces on an object.
~IObject()=default
Protected destructor --> Use implemented Destroy() instead of delete!
virtual void Destroy() const =0
Destruct and deallocate instantiations of type IObject.
ant::IObject IObject
Alias always bringing the latest version of ant::IObject into scope.
Definition: object_intf.h:102
Namespace for entire ADTF SDK.