ADTF
object_intf.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #define _ADTF_UCOM_ANT_OBJECT_INTERFACE_INCLUDES_HEADER_
10 
11 #include <adtfucom3/adtf_iid.h>
12 
13 namespace adtf
14 {
15 namespace ucom
16 {
17 namespace ant
18 {
19 
20 namespace detail
21 {
22 
23 //forward declaration needed for friend classes in different namespaces
24 class object_reference_counter;
25 
26 }//ns detail
32 class IObject
33 {
34 public:
39  ADTF_IID(IObject, "object.ant.ucom.adtf.iid");
40 
41 private:
43  friend class detail::object_reference_counter;
44 
46  template<typename InterfaceType, bool>
47  friend struct detail::ucom_cast_to_implicit_cast;
48 
49  // ucom_cast functionality
70  virtual tResult GetInterface(const char* i_strIID, void*& o_pInterface) = 0;
71 
76  virtual tResult GetInterface(const char* i_strIID, const void*& o_pInterface) const = 0;
77 
97  [[deprecated("Use of Destroy results in a mismatched deallocation. Use adtf::ucom::allocate_object_ptr "
98  "instead.")]] virtual void
99  Destroy() const = 0;
100 
101 protected:
103  ~IObject() = default;
104 }; // class IObject
105 
106 } // namespace ant
107 
110 
111 } // namespace ucom
112 } // namespace adtf
113 
114 //*************************************************************************************************
Copyright © Audi Electronics Venture GmbH.
Base class for every interface type within the uCOM.
Definition: object_intf.h:33
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 --> Only the final implementation can be destroyed!
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:109
Namespace for entire ADTF SDK.