OSVR-Core
Classes | Namespaces | Typedefs | Functions
TypeKeyed.h File Reference

Header. More...

#include "Contains.h"
#include "FindFirst.h"
#include "T.h"
#include <tuple>
#include <type_traits>

Go to the source code of this file.

Classes

class  osvr::typepack::TypeKeyedBase< Derived >
 CRTP base for type-keyed data types, providing a unified interface (compile-time polymorphism) and shared functionality. More...
 
struct  osvr::typepack::typekeyed_detail::ValueTypeAtKeyTraits< Derived, Key >
 traits class that MUST be specialized for each type-keyed container: should contain a using type = declaration returning the value type corresponding to the given key type. More...
 
struct  osvr::typepack::typekeyed_detail::KeyTypesTraits< Derived >
 traits class that can be specialized for each type-keyed container: should contain a using type = declaration providing the list of key types. More...
 
struct  osvr::typepack::typekeyed_detail::ValueAccessor< Derived, Key >
 Class with static members performing the actual access. More...
 
class  osvr::typepack::TypeKeyedBase< Derived >
 CRTP base for type-keyed data types, providing a unified interface (compile-time polymorphism) and shared functionality. More...
 

Namespaces

 osvr
 The main namespace for all C++ elements of the framework, internal and external.
 
 osvr::typepack
 A simple argument-pack-based metaprogramming library, inspired by and based partially on https://ericniebler.github.io/meta.
 

Typedefs

template<typename Derived >
using osvr::typepack::typekeyed_detail::key_types = t_< KeyTypesTraits< Derived >>
 Gets key types list for a given type-keyed container, using the traits class. More...
 
template<typename Derived , typename Key >
using osvr::typepack::typekeyed_detail::valid_key = contains< key_types< Derived >, Key >
 Returns an integral_constant for whether a given key is valid for a given type-keyed container. More...
 
template<typename Derived , typename Key >
using osvr::typepack::typekeyed_detail::index = find_first< key_types< Derived >, Key >
 Gets the index of the key in a key list for a given type-keyed container.
 
template<typename Derived , typename Key >
using osvr::typepack::typekeyed_detail::value_type_at_key = t_< ValueTypeAtKeyTraits< Derived, Key >>
 Gets the corresponding value type in a given type-keyed container for a given key type.
 
template<typename Derived , typename Key >
using osvr::typepack::typekeyed_detail::ref_type_at_key = std::add_lvalue_reference< value_type_at_key< Derived, Key >>
 Gets the corresponding reference to value type in a given type-keyed container for a given key type.
 
template<typename Derived , typename Key >
using osvr::typepack::typekeyed_detail::rref_type_at_key = std::add_rvalue_reference< value_type_at_key< Derived, Key >>
 Gets the corresponding rvalue-reference to value type in a given type-keyed container for a given key type.
 
template<typename Derived , typename Key >
using osvr::typepack::typekeyed_detail::cref_type_at_key = std::add_lvalue_reference< t_< std::add_const< value_type_at_key< Derived, Key >>>>
 Gets the corresponding reference to constant value type in a given type-keyed container for a given key type.
 

Detailed Description

Header.

Date
2015
Author
Sensics, Inc. http://sensics.com/osvr

Typedef Documentation

§ key_types

template<typename Derived >
using osvr::typepack::typekeyed_detail::key_types = typedef t_<KeyTypesTraits<Derived>>

Gets key types list for a given type-keyed container, using the traits class.

§ valid_key

template<typename Derived , typename Key >
using osvr::typepack::typekeyed_detail::valid_key = typedef contains<key_types<Derived>, Key>

Returns an integral_constant for whether a given key is valid for a given type-keyed container.

Function Documentation

§ cget()

template<typename Key , typename Derived >
cref_type_at_key< Derived, Key >::type osvr::typepack::typekeyed_detail::cget ( const TypeKeyedBase< Derived > &  c)
related

Gets an lvalue-reference to a constant value in a type-keyed container using the specified key type.

§ get()

template<typename Key , typename Derived >
ref_type_at_key< Derived, Key >::type osvr::typepack::typekeyed_detail::get ( TypeKeyedBase< Derived > &  c)
related

Gets a reference to a value in a type-keyed container using the specified key type.

§ rget()

template<typename Key , typename Derived >
rref_type_at_key< Derived, Key >::type osvr::typepack::typekeyed_detail::rget ( TypeKeyedBase< Derived > &&  c)
related

Gets a rvalue-reference to a value in a type-keyed container using the specified key type.