iopc::TypeDesc< T > Class Template Reference
[iopcmeta]

Type Description template class. Implements the Type interface. More...

#include <typeDesc.h>

Inheritance diagram for iopc::TypeDesc< T >:

Inheritance graph
[legend]

List of all members.

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 ObjectnewObjectInstance () 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.


Detailed Description

template<typename T>
class iopc::TypeDesc< T >

Type Description template class. Implements the Type interface.

Specialisations of this class are either defined in the IOPC 2 library or generated by iopcsp using the macros from iopcmeta/metaSupport.h


Member Function Documentation

template<typename T>
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.

template<typename T>
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.

template<typename T>
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.

Returns:
Other types than Object descendants return NULL.

Implements iopc::Type.

template<typename T>
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.

Returns:
Memory size needed to store the object this type represents.

Implements iopc::Type.

template<typename T>
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

Parameters:
[in] o Object containing the attributes
[out] out Map into which the attribute values are inserted

Implements iopc::Type.


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

Generated on Tue Apr 14 16:46:38 2009 for IOPC 2 by  doxygen 1.5.6