#include <src/Base/TaggedTuple.hpp>
template<class List>
TaggedTuple class
Tagged tuple, allowing tag-based access.
Template parameters | |
---|---|
List | Type list as brigand::list |
"Tag" here is any type, but mostly an empty struct with a good name for the data member
Public types
- using PairList = List
- List of key-value pairs.
- using Keys = typename Pair::second_type
- List of keys.
- using i_am_tagged_tuple = void
- Typedef defining self for identifying self.
-
template<typename Tag>using TupleElement = std::tuple_element_t<brigand::index_of<Keys, Tag>::value, Tuple>
- Acces type in tuple behind tag.
-
template<typename Tag>using is_tagged_tuple = is_
tagged_ tuple_ t<std::decay_t<TupleElement<Tag>>>
Public static functions
- static auto size() -> std::size_t constexpr
- Return number of tuple entries.
Constructors, destructors, conversion operators
- TaggedTuple() defaulted explicit
- Default constructor.
- TaggedTuple(Tuple&& tuple) explicit
- Initializer constructor.
Public functions
- auto tuple() const -> const Tuple&
- Const-ref access to member tuple.
-
template<typename Tag, typename... Tags>auto get() const -> const auto& noexcept
- Const-reference data member accessor of field of tagged tuple at depth.
-
template<typename Tag, typename... Tags>auto get() -> auto& noexcept
- Reference data member accessor of field of tagged tuple at depth.
-
template<typename L>auto operator==(const TaggedTuple<L>& t) const -> bool
-
template<typename L>auto operator<(const TaggedTuple<L>& t) const -> bool
Charm++ pack/unpack serializer member functions
Pack/Unpack
- void pup(PUP::er& p)
- Pack/Unpack serialize member function.
- void operator|(PUP::er& p, TaggedTuple<List>& t)
- Pack/Unpack serialize operator|.
Typedef documentation
template<class List>
template<typename Tag>
using tk:: TaggedTuple<List>:: is_tagged_tuple = is_ tagged_ tuple_ t<std::decay_t<TupleElement<Tag>>>
Query if the type behind Tag is a TaggedTuple Usage: if constexpr( is_tagged_tuple<Tag>::value ) { ... }
Function documentation
template<class List>
template<typename L>
bool tk:: TaggedTuple<List>:: operator==(const TaggedTuple<L>& t) const
Template parameters | |
---|---|
L | Type list as brigand::list for other TaggedTuple |
Returns | True if the lhs and rhs equal |
Operator == between two TaggedTuple objects
template<class List>
template<typename L>
bool tk:: TaggedTuple<List>:: operator<(const TaggedTuple<L>& t) const
Template parameters | |
---|---|
L | Type list as brigand::list for other TaggedTuple |
Returns | True if lhs < rhs |
Operator < between two TaggedTuple objects
template<class List>
void tk:: TaggedTuple<List>:: pup(PUP::er& p)
Pack/Unpack serialize member function.
Parameters | |
---|---|
p in/out | Charm++'s PUP::er serializer object reference |
template<class List>
void tk:: TaggedTuple<List>:: operator|(PUP::er& p,
TaggedTuple<List>& t)
Pack/Unpack serialize operator|.
Parameters | |
---|---|
p in/out | Charm++'s PUP::er serializer object reference |
t in/out | TaggedTuple object reference |