ADTF  3.18.2
class_versions.h File Reference

Copyright © Audi Electronics Venture GmbH. More...

Go to the source code of this file.

Namespaces

 adtf
 Namespace for entire ADTF SDK.
 
 adtf::ucom
 Namespace for the ADTF uCOM3 SDK.
 
 adtf::ucom::ant
 Namespace for all functionality provided since v3.0.
 

Macros

#define UCOM_CLASS_VERSIONS(...)
 Add a an arbitrary number of modules and their versions required for enclosing class. More...
 

Functions

template<typename ... Args>
constexpr tNamedVersion add_version (const char *i_strProduct, Args... args)
 Used for parameter list in ADTF_CLASS_DEPENDENCIES() to define version information. More...
 
template<typename classT >
constexpr iterator_adapter< const tNamedVersion, pointer_iterator > get_class_versions ()
 Get the class versions (corresponding to the CID) of the Class type. More...
 
template<typename classT >
constexpr iterator_adapter< const tNamedVersion, pointer_iterator > get_class_versions (const classT &)
 Convenience function usable with a reference to an object of type class. More...
 
template<typename classT >
constexpr iterator_adapter< const tNamedVersion, pointer_iterator > get_class_versions (const classT *)
 Convenience function usable with a pointer to an object of type class. More...
 

Detailed Description

Copyright © Audi Electronics Venture GmbH.

All rights reserved

Definition in file class_versions.h.

Macro Definition Documentation

◆ UCOM_CLASS_VERSIONS

#define UCOM_CLASS_VERSIONS (   ...)
Value:
/* the parameter is only used for compile time check with @c has_class_versions_type */ \
/* without this neat trick, the compile time check would also succeed if any base class */ \
/* defines the static method. Note: \c class_type is declared in ADTF_CLASS_ID_NAME() ! */ \
template<class_type*> struct class_versions \
{ /* See above. Also note the +1 of array size due to the default version which is not */ \
/* given via macro argument but by class_info<T*> */ \
template<std::size_t ArrSize = \
std::tuple_size<decltype(std::make_tuple(__VA_ARGS__, 1))>::value> \
static const std::array<adtf::ucom::tNamedVersion, ArrSize>& get_versions() \
{ \
static const std::array<adtf::ucom::tNamedVersion, ArrSize> arr = { \
__VA_ARGS__ , \
class_type::class_info<(class_type*)nullptr>::DefaultCVersion() \
}; \
return arr; \
} \
}

Add a an arbitrary number of modules and their versions required for enclosing class.

Must follow definition of ADTF_CLASS_ID or ADTF_CLASS_ID_NAME inside public class scope. Using this macro enables the definition of versions the enclosing class type requires to successfully work. The versions are given comma separated by passing objects of type adtf::ucom::tNamedVersion

Definition at line 25 of file class_versions.h.