OCDM_Attribute Class Reference

#include <OCDM.h>

Inheritance diagram for OCDM_Attribute:

OCDM_Object List of all members.

Public Member Functions

 OCDM_Attribute ()
 OCDM_Attribute (const CDM_Object obj)
 OCDM_Attribute (const class OCDM_Attribute &obj)
 OCDM_Attribute (const char *name, const OCDM_AttributeValue &AttrVal)
 OCDM_Attribute (const char *name, const int Type, const char *Value)
OCDM_Attributeoperator= (const class OCDM_Object &obj)
 This is the default assignment operator.
const char * GetName (void) const
 Returns Attribute's name.
const char * GetValueString (void) const
 Returns Attribute's Value String.
 OCDM_REF (OCDM_AttributeValue) GetValue(void) const
int GetValueType (void) const
 Returns Attribute's Type.
const char * GetValueValue (void) const
 This function will return the value of the Attribute value of the Attribute object in use.
void ReconstructAttribute (void) const
 This function will construct and return a new Attribute object that will be an exact copy of the provided one.
void ReconstructAttribute (int *type) const
 This function will construct and return a new Attribute object that will be an exact copy of the provided one.
const char * objectType (void) const

Detailed Description

This class is related to the use and manipulation of Attributes.


Constructor & Destructor Documentation

OCDM_Attribute (  )  [inline]

OCDM_Attribute ( const CDM_Object  obj  )  [inline]

OCDM_Attribute ( const class OCDM_Attribute obj  )  [inline]

OCDM_Attribute ( const char *  name,
const OCDM_AttributeValue AttrVal 
)

Description:
An overloaded version of the above function. It is the main constructor of the OCDM_Attribute class.
Needless to say that this function will create an Attribute object

Special attention should be given to the Attribute value object (specified by the "Value" parameter) so as not to leak memory. This function internally will always increase the reference count.

The value of the "Name" parameter will not be modified or referenced in any way, as CDM will create and manipulate a local copy of this value.

Arguments:
  • name: The name of the OCDM_Attribute object to be created.
  • Attrval: The value of the Atribute to be created.

OCDM_Attribute ( const char *  name,
const int  Type,
const char *  Value 
)

Description:
This constructor will create an OCDM_Attribute object with the provided name (as specified through the "Name" parameter). However, an Attribute Value object is not required: instead an Attribute Value object will be created by using the provided parameters "Type" and "Value".
Arguments:
  • name: The name of the OCDM_Attribute object to be created.
  • Type: The type of the Attribute Value.
  • Value: The value to be placed in the Attribute.


Member Function Documentation

class OCDM_Attribute& operator= ( const class OCDM_Object obj  )  [inline, virtual]

Description: This is the default sssignment operator. Note that under
languages that do not support operator overloading (i.e. Java, Perl, Python) this operator appears as a plain method named as "set".
Arguments:
  • obj: the object to be copied.
Returns:
This method returns a reference to the current object.

Reimplemented from OCDM_Object.

const char * GetName ( void   )  const

Note:
In case of Error an Exception of type OCDM_Exception will be thrown

const char * GetValueString ( void   )  const

Note:
In case of Error an Exception of type OCDM_Exception will be thrown

OCDM_REF ( OCDM_AttributeValue   )  const

int GetValueType ( void   )  const

Note:
In case of Error an Exception of type OCDM_Exception will be thrown

const char * GetValueValue ( void   )  const

Description:
This function will return the value of the Attribute value of the Attribute object in use. An Attribute value consists of two elements: the type of the information stored as Attribute value (for example GDM_STRING or GDM_STRING_SET) and the information that is stored as a value of the Attribute. This function returns the latter object. This function is different from GetValue, as GetValue returns a list object that holds two elements, the value type and the value. On the other hand, GetValueValue returns directly the value, by ommiting the object specifying the type. If the caller wants to also get the type of the value, he can either call GetValue or GetValueType.
Note:
In case of Error an Exception of type OCDM_Exception will be thrown

void ReconstructAttribute ( void   )  const

Description:
This function will construct and return a new Attribute object that will be an exact copy of the provided one. The difference will be that the returned Attribute object will utilise elements from the object cache that is managed internally by CDM. As a result the returned object will normally require less memory to be stored than the provided one, as it will re-use elements already in use by other CDM objects.
Note:
This function should be used on Attribute objects that originate from an unknown source. For example, if an Attribute object is stored in a file and then red back as a string, it will not use cached by the CDM objects. It will be a good idea if the caller created a new object by calling this function and delete the object red from the file by either calling Tcl_DecrRefCount or CDM_Free.

void ReconstructAttribute ( int *  type  )  const

Description:
This function will construct and return a new Attribute object that will be an exact copy of the provided one. The only difference will be that the returned Attribute object will utilise elements from the object cache that is managed internally by CDM. As a result the returned object will normally require less memory to be stored than the provided one, as it will re-use elements already in use by other CDM objects.
Note:
This function should be used on Attribute objects that originate from an unknown source. For example, if an Attribute object is stored in a file and then red back as a string, it will not use cached by the CDM objects. It will be a good idea if the caller created a new object by calling this function and delete the object red from the file by either calling Tcl_DecrRefCount or CDM_Free.

const char* objectType ( void   )  const [inline, virtual]

This method returns the type of the object as a string.

Reimplemented from OCDM_Object.


Generated on Tue Jun 26 17:40:45 2007 for PerlCDM by  doxygen 1.5.2