LocalGuidance
A library that generates velocity references to follow a path.
std_utils::CompileTimeSet< Type_, Value_, REST_... > Class Template Reference

Defines the compile time set (cts) that contains Type_ as a variadic template. More...

#include <CompileTimeSet.hpp>

Public Types

using Type = Type_
 Assert keys that are not unique. More...
 

Static Public Member Functions

template<template< Type_ > class F, class... Args>
static constexpr bool forEach (Args &&...args)
 Implementation of forEach: Call F() on every type until F returns false. More...
 
static constexpr bool forEach (std::function< bool(const Type_ &)> f)
 Implementation of forEach: Call f() on every type until f returns false. More...
 
template<template< Type_ > class F, class... Args>
static constexpr bool forEachRange (Type_ begin, Type_ end, Args &&...args)
 Implementation of forEachRange: Call F() on every type in [begin, end] until F returns false. More...
 
static constexpr bool forEachRange (Type_ begin, Type_ end, std::function< bool(const Type_ &)> f)
 Implementation of forEachRange: Call f() on every type in [begin, end] until f returns false. More...
 
static constexpr bool contains (const Type_ t)
 Check if type is contained in set. More...
 
static constexpr bool containsRange (const Type_ begin, const Type_ end)
 Check if the range [begin, end] is contained in the set. More...
 
static constexpr std::size_t size ()
 Return the size of the set. More...
 

Static Private Member Functions

template<template< Type_ > class F, class... Args>
static constexpr bool forEachRangePreBegin (Type_ begin, Type_ end, Args &&...args)
 Implementation helper for functor based forEachRange. More...
 
static constexpr bool forEachRangePreBegin (Type_ begin, Type_ end, std::function< bool(const Type_ &)> f)
 Implementation helper for std::function based forEachRange. More...
 
template<template< Type_ > class F, class... Args>
static constexpr bool forEachRangePostBegin (Type_ begin, Type_ end, Args &&...args)
 Implementation helper for functor based forEachRange. More...
 
static constexpr bool forEachRangePostBegin (Type_ begin, Type_ end, std::function< bool(const Type_ &)> f)
 Implementation helper for std::function based forEachRange. More...
 
static constexpr bool containsRangePostBegin (const Type_ begin, const Type_ end)
 Implementation helper for containsRange(). More...
 
static constexpr bool unique (const Type_ t)
 Helper for assertion that only unique types are allowed in set. More...
 

Friends

template<typename T_ , T_... Args>
class CompileTimeSet
 

Detailed Description

template<typename Type_, Type_ Value_, Type_... REST_>
class std_utils::CompileTimeSet< Type_, Value_, REST_... >

Defines the compile time set (cts) that contains Type_ as a variadic template.

Template Parameters
Type_Defines the type contained in the set.
REST_parameter pack of the cts.

Member Typedef Documentation

template<typename Type_ , Type_ Value_, Type_... REST_>
using std_utils::CompileTimeSet< Type_, Value_, REST_... >::Type = Type_

Assert keys that are not unique.

Expose Type

Member Function Documentation

template<typename Type_ , Type_ Value_, Type_... REST_>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::contains ( const Type_  t)
inlinestatic

Check if type is contained in set.

Parameters
ttype at which cts is evaluated.
Returns
true iff type is contained in the set. False otherwise.
template<typename Type_ , Type_ Value_, Type_... REST_>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::containsRange ( const Type_  begin,
const Type_  end 
)
inlinestatic

Check if the range [begin, end] is contained in the set.

Parameters
beginfirst type of range.
endlast type of range.
Returns
true iff range is contained in the set. False otherwise.
template<typename Type_ , Type_ Value_, Type_... REST_>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::containsRangePostBegin ( const Type_  begin,
const Type_  end 
)
inlinestaticprivate

Implementation helper for containsRange().

Parameters
beginfirst type of range.
endlast type of range.
Returns
true, iff range is contained in set.
template<typename Type_ , Type_ Value_, Type_... REST_>
template<template< Type_ > class F, class... Args>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::forEach ( Args &&...  args)
inlinestatic

Implementation of forEach: Call F() on every type until F returns false.

