ADTF
Loading...
Searching...
No Matches
class_info.h
Go to the documentation of this file.
1
7#ifndef _ADTF_UCOM_ANT_CLASS_INFO_INCLUDES_HEADER_
8#define _ADTF_UCOM_ANT_CLASS_INFO_INCLUDES_HEADER_
9
10namespace adtf
11{
12namespace ucom
13{
14namespace ant
15{
16namespace detail
17{
18//forward declarations
19template<typename> struct class_info_detail;
20}
21
26class DOEXPORT cClassInfo : public catwo::object<IClassInfo>
27{
28 A_UTILS_D(cClassInfo)
29
30public:
31 cClassInfo() = default;
32 //TODO!!!! Temporarily allow copying by interface, cause factory and runtime make copies!!!
33 cClassInfo(const IClassInfo&);
34 cClassInfo& operator=(const cClassInfo&) = delete;
35
36 //allow moving
37 cClassInfo(cClassInfo&&) = default;
38 cClassInfo& operator=(cClassInfo&&) = default;
39
41 virtual ~cClassInfo() = default;
42
43public: //Implements IClassInfo
44 const char* GetCID() const override;
45 const char* GetCLabel() const override;
47 const override;
49
50private:
51 //allow static method to construct class info with detailed information
52 template<typename> friend struct adtf::ucom::ant::detail::class_info_detail;
53
54 cClassInfo(const char* strIdentifier, //identifier
55 const char* strClassLabel, //label
56 const tDependencyDescription* pFirstDependency, std::size_t nDependencies, //dependencies
57 const tNamedVersion* pVersion, std::size_t nVersions); //versions
58};//class cClassInfo
59
68template<typename classT>
70{
71 using namespace std; //remove_const, remove_pointer, is_same
72 typedef typename remove_const<typename remove_pointer<classT>::type>::type value_type;
73 static_assert(is_same<value_type, typename value_type::class_type>::value,
74 "get_class_info_reference<> failed. Check whether your interface correctly defined " \
75 "ADTF_CLASS_ID()");
76
77 return classT::template class_info<(classT*)nullptr>::GetClass_Info();
78}
79
84template<typename classT>
85constexpr const cClassInfo& get_class_info_reference(const classT*)
86{
88}
89
94template<typename classT>
95constexpr const cClassInfo& get_class_info_reference(const classT&)
96{
98}
99
108template<typename classT>
114
119template<typename classT>
124
129template<typename classT>
134
135}//ns ant
136
138using ant::cClassInfo;
139
142
145
146}//ns ucom
147}//ns adtf
148
149#endif // _ADTF_UCOM_ANT_CLASS_INFO_INCLUDES_HEADER_
Definition class_info_intf.h:51
Definition class_info.h:27
virtual ~cClassInfo()=default
Default destructor.
Definition object_ptr.h:384
Definition object.h:397
Namespace for all internally used functionality implemented.
Definition class_info.h:17
Namespace for all functionality of the ADTF UCOM SDK provided since v3.0.
Definition test_runtime.h:14
object_ptr< const adtf::ucom::ant::IClassInfo > get_class_info()
Definition class_info.h:109
constexpr const cClassInfo & get_class_info_reference()
Definition class_info.h:69
object_ptr< Implementation > make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
Definition object_ptr_utilities.h:129
Namespace for the ADTF uCOM SDK.
Definition adtf_system.h:324
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14
Definition class_info_detail.h:90
Adapter for begin and end iterators - usable as return and parameter value in interfaces.
Definition iterator_intf.h:190
Dependency description usable for ADTF_CLASS_DEPENDENCIES()
Definition class_info_intf.h:31
Named version information consisting of the modules name and its adtf_util::tVersion.
Definition class_info_intf.h:22