7 #ifndef _ADTF_UCOM_ANT_CLASS_ID_INCLUDES_HEADER_
8 #define _ADTF_UCOM_ANT_CLASS_ID_INCLUDES_HEADER_
17 #ifndef ADTF_CLASS_ID_NAME
33 #define ADTF_CLASS_ID_NAME(_class, _strcid, _strclabel) \
34 typedef _class class_type; \
35 template<_class*> struct class_info : \
36 public adtf::ucom::ant::detail::class_info_detail<class_type> \
38 using adtf::ucom::ant::detail::class_info_detail<class_type>::CVersions; \
39 using adtf::ucom::ant::detail::class_info_detail<class_type>::CDependencies; \
40 static const char* CID() { return _strcid; } \
41 static const char* CLabel() { return _strclabel ? _strclabel : CID();} \
56 #ifndef ADTF_CLASS_INFO_IMPL
57 #define ADTF_CLASS_INFO_IMPL(_class) \
58 const char* GetCID() const override \
60 return adtf::ucom::get_class_id<_class>(); \
62 const char* GetCLabel() const override \
64 return adtf::ucom::get_class_label<_class>(); \
66 adtf::ucom::ant::iterator_adapter<const adtf::ucom::ant::tDependencyDescription, \
67 adtf::ucom::ant::pointer_iterator> \
68 GetCDependencies() const override \
70 return adtf::ucom::get_class_dependencies<_class>(); \
72 adtf::ucom::ant::iterator_adapter<const adtf::ucom::ant::tNamedVersion, \
73 adtf::ucom::ant::pointer_iterator> \
74 GetCVersions() const override \
76 return adtf::ucom::get_class_versions<_class>(); \
91 #define ADTF_CLASS_ID(_class, _strcid) ADTF_CLASS_ID_NAME(_class, _strcid, nullptr)
109 template<
typename classT>
113 typedef typename remove_const<typename remove_pointer<classT>::type>::type value_type;
114 static_assert(is_same<value_type, typename value_type::class_type>::value,
115 "get_class_id<> failed. Check whether your interface correctly defined ADTF_CLASS_ID()");
117 return value_type::template class_info<(value_type*)
nullptr>::CID();
124 template<
typename classT>
125 constexpr
const char*
get_class_id(
const classT&) {
return get_class_id<classT>(); }
131 template<
typename classT>
132 constexpr
const char*
get_class_id(
const classT*) {
return get_class_id<classT>(); }
142 template<
typename classT>
146 typedef typename remove_const<typename remove_pointer<classT>::type>::type value_type;
147 static_assert(is_same<value_type, typename value_type::class_type>::value,
148 "get_class_label<> failed. Check whether your interface correctly defined "\
149 "ADTF_CLASS_ID_NAME()");
151 return value_type::template class_info<(value_type*)
nullptr>::CLabel();
158 template<
typename classT>
159 constexpr
const char*
get_class_label(
const classT&) {
return get_class_label<classT>(); }
165 template<
typename classT>
166 constexpr
const char*
get_class_label(
const classT*) {
return get_class_label<classT>(); }
constexpr const char * get_class_label()
Get the class label (corresponding to the CID) of the Class type (a readable name !...
constexpr const char * get_class_id()
Get the class id (CID) of the Class type.
Namespace for entire ADTF SDK.