ADTF
Loading...
Searching...
No Matches
class_versions.h File Reference
#include <tuple>
#include <array>
#include <type_traits>
Include dependency graph for class_versions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  adtf
 Namespace for all functionality provided by ADTF and its SDKs.
 
namespace  adtf::ucom
 Namespace for the ADTF uCOM SDK.
 
namespace  adtf::ucom::ant
 Namespace for all functionality of the ADTF UCOM SDK provided since v3.0.
 

Macros

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

Functions

template<typename ... Args>
constexpr tNamedVersion adtf::ucom::ant::add_version (const char *i_strProduct, Args... args)
 Used for parameter list in ADTF_CLASS_DEPENDENCIES() to define version information.
 
template<typename classT>
constexpr iterator_adapter< const tNamedVersion, pointer_iteratoradtf::ucom::ant::get_class_versions ()
 
template<typename classT>
constexpr iterator_adapter< const tNamedVersion, pointer_iteratoradtf::ucom::ant::get_class_versions (const classT &)
 
template<typename classT>
constexpr iterator_adapter< const tNamedVersion, pointer_iteratoradtf::ucom::ant::get_class_versions (const classT *)
 
template<typename ... Args>
constexpr tNamedVersion adtf::ucom::add_version (const char *i_strProduct, Args... args)
 Alias always bringing the latest version of ant::add_version() into scope.
 
template<typename classT>
constexpr iterator_adapter< const tNamedVersion, pointer_iteratoradtf::ucom::get_class_versions ()
 Alias always bringing the latest version of ant::get_class_versions() into scope.
 

Detailed Description

Copyright © Audi Electronics Venture GmbH. All rights reserved

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