daeMetaAttribute Class Reference

#include <daeMetaAttribute.h>

Inheritance diagram for daeMetaAttribute:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual daeInt compare (daeElement *elt1, daeElement *elt2)
virtual daeInt compareToDefault (daeElement *e)
virtual void copy (daeElement *toElement, daeElement *fromElement)
virtual void copyDefault (daeElement *element)
 daeMetaAttribute ()
virtual daeMemoryRef get (daeElement *e)
virtual daeInt getAlignment ()
daeMetaElementgetContainer ()
daeString getDefaultString ()
daeMemoryRef getDefaultValue ()
daeBool getIsRequired ()
daeStringRef getName ()
daeInt getOffset ()
virtual daeInt getSize ()
daeAtomicTypegetType ()
virtual daeChargetWritableMemory (daeElement *e)
virtual daeBool isArrayAttribute ()
virtual void memoryToString (daeElement *e, std::ostringstream &buffer)
virtual void set (daeElement *element, daeString s)
void setContainer (daeMetaElement *container)
virtual void setDefaultString (daeString defaultVal)
virtual void setDefaultValue (daeMemoryRef defaultVal)
virtual void setDocument (daeElement *e, daeDocument *doc)
void setIsRequired (daeBool isRequired)
void setName (daeString name)
void setOffset (daeInt offset)
void setType (daeAtomicType *type)
virtual void stringToMemory (daeElement *e, daeString s)
virtual ~daeMetaAttribute ()

Protected Attributes

daeMetaElement_container
std::string _defaultString
daeMemoryRef _defaultValue
daeBool _isRequired
daeStringRef _name
daeInt _offset
daeAtomicType_type

Detailed Description

The daeMetaAttribute class describes one attribute in a C++ COLLADA dom element.

In the case of the C++ object model a conceptual attribute can be either a dom attribute, a dom element, or a dom value. Essentially, the meta attribute describes fields on the C++ class. However these attributes are stored separately in the containing meta daeMetaElement. daeMetaAttributes always exist inside of daeMetaElements. Each daeMetaAttribute has certain semantic operations it is capable of including set(), get(), and print(). daeMetaAttributes use the daeAtomicType system as their underlying semantic implementation, but contain additional information about the packaging of the atomic types into the C++ dom classes such as offset, and array information.

Definition at line 41 of file daeMetaAttribute.h.


Constructor & Destructor Documentation

daeMetaAttribute::daeMetaAttribute (  ) 

Constructor

virtual daeMetaAttribute::~daeMetaAttribute (  )  [virtual]

Destructor


Member Function Documentation

virtual daeInt daeMetaAttribute::compare ( daeElement elt1,
daeElement elt2 
) [virtual]

Compares the value of this attribute in the given elements.

Parameters:
elt1 The first element whose attribute value should be compared.
elt2 The second element whose attribute value should be compared.
Returns:
Returns a positive integer if value1 > value2, a negative integer if value1 < value2, and 0 if value1 == value2.

Reimplemented in daeMetaArrayAttribute.

virtual daeInt daeMetaAttribute::compareToDefault ( daeElement e  )  [virtual]

Compares the value of this attribute from the given element to the default value of this attribute (if one exists).

Parameters:
e The element whose value should be compared to the default value.
Returns:
Returns a positive integer if value > default, a negative integer if value < default, and 0 if value == default.

Reimplemented in daeMetaArrayAttribute.

virtual void daeMetaAttribute::copy ( daeElement toElement,
daeElement fromElement 
) [virtual]

Copies the value of this attribute from fromElement into toElement.

Parameters:
toElement Pointer to a daeElement to copy this attribute to.
fromElement Pointer to a daeElement to copy this attribute from.

Reimplemented in daeMetaArrayAttribute, daeMetaElementAttribute, and daeMetaElementArrayAttribute.

virtual void daeMetaAttribute::copyDefault ( daeElement element  )  [virtual]

Copies the default value of this attribute to the element

Parameters:
element Pointer to a daeElement to copy the default value to.

Reimplemented in daeMetaArrayAttribute.

virtual daeMemoryRef daeMetaAttribute::get ( daeElement e  )  [virtual]

Gets the attribute's memory pointer from containing element e.

Parameters:
e Containing element from which to get the value.
Returns:
Returns the memory pointer corresponding to this attribute out of parent element e.
virtual daeInt daeMetaAttribute::getAlignment (  )  [virtual]

Gets the alignment in bytes on the class of this meta attribute type.

Returns:
Returns the alignment in bytes.
daeMetaElement* daeMetaAttribute::getContainer (  )  [inline]

Gets the containing daeMetaElement for this attribute.

Returns:
Returns the daeMetaElement to which this daeAttribute belongs.

Definition at line 149 of file daeMetaAttribute.h.

daeString daeMetaAttribute::getDefaultString (  ) 

Gets the default for this attribute as a string.

Returns:
Returns a daeString representing the default value.
daeMemoryRef daeMetaAttribute::getDefaultValue (  ) 

Gets the default for this attribute as a memory value.

Returns:
Returns a daeMemoryRef representing the default value.
daeBool daeMetaAttribute::getIsRequired (  )  [inline]

