Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
SafeAny::Any Class Reference

#include <safe_any.hpp>

Public Member Functions

 Any ()
 
 Any (const double &value)
 
 Any (const uint64_t &value)
 
 Any (const float &value)
 
 Any (const std::string &str)
 
template<typename T >
 Any (const T &value, EnableIntegral< T >=0)
 
template<typename T >
 Any (const T &value, EnableNonIntegral< T >=0)
 
template<typename T >
cast () const
 
const std::type_info & type () const noexcept
 
 ~Any ()=default
 

Private Types

template<typename T >
using EnableArithmetic = typename std::enable_if< std::is_arithmetic< T >::value >::type *
 
template<typename T >
using EnableEnum = typename std::enable_if< std::is_enum< T >::value >::type *
 
template<typename T >
using EnableIntegral = typename std::enable_if< std::is_integral< T >::value||std::is_enum< T >::value >::type *
 
template<typename T >
using EnableNonIntegral = typename std::enable_if<!std::is_integral< T >::value &&!std::is_enum< T >::value >::type *
 
template<typename T >
using EnableString = typename std::enable_if< std::is_same< T, std::string >::value >::type *
 
template<typename T >
using EnableUnknownType = typename std::enable_if<!std::is_arithmetic< T >::value &&!std::is_enum< T >::value &&!std::is_same< T, std::string >::value >::type *
 

Private Member Functions

template<typename DST >
DST convert (EnableString< DST >=0) const
 
template<typename DST >
DST convert (EnableArithmetic< DST >=0) const
 
template<typename DST >
DST convert (EnableEnum< DST >=0) const
 
template<typename DST >
DST convert (EnableUnknownType< DST >=0) const
 
template<typename T >
std::runtime_error errorMsg () const
 

Private Attributes

linb::any _any
 

Detailed Description

Definition at line 19 of file safe_any.hpp.

Member Typedef Documentation

template<typename T >
using SafeAny::Any::EnableArithmetic = typename std::enable_if<std::is_arithmetic<T>::value>::type*
private

Definition at line 33 of file safe_any.hpp.

template<typename T >
using SafeAny::Any::EnableEnum = typename std::enable_if<std::is_enum<T>::value>::type*
private

Definition at line 36 of file safe_any.hpp.

template<typename T >
using SafeAny::Any::EnableIntegral = typename std::enable_if<std::is_integral<T>::value || std::is_enum<T>::value>::type*
private

Definition at line 23 of file safe_any.hpp.

template<typename T >
using SafeAny::Any::EnableNonIntegral = typename std::enable_if<!std::is_integral<T>::value && !std::is_enum<T>::value>::type*
private

Definition at line 27 of file safe_any.hpp.

template<typename T >
using SafeAny::Any::EnableString = typename std::enable_if<std::is_same<T, std::string>::value>::type*
private

Definition at line 30 of file safe_any.hpp.

template<typename T >
using SafeAny::Any::EnableUnknownType = typename std::enable_if<!std::is_arithmetic<T>::value && !std::is_enum<T>::value && !std::is_same<T, std::string>::value>::type*
private

Definition at line 41 of file safe_any.hpp.

Constructor & Destructor Documentation

SafeAny::Any::Any ( )
inline

Definition at line 44 of file safe_any.hpp.

SafeAny::Any::~Any ( )
default
SafeAny::Any::Any ( const double &  value)
inline

Definition at line 50 of file safe_any.hpp.

SafeAny::Any::Any ( const uint64_t &  value)
inline

Definition at line 54 of file safe_any.hpp.

SafeAny::Any::Any ( const float &  value)
inline

Definition at line 58 of file safe_any.hpp.

SafeAny::Any::Any ( const std::string &  str)
inline

Definition at line 62 of file safe_any.hpp.

template<typename T >
SafeAny::Any::Any ( const T &  value,
EnableIntegral< T >  = 0 
)
inlineexplicit

Definition at line 68 of file safe_any.hpp.

template<typename T >
SafeAny::Any::Any ( const T &  value,
EnableNonIntegral< T >  = 0 
)
inlineexplicit

Definition at line 74 of file safe_any.hpp.

Member Function Documentation

template<typename T >
T SafeAny::Any::cast ( ) const
inline

Definition at line 81 of file safe_any.hpp.

template<typename DST >
DST SafeAny::Any::convert ( EnableString< DST >  = 0) const
inlineprivate

Definition at line 104 of file safe_any.hpp.

template<typename DST >
DST SafeAny::Any::convert ( EnableArithmetic< DST >  = 0) const
inlineprivate

Definition at line 129 of file safe_any.hpp.

template<typename DST >
DST SafeAny::Any::convert ( EnableEnum< DST >  = 0) const
inlineprivate

Definition at line 156 of file safe_any.hpp.

template<typename DST >
DST SafeAny::Any::convert ( EnableUnknownType< DST >  = 0) const
inlineprivate

Definition at line 177 of file safe_any.hpp.

template<typename T >
std::runtime_error SafeAny::Any::errorMsg ( ) const
inlineprivate

Definition at line 183 of file safe_any.hpp.

const std::type_info& SafeAny::Any::type ( ) const
inlinenoexcept

Definition at line 93 of file safe_any.hpp.

Member Data Documentation

linb::any SafeAny::Any::_any
private

Definition at line 99 of file safe_any.hpp.


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


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sun Feb 3 2019 03:14:33