KrisLibrary  1.0.0
Classes | Public Member Functions | Friends | List of all members
AnyValue Class Reference

A polymorphic container class that can contain data of any type. More...

#include <AnyValue.h>

Public Member Functions

template<typename ValueType >
 AnyValue (const ValueType &value)
 
 AnyValue (const AnyValue &other)
 
 AnyValue (AnyValue &&other) noexcept
 
AnyValueswap (AnyValue &rhs)
 
template<typename ValueType >
AnyValueoperator= (const ValueType &rhs)
 
AnyValueoperator= (const AnyValue &rhs)
 
bool empty () const
 
const std::type_info & type () const
 
template<class T >
bool hastype () const
 
template<class ValueType >
bool operator== (const ValueType &rhs) const
 
template<class ValueType >
bool operator!= (const ValueType &rhs) const
 

Friends

template<typename ValueType >
ValueType * AnyCast (AnyValue *)
 Retreive the data within the operand, or NULL if not of the correct type.
 
template<typename ValueType >
ValueType * AnyCast_Quick (AnyValue *)
 
template<typename ValueType >
ValueType * AnyCast_Raw (AnyValue *)
 

Detailed Description

A polymorphic container class that can contain data of any type.

To retrieve the contained data, use AnyCast.

Friends And Related Function Documentation

template<typename ValueType >
ValueType* AnyCast_Quick ( AnyValue operand)
friend

Retreive the data within the operand, or NULL if not of the correct type. This differs from AnyCast in that it checks for the correct typeid by reference rather than by value, which does not work across DLL boundaries but is faster.

template<typename ValueType >
ValueType* AnyCast_Raw ( AnyValue operand)
friend

Retreive the data within the operand, or NULL if the operand is NULL. This differs from AnyCast in that it does not check for the correct type, which slightly improves performance, at the cost of requiring the caller to first verify type The caller must be very sure that the item's type is correct!


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