Zen
A cross-platform functional programming language
|
Intrinsic any (variant) type. More...
#include <zbl.hpp>
Classes | |
class | base |
Abstract base class for implementations of 'any' type. More... | |
class | impl |
Implementation template for all 'any' types. More... | |
Public Member Functions | |
any () | |
Default constructor. | |
any (const any &src) | |
Copy constructor. | |
~any () | |
Destructor. | |
template<typename T > | |
any (const T &val) | |
Generic ctor for any type. | |
any (const char *val) | |
Special ctor for accepting a char* and storing it as a string internally. | |
any & | operator= (const any &src) |
Assign value from another any type. | |
virtual void | write (z::stream &os) const |
Write to stream. | |
QVariant | getVar () const |
Get variant of contained type. | |
template<typename T > | |
bool | is () const |
Checks if the stored value is of a given type. | |
template<typename T > | |
const T & | get () const |
Returns the stored value. | |
Private Attributes | |
base * | _val |
The value. |
Intrinsic any (variant) type.
any | ( | ) | [inline] |
Default constructor.
Initializes the object to int(0). That is, _val is never 0.
const T& get | ( | ) | const [inline] |
Returns the stored value.
QVariant getVar | ( | ) | const [inline] |
Get variant of contained type.
bool is | ( | ) | const [inline] |
Checks if the stored value is of a given type.
Assign value from another any type.
src | Source value |
virtual void write | ( | z::stream & | os | ) | const [inline, virtual] |
Write to stream.
os | Output stream |