#include <data_broker.hpp>
|
| template<typename T > |
| void | remove () |
| |
| template<typename T > |
| void | add_any (std::any metainformation_any) |
| |
| template<typename T > |
| const std::any * | get_any () const |
| |
| template<typename T > |
| std::enable_if_t<!std::is_void_v< typename T::tag_type >, const typename T::tag_type > * | get () const |
| |
| template<typename T > |
| std::enable_if_t< std::is_void_v< typename T::tag_type >, bool > | get () const |
| |
| template<typename T > |
| std::enable_if_t< !std::is_void_v< typename T::tag_type > &&!std::is_base_of_v< Tag< T >, T > &&std::is_move_constructible_v< typename T::tag_type > > | add (typename T::tag_type metainformation) |
| |
| template<typename T > |
| std::enable_if_t< !std::is_void_v< typename T::tag_type > &&!std::is_base_of_v< Tag< T >, T > &&std::is_copy_constructible_v< typename T::tag_type > &&!std::is_move_constructible_v< typename T::tag_type > > | add (const typename T::tag_type &metainformation) |
| |
| template<typename T > |
| std::enable_if_t< std::is_void_v< typename T::tag_type > > | add () |
| |
| template<typename T > |
| std::enable_if_t< std::is_base_of_v< Tag< T >, T > &&std::is_same_v< T, typename T::tag_type > > | add (T metainformation) |
| |
| template<typename T , typename... TArgs> |
| std::enable_if_t< std::is_base_of_v< Tag< T >, T > &&std::is_same_v< T, typename T::tag_type > > | add (TArgs... args) |
| |
MetaInformation collects abstract metainformation
- Note
- : Design-Goals:
- Design-#1: Key-Value (cardinality: 0-1:1). The key defines the value-type.
- Design-#2: Type-erasing techniques shall not eradicate type-safety nor put additional validation steps onto the users.
-
: Implementation-Notes:
- Implementation-#1: Implementations like "all-is-byte-arrays" or "JSON" were considered and disregarded. E.g. JSON is a serialization format. Using JSON-Schema Design-#2 would be covered. This would imply a) a dependency on multiple levels & b) significant runtime efforts. Shooting sparrows with canons. Pure C++ can do the job in <50 LOC + some for porcellain.
◆ add() [1/5]
template<typename T >
| std::enable_if_t< std::is_void_v<typename T::tag_type> > cloe::MetaInformation::add |
( |
| ) |
|
|
inline |
Adds a metainformation
- Template Parameters
-
| T | Type of the metainformation-tag |
- Note
- This overload is enabled only when the effective tag_type is void
◆ add() [2/5]
template<typename T >
| std::enable_if_t< !std::is_void_v<typename T::tag_type> && !std::is_base_of_v< Tag< T >, T > && std::is_copy_constructible_v<typename T::tag_type> && !std::is_move_constructible_v<typename T::tag_type> > cloe::MetaInformation::add |
( |
const typename T::tag_type & |
metainformation | ) |
|
|
inline |
Adds a metainformation
- Template Parameters
-
| T | Type of the metainformation-tag |
- Parameters
-
| metainformation | Actual metainformation to be added |
- Note
- This overload is enabled only when the effective tag_type is copy constructible
◆ add() [3/5]
template<typename T >
| std::enable_if_t< std::is_base_of_v< Tag< T >, T > && std::is_same_v<T, typename T::tag_type> > cloe::MetaInformation::add |
( |
T |
metainformation | ) |
|
|
inline |
Adds a metainformation
- Template Parameters
-
| T | Type of the metainformation-tag |
- Parameters
-
| metainformation | Actual metainformation to be added |
- Note
- This overload is enabled only when the tag inherits Tag<> and is the effective tag_type
Usage Note:
...
};
...
my_tag tag;
...
add(std::move(tag));
◆ add() [4/5]
template<typename T , typename... TArgs>
| std::enable_if_t< std::is_base_of_v< Tag< T >, T > && std::is_same_v<T, typename T::tag_type> > cloe::MetaInformation::add |
( |
TArgs... |
args | ) |
|
|
inline |
Adds a metainformation constructed from the supplied parameters
- Template Parameters
-
| T | Type of the metainformation-tag |
| TArgs... | Type of the metainformation c'tor arguments |
- Parameters
-
| args | Arguments for the c'tor of the metainformation |
- Note
- This overload is enabled only when the tag inherits Tag<> and is the effective tag_type
Usage Note:
add<TagType>(arg1, arg2, ...);
...
};
◆ add() [5/5]
template<typename T >
| std::enable_if_t< !std::is_void_v<typename T::tag_type> && !std::is_base_of_v< Tag< T >, T > && std::is_move_constructible_v<typename T::tag_type> > cloe::MetaInformation::add |
( |
typename T::tag_type |
metainformation | ) |
|
|
inline |
Adds a metainformation
- Template Parameters
-
| T | Type of the metainformation-tag |
- Parameters
-
| metainformation | Actual metainformation to be added |
- Note
- This overload is enabled only when the effective tag_type is move constructible
◆ add_any()
template<typename T >
| void cloe::MetaInformation::add_any |
( |
std::any |
metainformation_any | ) |
|
|
inline |
Adds a metainformation
- Template Parameters
-
| T | Type of the metainformation-tag |
- Parameters
-
| metainformation_any | Actual metainformation to be added |
◆ get() [1/2]
template<typename T >
| std::enable_if_t<!std::is_void_v<typename T::tag_type>, const typename T::tag_type>* cloe::MetaInformation::get |
( |
| ) |
const |
|
inline |
Returns a metainformation
- Template Parameters
-
| T | Type of the metainformation-tag |
- Returns
- Annotation of type T::tag_type* if the metainformation is present, nullptr otherwise
◆ get() [2/2]
template<typename T >
| std::enable_if_t<std::is_void_v<typename T::tag_type>, bool> cloe::MetaInformation::get |
( |
| ) |
const |
|
inline |
Returns a metainformation
- Template Parameters
-
| T | Type of the metainformation-tag |
- Returns
- true if the metainformation is present, false otherwise
◆ get_any()
template<typename T >
| const std::any* cloe::MetaInformation::get_any |
( |
| ) |
const |
|
inline |
Returns a metainformation
- Template Parameters
-
| T | Type of the metainformation-tag |
- Returns
- std:any* if the metainformation is present, nullptr otherwise
◆ remove()
template<typename T >
| void cloe::MetaInformation::remove |
( |
| ) |
|
|
inline |
Removes an metainformation
- Template Parameters
-
| Tag | of the metainformation to be removed |
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/cloe/checkouts/latest/runtime/include/cloe/data_broker.hpp