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

#include <safe_any.hpp>

Public Member Functions

 Any ()
 
 Any (const Any &other)
 
 Any (Any &&other)
 
 Any (const double &value)
 
 Any (const uint64_t &value)
 
 Any (const float &value)
 
 Any (const std::string &str)
 
 Any (const char *str)
 
 Any (const SafeAny::SimpleString &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 & castedType () const noexcept
 
bool empty () const noexcept
 
bool isNumber () const
 
bool isString () const
 
Anyoperator= (const Any &other)
 
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 >
nonstd::expected< DST, std::string > convert (EnableString< DST >=0) const
 
template<typename DST >
nonstd::expected< DST, std::string > convert (EnableArithmetic< DST >=0) const
 
template<typename DST >
nonstd::expected< DST, std::string > convert (EnableEnum< DST >=0) const
 
template<typename DST >
nonstd::expected< DST, std::string > convert (EnableUnknownType< DST >=0) const
 
template<typename T >
std::string errorMsg () const
 

Private Attributes

linb::any _any
 
const std::type_info * _original_type
 

Detailed Description

Definition at line 22 of file safe_any.hpp.

Member Typedef Documentation

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

Definition at line 36 of file safe_any.hpp.

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

Definition at line 39 of file safe_any.hpp.

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

Definition at line 26 of file safe_any.hpp.

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

Definition at line 30 of file safe_any.hpp.

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

Definition at line 33 of file safe_any.hpp.

template<typename T >
using BT::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 44 of file safe_any.hpp.

Constructor & Destructor Documentation

BT::Any::Any ( )
inline

Definition at line 47 of file safe_any.hpp.

BT::Any::~Any ( )
default
BT::Any::Any ( const Any other)
inline

Definition at line 53 of file safe_any.hpp.

BT::Any::Any ( Any &&  other)
inline

Definition at line 57 of file safe_any.hpp.

BT::Any::Any ( const double &  value)
inlineexplicit

Definition at line 61 of file safe_any.hpp.

BT::Any::Any ( const uint64_t &  value)
inlineexplicit

Definition at line 65 of file safe_any.hpp.

BT::Any::Any ( const float &  value)
inlineexplicit

Definition at line 69 of file safe_any.hpp.

BT::Any::Any ( const std::string &  str)
inlineexplicit

Definition at line 73 of file safe_any.hpp.

BT::Any::Any ( const char *  str)
inlineexplicit

Definition at line 77 of file safe_any.hpp.

BT::Any::Any ( const SafeAny::SimpleString str)
inlineexplicit

Definition at line 81 of file safe_any.hpp.

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

Definition at line 87 of file safe_any.hpp.

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

Definition at line 93 of file safe_any.hpp.

Member Function Documentation

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

Definition at line 119 of file safe_any.hpp.

const std::type_info& BT::Any::castedType ( ) const
inlinenoexcept

Definition at line 145 of file safe_any.hpp.

template<typename DST >
nonstd::expected<DST,std::string> BT::Any::convert ( EnableString< DST >  = 0) const
inlineprivate

Definition at line 162 of file safe_any.hpp.

template<typename DST >
nonstd::expected<DST,std::string> BT::Any::convert ( EnableArithmetic< DST >  = 0) const
inlineprivate

Definition at line 187 of file safe_any.hpp.

template<typename DST >
nonstd::expected<DST,std::string> BT::Any::convert ( EnableEnum< DST >  = 0) const
inlineprivate

Definition at line 213 of file safe_any.hpp.

template<typename DST >
nonstd::expected<DST,std::string> BT::Any::convert ( EnableUnknownType< DST >  = 0) const
inlineprivate

Definition at line 234 of file safe_any.hpp.

bool BT::Any::empty ( ) const
inlinenoexcept

Definition at line 150 of file safe_any.hpp.

template<typename T >
std::string BT::Any::errorMsg ( ) const
inlineprivate

Definition at line 240 of file safe_any.hpp.

bool BT::Any::isNumber ( ) const
inline

Definition at line 104 of file safe_any.hpp.

bool BT::Any::isString ( ) const
inline

Definition at line 111 of file safe_any.hpp.

Any& BT::Any::operator= ( const Any other)
inline

Definition at line 97 of file safe_any.hpp.

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

Definition at line 140 of file safe_any.hpp.

Member Data Documentation

linb::any BT::Any::_any
private

Definition at line 156 of file safe_any.hpp.

const std::type_info* BT::Any::_original_type
private

Definition at line 157 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 Sat Jun 8 2019 18:04:05