LocalGuidance
A library that generates velocity references to follow a path.
std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... > Class Template Reference

Defines the compile time map (ctm) that maps from KeyType_ to ValueType_ as a variadic template. More...

#include <CompileTimeMap.hpp>

Public Types

using KeyType = KeyType_
 Expose KeyType and ValueType. More...
 
using ValueType = ValueType_
 
template<ValueType_ value_>
using findAll = CompileTimeSet< KeyType_ >
 Default implementation of findAll. Defines an empty CompileTimeSet of keys. More...
 

Static Public Member Functions

template<template< KeyType_, ValueType_ > class F, class... Args>
static constexpr bool forEach (Args &&...args)
 Default implementation of forEach(). More...
 
static constexpr bool forEach (std::function< bool(const KeyType_ &, const ValueType_ &)> f)
 Default implementation of forEach(). More...
 
static constexpr ValueType_ at (const KeyType_ key)
 Default implementation of at(). More...
 
template<KeyType_ key_>
static constexpr ValueType_ at ()
 Default implementation of at(). More...
 
static constexpr bool contains (const KeyType_)
 Default implementation of contains(). More...
 
static constexpr bool containsRange (const KeyType_ begin, const KeyType_ end)
 Default implementation of containsRange(). More...
 
static constexpr bool containsValue (const ValueType_)
 Default implementation of containsValue(). More...
 
static constexpr bool allValuesUnique ()
 Default implementation of allValuesUnique(). More...
 
static constexpr std::size_t size ()
 Default implementation of size(). More...
 

Private Types

template<ValueType_ value>
using findAllRecursive = CompileTimeSet< KeyType_ >
 Implementation helper for findAll. Defines empty CompileTimeSet of keys. More...
 

Static Private Member Functions

static void findVectorRecursive (ValueType_ value, std::vector< KeyType_ > &vec)
 Implementation helper for findVector. Does nothing. More...
 
template<template< KeyType_, ValueType_ > class F, class... Args>
static constexpr bool forEachRangePreBegin (KeyType_ begin, KeyType_ end, Args &&...args)
 Implementation helper for functor based forEachRange. More...
 
static constexpr bool forEachRangePreBegin (KeyType_ begin, KeyType_ end, std::function< bool(const KeyType_ &, const ValueType_ &)> f)
 Implementation helper for std::function based forEachRange. More...
 
template<template< KeyType_, ValueType_ > class F, class... Args>
static constexpr bool forEachRangePostBegin (KeyType_ begin, KeyType_ end, Args &&...args)
 Implementation helper for functor based forEachRange. More...
 
static constexpr bool forEachRangePostBegin (KeyType_ begin, KeyType_ end, std::function< bool(const KeyType_ &, const ValueType_ &)> f)
 Implementation helper for std::function based forEachRange. More...
 
static constexpr bool containsRangePostBegin (const KeyType_ begin, const KeyType_ end)
 Implementation helper for containsRange(). More...
 
static constexpr ValueType_ atRecursive (const KeyType_ key)
 Default implementation of the atRecursive() More...
 
static constexpr KeyType_ findRecursive (const ValueType_ value)
 Default implementation of the findRecursive() More...
 
static constexpr bool uniqueKey (const KeyType_)
 Default implementation of the uniqueKey(). More...
 
static constexpr bool uniqueValue (const ValueType_)
 Implementation of the uniqueValue(). More...
 

Friends

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

Detailed Description

template<typename KeyType_, typename ValueType_, typename... REST_>
class std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >

Defines the compile time map (ctm) that maps from KeyType_ to ValueType_ as a variadic template.

Template Parameters
KeyType_Defines the type of key of the ctm.
ValueType_Defines the type of value of the ctm.
REST_parameter pack of the ctm.

Member Typedef Documentation

template<typename KeyType_ , typename ValueType_ , typename... REST_>
template<ValueType_ value_>
using std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::findAll = CompileTimeSet<KeyType_>

Default implementation of findAll. Defines an empty CompileTimeSet of keys.

template<typename KeyType_ , typename ValueType_ , typename... REST_>
template<ValueType_ value>
using std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::findAllRecursive = CompileTimeSet<KeyType_>
private

Implementation helper for findAll. Defines empty CompileTimeSet of keys.

template<typename KeyType_ , typename ValueType_ , typename... REST_>
using std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::KeyType = KeyType_

Expose KeyType and ValueType.

template<typename KeyType_ , typename ValueType_ , typename... REST_>
using std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::ValueType = ValueType_

Member Function Documentation

template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::allValuesUnique ( )
inlinestatic

Default implementation of allValuesUnique().

Returns
true.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr ValueType_ std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::at ( const KeyType_  key)
inlinestatic

