Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/rtti/Type.h>
Public Types | |
typedef HashMap< string, const Type * >::Iter | TypeIter |
Public Member Functions | |
Type (string name="") | |
virtual | ~Type (void) |
string | name (void) const |
const PointerType & | pointer (void) const |
virtual bool | canCast (const Type *t) const |
virtual bool | isVoid (void) const |
virtual bool | isBool (void) const |
virtual bool | isInt (void) const |
virtual bool | isFloat (void) const |
virtual bool | isPtr (void) const |
virtual const PointerType & | asPtr (void) const |
virtual bool | isClass (void) const |
virtual const AbstractClass & | asClass (void) const |
virtual bool | isEnum (void) const |
virtual const Enumerable & | asEnum (void) const |
virtual bool | isSerial (void) const |
virtual const Serializable & | asSerial (void) const |
virtual const TemplateType * | asTemplate (void) const |
virtual const InstanceType * | asInstance (void) const |
virtual const ParamType * | asParam (void) const |
void | initialize (void) |
bool | operator== (const Type &t) const |
bool | operator!= (const Type &t) const |
Static Public Member Functions | |
static const Type * | get (string name) |
static TypeIter | types (void) |
Static Public Attributes | |
static const Type & | param0 |
static const Type & | param1 |
static const Type & | param2 |
static const Type & | param3 |
Materialize the concept of type. Used for serialization or with classes like variant.
|
virtual |
Get the class description corresponding to this type. If the type is not a class, an assertion failure is raised.
Reimplemented in AbstractClass.
References Type::name().
|
virtual |
Get the enumeration description corresponding to this type. If the type is not enumerated, an assertion failure is raised.
Reimplemented in Enum.
References Type::name().
Referenced by TextSerializer::onEnum(), XOMElementSerializer::onEnum(), and XOMUnserializer::onEnum().
|
virtual |
Get the template instance interface for this type. If this type is not a template instance, return null.
Reimplemented in InstanceClass.
Get the parameter interface for this type. Return null if the type is not a parameter.
Referenced by InstanceType::typeFor().
|
virtual |
Get the class description corresponding to this type. If the type is not a pointer, an assertion failure is raised.
Reimplemented in PointerType.
References Type::name().
Referenced by elm::rtti::operator<<().
|
virtual |
Return the serializable instance of this type.
Reimplemented in CStringType, StringType, BoolType, FloatType< T >, IntType< T >, and AbstractClass.
References Type::name().
|
virtual |
Get the template interface for this type. If the type is not a template, return a null pointer.
Reimplemented in TemplateClass.
Test if the type can be casted to the given type.
t | Type to cast to. |
Reimplemented in BoolType, FloatType< T >, IntType< T >, and Enum.
Get a type by its name.
name | Name of looked type. |
References Type::name(), and elm::rtti::type_map.
For internal use only. Do not call it.
References Type::name(), and elm::rtti::type_map.
Test if the type is a boolean.
Reimplemented in BoolType.
Referenced by IntType< T >::canCast(), and FloatType< T >::canCast().
Test if the type is a class. Default implementation return false.
Reimplemented in AbstractClass.
Test if the type is a floating-point real.
Reimplemented in FloatType< T >.
Referenced by IntType< T >::canCast(), and FloatType< T >::canCast().
Test if the type is a integer.
Reimplemented in IntType< T >.
Referenced by Enum::canCast(), IntType< T >::canCast(), FloatType< T >::canCast(), and BoolType::canCast().
Test if the type is a pointer.
Reimplemented in PointerType.
Referenced by elm::rtti::operator<<().
Test if the type is serializable. Default implementation return false.
Reimplemented in CStringType, StringType, BoolType, FloatType< T >, IntType< T >, and AbstractClass.
Get the name of the type.
Referenced by Enum::make::alias(), Type::asClass(), Type::asEnum(), Type::asPtr(), Type::asSerial(), XOMElementSerializer::beginObject(), Type::get(), Type::initialize(), elm::rtti::operator<<(), and Enum::make::value().
References Type::operator==().
Referenced by Type::operator!=().
const PointerType & pointer | ( | void | ) | const |
Obtain pointer type on the current type.
Referenced by _type< T * >::_().
|
static |
|
static |
|
static |
|
static |
|
static |