#include <typeDesc.h>
Public Member Functions | |
virtual DataTypeEnum | getDataType () const |
Returns the DataTypeEnum value of the current type. | |
virtual const std::string | getName () const |
Returns name of the type. | |
virtual const std::string | getNamespace () const |
Returns name of the namespace in which this type is defined. | |
virtual void * | newInstance () const |
Allocates a new instance of the data type this Type represents. | |
virtual Object * | newObjectInstance () const |
Allocates a new instance of the reflection-capable class this Type represents. | |
virtual void | deleteInstance (void *instance) const |
Frees the instance allocated by the newInstance method. | |
virtual int | getSizeOf (const void *object) const |
Returns memory size of object of this type. | |
virtual DataTypeClassEnum | getDataTypeClass () const |
Returns the data type class for the current type. | |
virtual void | fillAttributeValues (const Object &o, std::map< std::string, AttributeValue > &out) const |
Used by Object. | |
virtual bool | isBuiltIn () const |
Determines whether the type is C++ built-in or STL data type. |
Specialisations of this class are either defined in the IOPC 2 library or generated by iopcsp
using the macros from iopcmeta/metaSupport.h
virtual const std::string iopc::TypeDesc< T >::getNamespace | ( | ) | const [virtual] |
Returns name of the namespace in which this type is defined.
Returns empty string if the type does not have any namespace.
Implements iopc::Type.
virtual void* iopc::TypeDesc< T >::newInstance | ( | ) | const [inline, virtual] |
Allocates a new instance of the data type this Type represents.
The instance is allocated using the new operator. To free the instance, use the corresponding deleteInstance(void* instance) method.
Implements iopc::Type.
virtual Object* iopc::TypeDesc< T >::newObjectInstance | ( | ) | const [inline, virtual] |
Allocates a new instance of the reflection-capable class this Type represents.
The instance is allocated using the new operator. To free the instance, you can use standard delete operator.
Implements iopc::Type.
virtual int iopc::TypeDesc< T >::getSizeOf | ( | const void * | object | ) | const [virtual] |
Returns memory size of object of this type.
In some cases, the object parameter is ignored as it is not needed to determine the memory size. (Types of non-variable length such as numeric types). For some variable length types such as std::string or EString it doesn't return sizeof(std::string), sizeof(EString), but memory size needed to store the strings as standard, zero-terminated C-strings.
Implements iopc::Type.
virtual void iopc::TypeDesc< T >::fillAttributeValues | ( | const Object & | o, | |
std::map< std::string, AttributeValue > & | out | |||
) | const [virtual] |
Used by Object.
Used to fill a map of AttributeValues by the type description
[in] | o | Object containing the attributes |
[out] | out | Map into which the attribute values are inserted |
Implements iopc::Type.