C12Adapter Opensource C++ Interface
MPropertyDefinition Class Reference

Property definition of the object. More...

Public Types

enum  { MAXIMUM_PROPERTY_NAME_LENGTH = 44 }
 

Public Member Functions

bool IsEnumeration () const
 Whether the property is actually a read-only integer enumeration value.
 
bool IsClassProperty () const
 True if this is a class service rather than an object service. More...
 
bool IsReadOnly () const
 Whether this is a read-only property, or enumeration.
 
bool IsDefaultValuePresent () const
 Tells if the default value of the property is present. More...
 
MVariant GetDefaultValue () const
 Get the default value of the property. More...
 
int GetEnumerationValueAsInt () const
 Get the enumeration value as signed integer. More...
 
unsigned GetEnumerationValueAsUnsigned () const
 Get the enumeration value as unsigned. More...
 

Public Attributes

char m_name [MAXIMUM_PROPERTY_NAME_LENGTH]
 Name of the property. More...
 
MVariant::Type m_type
 Type of the property.
 
MClass::ServiceType m_getServiceType
 Get method type.
 
MClass::ServiceType m_setServiceType
 Set method type.
 
MObject::Method m_getObjectMethod
 Pointer to the object method to call in order to get the property. More...
 
MClass::Method m_getClassMethod
 Pointer to the class method to call in order to get the property. More...
 
MObject::Method m_setObjectMethod
 Pointer to the object method to call in order to set the property. More...
 
MClass::Method m_setClassMethod
 Pointer to the class method to call in order to set the property. More...
 
void * m_valuePtr
 First value placeholder, if used. More...
 
int m_valueInt
 Second value placeholder, if used. More...
 

Detailed Description

Property definition of the object.

Using this definition, the property marshalling is implemented. The user can gain access to this structure to acquire the attributes of the property.

The property definitions are stored in an array with the special last property definition having an empty name.

Member Function Documentation

MVariant MPropertyDefinition::GetDefaultValue ( ) const
inline

Get the default value of the property.

One can look at the convenience service IsDefaultValuePresent to check if the property has a default value.

Precondition
This has to be a persistent property.
int MPropertyDefinition::GetEnumerationValueAsInt ( ) const
inline

Get the enumeration value as signed integer.

Precondition
This has to be enumeration property or an assertion is hit in debug mode.
unsigned MPropertyDefinition::GetEnumerationValueAsUnsigned ( ) const
inline

Get the enumeration value as unsigned.

Precondition
This has to be enumeration property or an assertion is hit in debug mode.
bool MPropertyDefinition::IsClassProperty ( ) const
inline

True if this is a class service rather than an object service.

Class service is called static service in C++.

Precondition
The parameter is in range of ServiceType enumeration. There is a debug check.
bool MPropertyDefinition::IsDefaultValuePresent ( ) const
inline

Tells if the default value of the property is present.

The properties with default values are those which are stored persistently, and only persistent properties can have default values. By convention, enumerations do not have default values. If it is an enumeration, false is returned.

Member Data Documentation

MClass::Method MPropertyDefinition::m_getClassMethod

Pointer to the class method to call in order to get the property.

Note that the actual type is determined by m_getServiceType, and it should correspond to m_type. Few assertions done in the source code.

Valid only if name is not empty, and service type is a class method. If this is equal to NULL, it means the property is Set-only.

MObject::Method MPropertyDefinition::m_getObjectMethod

Pointer to the object method to call in order to get the property.

Note that the actual type is determined by m_getServiceType, and it should correspond to m_type. Few assertions done in the source code.

Valid only if name is not empty, and service type is an object method. If this is equal to NULL, it means the property is Set-only.

char MPropertyDefinition::m_name[MAXIMUM_PROPERTY_NAME_LENGTH]

Name of the property.

Internally, if the name is all zeros, it means this structure is the last in the property list.

MClass::Method MPropertyDefinition::m_setClassMethod

Pointer to the class method to call in order to set the property.

Note that the actual type is determined by m_setServiceType, and it should correspond to m_type.

Valid only if name is not empty, and service type is a class method. Because there are no set-only properties, the class method is never equal to NULL.

MObject::Method MPropertyDefinition::m_setObjectMethod

Pointer to the object method to call in order to set the property.

Note that the actual type is determined by m_setServiceType, and it should correspond to m_type.

Valid only if name is not empty, and service type is an object method Because there are no set-only properties, the object method is never equal to NULL.

int MPropertyDefinition::m_valueInt

Second value placeholder, if used.

This is an integer value.

void* MPropertyDefinition::m_valuePtr

First value placeholder, if used.

This is a pointer value.