Template Parameters
FFunctor type that is templated on Type implements operator()(Args...).
ArgsVariadic template use for function arguments.
Parameters
argsParameter pack passes to the functor.
Returns
true, iff all F's returned true.
template<typename Type_ , Type_ Value_, Type_... REST_>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::forEach ( std::function< bool(const Type_ &)>  f)
inlinestatic

Implementation of forEach: Call f() on every type until f returns false.

Parameters
ffunction to call.
Returns
true, iff all f's returned true.
template<typename Type_ , Type_ Value_, Type_... REST_>
template<template< Type_ > class F, class... Args>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::forEachRange ( Type_  begin,
Type_  end,
Args &&...  args 
)
inlinestatic

Implementation of forEachRange: Call F() on every type in [begin, end] until F returns false.

Template Parameters
FFunctor type that is templated on Type implements operator()(Args...)
ArgsVariadic template use for function arguments
Parameters
beginFirst element in range (F is called with this element)
endLast element in range (F is called with this element)
argsParameter pack passes to the functor
Returns
true, iff all F's returned true.
template<typename Type_ , Type_ Value_, Type_... REST_>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::forEachRange ( Type_  begin,
Type_  end,
std::function< bool(const Type_ &)>  f 
)
inlinestatic

Implementation of forEachRange: Call f() on every type in [begin, end] until f returns false.

Parameters
beginFirst element in range (f is called with this element)
endLast element in range (f is called with this element)
ffunction to call
Returns
true, iff all f's returned true.
template<typename Type_ , Type_ Value_, Type_... REST_>
template<template< Type_ > class F, class... Args>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::forEachRangePostBegin ( Type_  begin,
Type_  end,
Args &&...  args 
)
inlinestaticprivate

Implementation helper for functor based forEachRange.

Template Parameters
FFunctor type that is templated on Type implements operator()(Args...).
ArgsVariadic template use for function arguments.
Parameters
beginfirst type of range.
endlast type of range.
argsParameter pack passes to the functor.
Returns
true, iff all F's returned true.
template<typename Type_ , Type_ Value_, Type_... REST_>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::forEachRangePostBegin ( Type_  begin,
Type_  end,
std::function< bool(const Type_ &)>  f 
)
inlinestaticprivate

Implementation helper for std::function based forEachRange.

Parameters
beginfirst type of range.
endlast type of range.
ffunction object to call.
Returns
true, iff all f's returned true.
template<typename Type_ , Type_ Value_, Type_... REST_>
template<template< Type_ > class F, class... Args>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::forEachRangePreBegin ( Type_  begin,
Type_  end,
Args &&...  args 
)
inlinestaticprivate

Implementation helper for functor based forEachRange.

Template Parameters
FFunctor type that is templated on Type implements operator()(Args...).
ArgsVariadic template use for function arguments.
Parameters
beginfirst type of range.
endlast type of range.
argsParameter pack passes to the functor.
Returns
true, iff all F's returned true.
template<typename Type_ , Type_ Value_, Type_... REST_>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::forEachRangePreBegin ( Type_  begin,
Type_  end,
std::function< bool(const Type_ &)>  f 
)
inlinestaticprivate

Implementation helper for std::function based forEachRange.

Parameters
beginfirst type of range.
endlast type of range.
ffunction object to call.
Returns
true, iff all f's returned true.
template<typename Type_ , Type_ Value_, Type_... REST_>
static constexpr std::size_t std_utils::CompileTimeSet< Type_, Value_, REST_... >::size ( )
inlinestatic

Return the size of the set.

Returns
size of the set.
template<typename Type_ , Type_ Value_, Type_... REST_>
static constexpr bool std_utils::CompileTimeSet< Type_, Value_, REST_... >::unique ( const Type_  t)
inlinestaticprivate

Helper for assertion that only unique types are allowed in set.

Parameters
ttype that is checked for uniqueness
Returns
true iff all types in the set are unique. False otherwise.

Friends And Related Function Documentation

template<typename Type_ , Type_ Value_, Type_... REST_>
template<typename T_ , T_... Args>
friend class CompileTimeSet
friend

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