BipedalLocomotion/GenericContainer/NamedTuple.h file

Namespaces

namespace BipedalLocomotion
namespace BipedalLocomotion::GenericContainer
namespace BipedalLocomotion::GenericContainer::detail
namespace BipedalLocomotion::GenericContainer::literals
namespace std
STL namespace.

Classes

template<hash_type hash_, typename Type_>
struct BipedalLocomotion::GenericContainer::named_param
named_param is a struct that associate a compile time hash to a value.
template<typename... Params>
struct BipedalLocomotion::GenericContainer::named_tuple
named_tuple is a class that inherits from tuple.
template<typename... Params>
struct std::tuple_size<::BipedalLocomotion::GenericContainer::named_tuple<Params...>>
Template specialization to make the elements of the named_tuple accessible with the Structured binding declaration.
template<size_t Index, typename... Params>
struct std::tuple_element<Index, ::BipedalLocomotion::GenericContainer::named_tuple<Params...>>
Template specialization to make the elements of the named_tuple accessible with the Structured binding declaration.

Typedefs

using hash_type = std::uint64_t

Functions

auto sid_hash(const char* str, hash_type hash = fnv_basis) -> hash_type constexpr noexcept
template<typename... Args>
auto make_named_tuple(Args && ... args) -> auto constexpr
Creates a named_tuple object, deducing the target type from the types of arguments.
auto operator""_h(const char* tag, std::size_t s) -> hash_type constexpr
Forms a hash from a char*.
template<std::size_t I, typename... Params>
auto get(::BipedalLocomotion::GenericContainer::named_tuple<Params...>& t) -> std::tuple_element<I, typename ::BipedalLocomotion::GenericContainer::named_tuple<Params...>::underlying_tuple>::type& noexcept
Extracts the Ith element from the named_tuple.
template<std::size_t I, typename... Params>
auto get(const ::BipedalLocomotion::GenericContainer::named_tuple<Params...>& t) -> const tuple_element<I, typename ::BipedalLocomotion::GenericContainer::named_tuple<Params...>::underlying_tuple>::type& noexcept
Extracts the Ith element from the named_tuple.

Variables

hash_type fnv_basis constexpr
hash_type fnv_prime constexpr

Defines

#define BLF_STRING_TO_HASH(x_)
Create the hash from a string.
#define BLF_NAMED_PARAM(x_, type_)
Create a named parameter given type and key.

Function documentation

template<typename... Args>
auto make_named_tuple(Args && ... args) constexpr

Creates a named_tuple object, deducing the target type from the types of arguments.

Returns A named_tuple object containing the given values, created as if by named_tuple<Args...>(std::forward<Args>(args)...).

@params args zero or more arguments to construct the named_tuple from

hash_type operator""_h(const char* tag, std::size_t s) constexpr

Forms a hash from a char*.

template<std::size_t I, typename... Params>
std::tuple_element<I, typename ::BipedalLocomotion::GenericContainer::named_tuple<Params...>::underlying_tuple>::type& get(::BipedalLocomotion::GenericContainer::named_tuple<Params...>& t) noexcept

Extracts the Ith element from the named_tuple.

Parameters
t the named_tuple
Returns A reference to the selected element of t.

It must be an integer value in [0, sizeof...(Types)).

template<std::size_t I, typename... Params>
const tuple_element<I, typename ::BipedalLocomotion::GenericContainer::named_tuple<Params...>::underlying_tuple>::type& get(const ::BipedalLocomotion::GenericContainer::named_tuple<Params...>& t) noexcept

Extracts the Ith element from the named_tuple.

Parameters
t the named_tuple
Returns A reference to the selected element of t.

It must be an integer value in [0, sizeof...(Types)).