COLLADA 1.4 DOM: daeMetaAttribute Class Reference

COLLADA

daeMetaAttribute Class Reference

#include <daeMetaAttribute.h>

Inheritance diagram for daeMetaAttribute:

Inheritance graph
[legend]
Collaboration diagram for daeMetaAttribute:

Collaboration graph
[legend]
List of all members.

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 symantic operations it is capable of including set(), get(), print(), and resolve(). 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.

Public Member Functions

 daeMetaAttribute ()
 Constructor.
 ~daeMetaAttribute ()
 Destructor.
daeBool getIsValid ()
 Determines if the value of this attribute was ever set.
void setIsValid (daeBool isValid)
 Sets the value that indicates if this attribute contains a valid value.
daeBool getIsRequired ()
 Determines if the schema indicates that this is a required attribute.
void setIsRequired (daeBool isRequired)
 Sets the value that indicates that this attribute is required by the schema.
void setOffset (daeInt offset)
 Sets the byte offset (from this) where this attribute's storage is found in its container element class.
daeInt getOffset ()
 Gets the byte offset (from @ this) where this attribute's storage is found in its container element class.
void setName (daeString name)
 Sets the name of the attribute.
daeStringRef getName ()
 Gets the name of this attribute.
void setType (daeAtomicType *type)
 Sets the type of the attribute.
daeAtomicTypegetType ()
 Gets the daeAtomicType used by this attribute.
void setDefault (daeString defaultVal)
 Sets the default for this attribute via a string.
daeString getDefault ()
 Gets the default for this attribute via a string.
void setContainer (daeMetaElement *container)
 Sets the containing daeMetaElement for this attribute.
daeMetaElementgetContainer ()
 Gets the containing daeMetaElement for this attribute.
virtual daeInt getCount (daeElement *e)
 Gets the number of particles associated with this attribute in instance e.
virtual daeMemoryRef get (daeElement *e, daeInt index)
 Gets a particle from containing element e based on index.
virtual daeMetaAttributeRef clone ()
 Clones the daeMetaAttribute.
virtual void resolve (daeElementRef elem)
 Resolves a reference (if there is one) in the attribute type; only useful for reference types.
virtual daeInt getSize ()
 Gets the number of bytes for this attribute.
virtual daeInt getAlignment ()
 Gets the alignment in bytes on the class of this meta attribute type.
virtual void set (daeElement *element, daeString s)
 Sets the value of this attribute on element by converting string s to a binary value and assigning it via the underlying daeAtomicType system.
virtual void copy (daeElement *toElement, daeElement *fromElement)
 Copys the value of this attribute from fromElement into toElement.
daeChar * getWritableMemory (daeElement *e)
 Gets the storage inside of e associated with this attribute.

Static Public Member Functions

static daeMetaAttributeRef Factory (daeStringRef xmlTypeName)
 Obsolete.
static void InitializeKnownTypes ()
 Obsolete.

Static Public Attributes

static daeStringRefArrayArray _NameBindings
 Lists the type names that can be created by factories and indicates which _FactoryTemplates to use for each type.
static daeMetaAttributeRefArray _FactoryTemplates
 Points to the factory objects used to construct various types of attributes, _NameBindings specifies which type names are bound to which factories.

Protected Attributes

daeStringRef _name
daeInt _offset
daeAtomicType_type
daeMetaElement_container
daeString _default
daeBool _isValid
daeBool _isRequired

Member Function Documentation

daeMetaAttributeRef daeMetaAttribute::clone  )  [virtual]
 

Clones the daeMetaAttribute.

Returns:
Returns a duplicate of this daeMetaAttribute.
Note:
Not Implemented.

Reimplemented in daeMetaElementAttribute, daeMetaElementArrayAttribute, and daeMetaArrayAttribute.

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

Copys 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 daeMetaElementAttribute, daeMetaElementArrayAttribute, and daeMetaArrayAttribute.

daeMemoryRef daeMetaAttribute::get daeElement e,
daeInt  index
[virtual]
 

Gets a particle from containing element e based on index.

Parameters:
e Containing element from which to get the element.
index Index of the particle to retrieve if indeed there is an array of elements rather than a singleton.
Returns:
Returns the associated particle out of parent element e, based on index, if necessary.

Reimplemented in daeMetaElementAttribute, daeMetaElementArrayAttribute, and daeMetaArrayAttribute.

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.

daeInt daeMetaAttribute::getCount daeElement e  )  [virtual]
 

Gets the number of particles associated with this attribute in instance e.

Parameters:
e Containing element to run the operation on.
Returns:
Returns the number of particles associated with this attribute in instance e.

Reimplemented in daeMetaElementAttribute, daeMetaElementArrayAttribute, and daeMetaArrayAttribute.

daeString daeMetaAttribute::getDefault  )  [inline]
 

Gets the default for this attribute via a string.

The attribute's type is used to convert the string into a binary value inside of an element.

Returns:
Returns a daeString 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.

daeBool daeMetaAttribute::getIsValid  )  [inline]
 

Determines if the value of this attribute was ever set.

This will be the case if setDefault() was called or if the attribute was assigned a value by the input file. If you set the value yourself, you need to call setIsValid() to set this flag.

Returns:
Returns true if the value in this attribute is valid.

daeStringRef daeMetaAttribute::getName  )  [inline]
 

Gets the name of this attribute.

Returns:
Returnsthe name of this attribute.

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.

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.

daeChar* daeMetaAttribute::getWritableMemory daeElement e  )  [inline]
 

Gets the storage inside of e associated with this attribute.

It is very useful for performing generic processing on elements and attributes from external tools regardless of element and attribute type.

Parameters:
e Element from which to apply this attributes offset.
Returns:
Returns the storage associate with this attribute in e.

void daeMetaAttribute::resolve daeElementRef  elem  )  [virtual]
 

Resolves a reference (if there is one) in the attribute type; only useful for reference types.

Parameters:
elem Containing element on which this attribute should be resolved.

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

Sets the value of this attribute on element by converting string s to a binary value and assigning it via the underlying daeAtomicType system.

Parameters:
element Element on which to set this attribute.
s String containing the value to be converted via the atomic type system.

Reimplemented in daeMetaElementAttribute, and daeMetaArrayAttribute.

void daeMetaAttribute::setContainer daeMetaElement container  )  [inline]
 

Sets the containing daeMetaElement for this attribute.

Parameters:
container Element on which this daeMetaAttribute belongs.

void daeMetaAttribute::setDefault daeString  defaultVal  )  [inline]
 

Sets the default for this attribute via a string.

The attribute's type is used to convert the string into a binary value inside of an element.

Parameters:
defaultVal daeString representing the default value.

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.

void daeMetaAttribute::setIsValid daeBool  isValid  )  [inline]
 

Sets the value that indicates if this attribute contains a valid value.

If you don't set this on an optional attribute, that attribute will not be written.

Parameters:
isValid Indicates if the value in this attribute valid, true if it is, false if not.

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.

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.

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.


The documentation for this class was generated from the following files:
  • C:/SVN_wf/COLLADA_DOM/include/dae/daeMetaAttribute.h
  • C:/SVN_wf/COLLADA_DOM/src/dae/daeMetaAttribute.cpp

©2005 Sony Computer Entertainment Inc.. All Rights Reserved.
Generated on Fri Feb 10 16:47:03 2006 for COLLADA 1.4 DOM by doxygen 1.4.3