ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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}
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_
@ brief The IClassInfo interface provides a standardized way to access type information.
The Helper Storage Class for a IClassInfo.
Definition class_info.h:27
virtual ~cClassInfo()=default
Default destructor.
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
Definition object.h:397
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
Definition d_ptr.h:270
Namespace for all internally used uCOM functionality implemented.
Namespace for all functionality provided since v3.0.
constexpr const cClassInfo & get_class_info_reference()
Get reference to static class info constant of the classT type.
Definition class_info.h:69
object_ptr< const adtf::ucom::ant::IClassInfo > get_class_info()
Get the class info of the Class type.
Definition class_info.h:109
object_ptr< Implementation > make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
Namespace for the ADTF uCOM3 SDK.
Namespace for entire ADTF SDK.
Adapter for begin and end iterators - usable as return and parameter value in interfaces.
Dependency description usable for ADTF_CLASS_DEPENDENCIES()
Named version information consisting of the modules name and its adtf_util::tVersion.