LocalGuidance
A library that generates velocity references to follow a path.
std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... > Class Template Reference

#include <CompileTimeKeys.hpp>

Public Types

using Enum = Enum_
 Assert keys that are not unique. More...
 

Static Public Member Functions

static constexpr const std_utils::KeyArray< Enum_, sizeof...(REST_)+1 > getKeysArray ()
 Get runtime key array. More...
 
static constexpr int mapEnumToId (const Enum_ e)
 Default implementation of mapEnumToId(). More...
 
static constexpr const char * mapEnumToName (const Enum_ e)
 Default implementation of mapEnumToName(). More...
 
static constexpr Enum_ mapIdToEnum (const int id)
 Default implementation of mapIdToEnum(). More...
 
static constexpr const char * mapIdToName (const int id)
 Default implementation of mapIdToName(). More...
 
static constexpr Enum_ mapNameToEnum (const char *name)
 Default implementation of mapNameToEnum(). More...
 
static constexpr int mapNameToId (const char *name)
 Default implementation of mapNameToId(). More...
 
static constexpr bool containsEnum (const Enum_ e)
 Default implementation of containsEnum(). More...
 
static constexpr bool containsName (const char *name)
 Default implementation of containsName(). More...
 
static constexpr bool containsId (const int id)
 Default implementation of containsId(). More...
 
static constexpr std::size_t size ()
 Return the size of the map. More...
 

Static Private Member Functions

static constexpr bool uniqueEnum (const Enum_ e)
 Default implementation of the uniqueEnum(). More...
 
static constexpr bool uniqueName (const char *name)
 Default implementation of the uniqueName(). More...
 
static constexpr bool uniqueId (const int id)
 Default implementation of the uniqueId(). More...
 

Friends

template<typename... Any>
class CompileTimeKeys
 Allow private access on all template specializations of CompileTimeKeys. More...
 

Member Typedef Documentation

template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
using std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::Enum = Enum_

Assert keys that are not unique.

Expose Enum

Member Function Documentation

template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr bool std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::containsEnum ( const Enum_  e)
inlinestatic

Default implementation of containsEnum().

Parameters
eenum at which ctk is evaluated.
Returns
false.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr bool std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::containsId ( const int  id)
inlinestatic

Default implementation of containsId().

Parameters
idid at which ctk is evaluated.
Returns
false.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr bool std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::containsName ( const char *  name)
inlinestatic

Default implementation of containsName().

Parameters
namename at which ctk is evaluated.
Returns
false.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr const std_utils::KeyArray<Enum_, sizeof...(REST_) + 1> std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::getKeysArray ( )
inlinestatic

Get runtime key array.

template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr int std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::mapEnumToId ( const Enum_  e)
inlinestatic

Default implementation of mapEnumToId().

Parameters
eenum for which id is queried.
Returns
The Id corresponding to the enum, iff enum contained in map. Throws std::out_of_range exception otherwise.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr const char* std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::mapEnumToName ( const Enum_  e)
inlinestatic

Default implementation of mapEnumToName().

Parameters
eenum for which name is queried.
Returns
The name corresponding to the enum, iff enum contained in map. Throws std::out_of_range exception otherwise.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr Enum_ std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::mapIdToEnum ( const int  id)
inlinestatic

Default implementation of mapIdToEnum().

Parameters
idid for which enum is queried.
Returns
The enum corresponding to the id, iff id contained in map. Throws std::out_of_range exception otherwise.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr const char* std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::mapIdToName ( const int  id)
inlinestatic

Default implementation of mapIdToName().

Parameters
idid for which name is queried.
Returns
The name corresponding to the id, iff id contained in map. Throws std::out_of_range exception otherwise.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr Enum_ std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::mapNameToEnum ( const char *  name)
inlinestatic

Default implementation of mapNameToEnum().

Parameters
namename for which enum is queried.
Returns
The enum corresponding to the name, iff name contained in map. Throws std::out_of_range exception otherwise.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr int std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::mapNameToId ( const char *  name)
inlinestatic

Default implementation of mapNameToId().

Parameters
namename for which id is queried.
Returns
The id corresponding to the name, iff name contained in map. Throws std::out_of_range exception otherwise.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr std::size_t std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::size ( )
inlinestatic

Return the size of the map.

Returns
size of the map.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr bool std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::uniqueEnum ( const Enum_  e)
inlinestaticprivate

Default implementation of the uniqueEnum().

Parameters
eenum which is tested for uniqueness.
Returns
true, iff all enums unique.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr bool std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::uniqueId ( const int  id)
inlinestaticprivate

Default implementation of the uniqueId().

Parameters
idid which is tested for uniqueness.
Returns
true, iff all ids unique.
template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
static constexpr bool std_utils::CompileTimeKeys< Enum_, CompileTimeKey< Enum_, e_, Name_, id_ >, REST_... >::uniqueName ( const char *  name)
inlinestaticprivate

Default implementation of the uniqueName().

Parameters
namename which is tested for uniqueness.
Returns
true, iff all names unique.

Friends And Related Function Documentation

template<typename Enum_ , Enum_ e_, typename Name_ , int id_, typename... REST_>
template<typename... Any>
friend class CompileTimeKeys
friend

Allow private access on all template specializations of CompileTimeKeys.


The documentation for this class was generated from the following file: