Lunchbox
1.14.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
|
A class which can hold instances of any type. More...
#include <any.h>
Public Member Functions | |
Construction/Destruction | |
Any () | |
Construct a new, empty Any. More... | |
template<typename ValueType > | |
Any (const ValueType &value) | |
Construct a new Any with the given value. More... | |
Any (const Any &other) | |
Copy-construct a new Any with copying content of other. More... | |
~Any () | |
Destruct this Any. More... | |
Modifiers | |
Any & | swap (Any &rhs) |
Exchange the content of this and rhs. More... | |
template<typename ValueType > | |
Any & | operator= (const ValueType &rhs) |
Assign a new value to this Any. More... | |
Any & | operator= (Any rhs) |
Exchange the content of this and rhs. More... | |
Queries | |
bool | empty () const |
const std::type_info & | type () const |
bool | operator== (const Any &rhs) const |
bool | operator!= (const Any &rhs) const |
Friends | |
class | boost::serialization::access |
template<typename ValueType > | |
ValueType * | any_cast (Any *) |
Retrieve the value stored in an Any including type checking. More... | |
template<typename ValueType > | |
ValueType * | unsafe_any_cast (Any *) |
Retrieve the value stored in an Any without type checking. More... | |
A class which can hold instances of any type.
This class is based on boost.any with the extension to support serialization if the ValueType supports boost.serialization.
Example:
lunchbox::Any::Any | ( | ) |
Construct a new, empty Any.
Referenced by Any(), and operator=().
|
inline |
lunchbox::Any::Any | ( | const Any & | other | ) |
Copy-construct a new Any with copying content of other.
lunchbox::Any::~Any | ( | ) |
bool lunchbox::Any::empty | ( | ) | const |
Referenced by operator=().
|
inline |
Definition at line 127 of file any.h.
References any_cast, operator=(), operator==(), type(), and unsafe_any_cast.
|
inline |
Assign a new value to this Any.
Definition at line 95 of file any.h.
References Any(), empty(), operator==(), and type().
Referenced by operator!=().
bool lunchbox::Any::operator== | ( | const Any & | rhs | ) | const |
Referenced by operator!=(), and operator=().
Exchange the content of this and rhs.
Referenced by Any().
const std::type_info& lunchbox::Any::type | ( | ) | const |
Referenced by lunchbox::any_cast(), operator!=(), and operator=().
|
friend |
Retrieve the value stored in an Any including type checking.
Definition at line 235 of file any.h.
Referenced by lunchbox::any_cast(), and operator!=().
|
friend |
Retrieve the value stored in an Any without type checking.
Definition at line 301 of file any.h.
Referenced by operator!=(), and lunchbox::unsafe_any_cast().