Default implementation of at().

Parameters
keykey at which ctm is evaluated.
Returns
throw std::out_of_range exception.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
template<KeyType_ key_>
static constexpr ValueType_ std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::at ( )
inlinestatic

Default implementation of at().

Template Parameters
key_key at which ctm is evaluated.
Returns
throw std::out_of_range exception.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr ValueType_ std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::atRecursive ( const KeyType_  key)
inlinestaticprivate

Default implementation of the atRecursive()

Parameters
keykey at which ctm is evaluated.
Returns
throw std::out_of_range exception.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::contains ( const KeyType_  )
inlinestatic

Default implementation of contains().

Parameters
keykey at which ctm is evaluated.
Returns
false.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::containsRange ( const KeyType_  begin,
const KeyType_  end 
)
inlinestatic

Default implementation of containsRange().

Parameters
beginfirst key of range.
endlast key of range.
Returns
false.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::containsRangePostBegin ( const KeyType_  begin,
const KeyType_  end 
)
inlinestaticprivate

Implementation helper for containsRange().

Parameters
beginfirst key of range.
endlast key of range.
Returns
false.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::containsValue ( const ValueType_  )
inlinestatic

Default implementation of containsValue().

Parameters
valuevalue to check for.
Returns
false.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr KeyType_ std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::findRecursive ( const ValueType_  value)
inlinestaticprivate

Default implementation of the findRecursive()

Parameters
valueValue to search in map.
Returns
throw std::out_of_range
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static void std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::findVectorRecursive ( ValueType_  value,
std::vector< KeyType_ > &  vec 
)
inlinestaticprivate

Implementation helper for findVector. Does nothing.

template<typename KeyType_ , typename ValueType_ , typename... REST_>
template<template< KeyType_, ValueType_ > class F, class... Args>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::forEach ( Args &&...  args)
inlinestatic

Default implementation of forEach().

Template Parameters
FFunctor type that is templated on Key and Value implements operator()(Args...).
ArgsVariadic template use for function arguments.
Parameters
argsParameter pack passes to the functor.
Returns
true.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::forEach ( std::function< bool(const KeyType_ &, const ValueType_ &)>  f)
inlinestatic

Default implementation of forEach().

Parameters
ffunction object to call.
Returns
true.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
template<template< KeyType_, ValueType_ > class F, class... Args>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::forEachRangePostBegin ( KeyType_  begin,
KeyType_  end,
Args &&...  args 
)
inlinestaticprivate

Implementation helper for functor based forEachRange.

Template Parameters
FFunctor type that is templated on Key and Value implements operator()(Args...).
ArgsVariadic template use for function arguments.
Parameters
beginfirst key of range.
endlast key of range.
argsParameter pack passes to the functor.
Returns
false.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::forEachRangePostBegin ( KeyType_  begin,
KeyType_  end,
std::function< bool(const KeyType_ &, const ValueType_ &)>  f 
)
inlinestaticprivate

Implementation helper for std::function based forEachRange.

Parameters
beginfirst key of range.
endlast key of range.
ffunction object to call.
Returns
false.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
template<template< KeyType_, ValueType_ > class F, class... Args>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::forEachRangePreBegin ( KeyType_  begin,
KeyType_  end,
Args &&...  args 
)
inlinestaticprivate

Implementation helper for functor based forEachRange.

Template Parameters
FFunctor type that is templated on Key and Value implements operator()(Args...).
ArgsVariadic template use for function arguments.
Parameters
beginfirst key of range.
endlast key of range.
argsParameter pack passes to the functor.
Returns
false.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::forEachRangePreBegin ( KeyType_  begin,
KeyType_  end,
std::function< bool(const KeyType_ &, const ValueType_ &)>  f 
)
inlinestaticprivate

Implementation helper for std::function based forEachRange.

Parameters
beginfirst key of range.
endlast key of range.
ffunction object to call.
Returns
false.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr std::size_t std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::size ( )
inlinestatic

Default implementation of size().

Returns
0.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::uniqueKey ( const KeyType_  )
inlinestaticprivate

Default implementation of the uniqueKey().

Parameters
key_key which is tested for uniqueness.
Returns
true.
template<typename KeyType_ , typename ValueType_ , typename... REST_>
static constexpr bool std_utils::CompileTimeMap< KeyType_, ValueType_, REST_... >::uniqueValue ( const ValueType_  )
inlinestaticprivate

Implementation of the uniqueValue().

Parameters
valuevalue that is checked for uniqueness
Returns
true.

Friends And Related Function Documentation

template<typename KeyType_ , typename ValueType_ , typename... REST_>
template<typename... Any>
friend class CompileTimeMap
friend

Allow private access on all template specializations of CompileTimeMap.


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