Determines if the schema indicates that this is a required attribute.

Returns:
Returns true if this is a required attribute, false if not.

Definition at line 67 of file daeMetaAttribute.h.

daeStringRef daeMetaAttribute::getName (  )  [inline]

Gets the name of this attribute.

Returns:
Returnsthe name of this attribute.

Definition at line 99 of file daeMetaAttribute.h.

daeInt daeMetaAttribute::getOffset (  )  [inline]

Gets the byte offset (from @ this) where this attribute's storage is found in its container element class.

Returns:
Returns the integer byte offset from this pointer for this attribute.

Definition at line 86 of file daeMetaAttribute.h.

virtual daeInt daeMetaAttribute::getSize (  )  [virtual]

Gets the number of bytes for this attribute.

Returns:
Returns the number of bytes in the C++ COLLADA dom element for this attribute.
daeAtomicType* daeMetaAttribute::getType (  )  [inline]

Gets the daeAtomicType used by this attribute.

Returns:
Returns the daeAtomicType that this attribute uses for its implementation.

Definition at line 113 of file daeMetaAttribute.h.

virtual daeChar* daeMetaAttribute::getWritableMemory ( daeElement e  )  [virtual]
virtual daeBool daeMetaAttribute::isArrayAttribute (  )  [inline, virtual]

Gets if this attribute is an array attribute.

Returns:
Returns true if this attribute is an array type.

Reimplemented in daeMetaArrayAttribute, daeMetaElementAttribute, and daeMetaElementArrayAttribute.

Definition at line 177 of file daeMetaAttribute.h.

virtual void daeMetaAttribute::memoryToString ( daeElement e,
std::ostringstream &  buffer 
) [virtual]

Converts an element's attribute value to a string.

Reimplemented in daeMetaArrayAttribute.

virtual void daeMetaAttribute::set ( daeElement element,
daeString  s 
) [virtual]

Reimplemented in daeMetaElementAttribute.

void daeMetaAttribute::setContainer ( daeMetaElement container  )  [inline]

Sets the containing daeMetaElement for this attribute.

Parameters:
container Element on which this daeMetaAttribute belongs.

Definition at line 143 of file daeMetaAttribute.h.

virtual void daeMetaAttribute::setDefaultString ( daeString  defaultVal  )  [virtual]

Sets the default for this attribute via a string.

Parameters:
defaultVal daeString representing the default value.

Reimplemented in daeMetaArrayAttribute.

virtual void daeMetaAttribute::setDefaultValue ( daeMemoryRef  defaultVal  )  [virtual]

Sets the default for this attribute via a memory pointer.

Parameters:
defaultVal daeMemoryRef representing the default value.

Reimplemented in daeMetaArrayAttribute.

virtual void daeMetaAttribute::setDocument ( daeElement e,
daeDocument doc 
) [virtual]

Notifies an attribute when the containing document changes.

Reimplemented in daeMetaArrayAttribute, daeMetaElementAttribute, and daeMetaElementArrayAttribute.

void daeMetaAttribute::setIsRequired ( daeBool  isRequired  )  [inline]

Sets the value that indicates that this attribute is required by the schema. If set, the attribute will always be exported by the API regardless of its value.

Parameters:
isRequired Indicates if the schema says this attribute is required, true if it is, false if not.

Definition at line 73 of file daeMetaAttribute.h.

void daeMetaAttribute::setName ( daeString  name  )  [inline]

Sets the name of the attribute.

Parameters:
name daeString that is directly stored as a pointer without being copied.

Definition at line 93 of file daeMetaAttribute.h.

void daeMetaAttribute::setOffset ( daeInt  offset  )  [inline]

Sets the byte offset (from this) where this attribute's storage is found in its container element class.

Parameters:
offset Integer byte offset from this pointer.

Definition at line 79 of file daeMetaAttribute.h.

void daeMetaAttribute::setType ( daeAtomicType type  )  [inline]

Sets the type of the attribute.

Parameters:
type daeAtomicType to use for interacting with this attribute in a containing daeElement.

Definition at line 106 of file daeMetaAttribute.h.

virtual void daeMetaAttribute::stringToMemory ( daeElement e,
daeString  s 
) [virtual]

Converts a string to a memory value in the specified element.

Reimplemented in daeMetaArrayAttribute.


Member Data Documentation

Definition at line 47 of file daeMetaAttribute.h.

std::string daeMetaAttribute::_defaultString [protected]

Definition at line 48 of file daeMetaAttribute.h.

Definition at line 49 of file daeMetaAttribute.h.

Definition at line 50 of file daeMetaAttribute.h.

Definition at line 44 of file daeMetaAttribute.h.

Definition at line 45 of file daeMetaAttribute.h.

Definition at line 46 of file daeMetaAttribute.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


colladadom
Author(s): Du Hung Hou, Khronos.org, Marcus Barnes, Greg Corson, Herbert Law, Sebastian Schwarz, Steven Thomas, John Hsu (ros package), Tim Field (ros package)
autogenerated on Fri Jan 11 09:29:14 2013