Zen
A cross-platform functional programming language

any Class Reference

Intrinsic any (variant) type. More...

#include <zbl.hpp>

List of all members.

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.
anyoperator= (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.

Detailed Description

Intrinsic any (variant) type.


Constructor & Destructor Documentation

any ( ) [inline]

Default constructor.

Initializes the object to int(0). That is, _val is never 0.

any ( const any src) [inline]

Copy constructor.

Parameters:
srcThe source instance

Member Function Documentation

const T& get ( ) const [inline]

Returns the stored value.

Returns:
The value
QVariant getVar ( ) const [inline]

Get variant of contained type.

Returns:
QVariant instance
bool is ( ) const [inline]

Checks if the stored value is of a given type.

Returns:
True if stored value is of specified type
any& operator= ( const any src) [inline]

Assign value from another any type.

Parameters:
srcSource value
Returns:
Self reference
virtual void write ( z::stream os) const [inline, virtual]

Write to stream.

Parameters:
osOutput stream

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines