Ark Server API (ASE) - Wiki
|
#include <Any.h>
Classes | |
class | Holder |
class | ValueHolder |
Public Member Functions | |
Any () | |
Creates an empty any type. | |
template<typename ValueType > | |
Any (const ValueType &value) | |
Any (const Any &other) | |
Copy constructor, works with both empty and initialized Any values. | |
~Any () | |
Any & | swap (Any &other) |
template<typename ValueType > | |
Any & | operator= (const ValueType &rhs) |
Any & | operator= (const Any &rhs) |
Assignment operator for Any. | |
bool | empty () const |
Returns true if the Any is empty. | |
const std::type_info & | type () const |
Private Member Functions | |
ValueHolder * | content () const |
template<typename ValueType > | |
void | construct (const ValueType &value) |
void | construct (const Any &other) |
void | destruct () |
Private Attributes | |
Placeholder< ValueHolder > | _valueHolder |
Friends | |
template<typename ValueType > | |
ValueType * | AnyCast (Any *) |
template<typename ValueType > | |
ValueType * | UnsafeAnyCast (Any *) |
template<typename ValueType > | |
const ValueType & | RefAnyCast (const Any &) |
template<typename ValueType > | |
ValueType & | RefAnyCast (Any &) |
template<typename ValueType > | |
ValueType | AnyCast (Any &) |
An Any class represents a general type and is capable of storing any type, supporting type-safe extraction of the internally stored data.
Code taken from the Boost 1.33.1 library. Original copyright by Kevlin Henney. Modified for Poco by Applied Informatics.
Modified for small object optimization support (optionally supported through conditional compilation) by Alex Fabijanic.
|
inline |
|
inline |
|
inline |
Destructor. If Any is locally held, calls ValueHolder destructor; otherwise, deletes the placeholder from the heap.
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
friend |
AnyCast operator used to extract a copy of the ValueType from an Any&.
Example Usage: MyType tmp = AnyCast<MyType>(anAny). Will throw a BadCastException if the cast fails. Do not use an AnyCast in combination with references, i.e. MyType& tmp = ... or const MyType& tmp = ... Some compilers will accept this code although a copy is returned. Use the RefAnyCast in these cases.
|
friend |
AnyCast operator used to extract the ValueType from an Any*. Will return a pointer to the stored value.
Example Usage: MyType* pTmp = AnyCast<MyType*>(pAny). Will return NULL if the cast fails, i.e. types don't match.
|
friend |
AnyCast operator used to return a reference to the internal data.
Example Usage: MyType& tmp = RefAnyCast<MyType>(anAny);
|
friend |
AnyCast operator used to return a const reference to the internal data.
Example Usage: const MyType& tmp = RefAnyCast<MyType>(anAny);
|
friend |
The "unsafe" versions of AnyCast are not part of the public interface and may be removed at any time. They are required where we know what type is stored in the any and can't use typeid() comparison, e.g., when our types may travel across different shared libraries.
|
private |