COLLADA 1.4 DOM: daeMetaElement Class Reference

COLLADA

daeMetaElement Class Reference

#include <daeMetaElement.h>

Inheritance diagram for daeMetaElement:

Inheritance graph
[legend]
Collaboration diagram for daeMetaElement:

Collaboration graph
[legend]
List of all members.

Detailed Description

Each instance of the daeMetaElement class describes a C++ COLLADA dom element type.

The meta information in daeMetaElement is a combination of the information required to create and maintain C++ object instances and the information necessary to parse and construct a hierarchy of COLLADA elements.
daeMetaElement objects also act as factories for C++ COLLADA dom classes where each daeElement is capable of creating an instance of the class it describes. Further, each daeMetaElement contains references to other daeMetaElements for potential XML children elements. This enables this system to easily create daeElements of the appropriate type while navigating through XML recursive parse.
See daeElement for information about the functionality that every daeElement implements.

Public Member Functions

 daeMetaElement ()
 Constructor.
 ~daeMetaElement ()
 Destructor.
size_t getPossibleChildrenCount ()
 Gets the number of possible children of elements of this type that don't actually belong to this type.
daeString getPossibleChildName (daeInt index)
 Gets the name of the possible child specified.
daeMetaElementAttributegetPossibleChildContainer (daeInt index)
 Gets the containing element for the possible child specified.
daeString getPossibleChildType (daeInt index)
 Gets the type of the possible child specified.
daeBool getIsAbstract ()
 Determines if elements of this type can be placed in the object model.
daeBool getIsTransparent ()
 Determines if elements of this type should have an element tag printed when saving.
void setIsAbstract (daeBool abstract)
 Sets if elements of this type are abstract.
void setIsTransparent (daeBool transparent)
 Sets whether or not elements of this type should have an element tag printed when saving.
daeBool getIsTrackableForQueries ()
 Determines if elements of this type should be tracked for daeDatabase queries.
daeBool getUsesStringContents ()
 Gets whether elements of this type have "string" based contents; this is necessary to change the parsing mode for strings.
void setIsTrackableForQueries (daeBool trackable)
 Sets whether elements of this type should be tracked for daeDatabase queries.
daeBool getAllowsAny ()
 Determines if elements of this type allow for any element as a child.
void setAllowsAny (daeBool allows)
 Sets if elements of this type allow for any element as a child.
daeMetaElementgetMetaIntegration ()
 Gets the daeMetaElement for the corresponding integration object associated with this COLLADA element (if any).
void setMetaIntegration (daeMetaElement *mI)
 Sets the daeMetaElement for the corresponding integration object associated with this COLLADA element (if any).
daeMetaAttributegetValueAttribute ()
 Gets the daeMetaAttribute for the non-element contents of a daeElement.
daeMetaAttributegetIDAttribute ()
 Gets the daeMetaAttribute for the ID attribute of a daeElement.
daeMetaElementfindChild (daeString elementName)
 Gets the daeMetaElement associated with a child element of a given element type.
daeMetaElementgetParent ()
 Gets the container of this element type as defined by the COLLADA's XML schema.
daeStringRef getName ()
 Gets the name of this element type.
void setName (daeString s)
 Sets the name of this element type.
daeMetaElementAttributeArraygetMetaElements ()
 Gets the array of element attributes associated with this element type.
daeMetaAttributePtrArraygetMetaResolvers ()
 Gets the array of attributes that represent URI fields that need to be "resolved" after the database is completely read in.
daeMetaAttributeRefArraygetMetaAttributes ()
 Gets the array of all known attributes on this element type.
daeMetaElementAttributeArraygetMetaElementArray ()
 Gets the array of element attributes associated with this element type.
daeMetaAttributegetMetaAttribute (daeString s)
 Gets the attribute which has a name as provided by the s parameter.
void setElementSize (daeInt size)
 Sets the size in bytes of each instance of this element type.
daeInt getElementSize ()
 Gets the size in bytes of each instance of this element type.
void addContents (daeInt offset)
 Resisters with the reflective object system that the dom class described by this daeMetaElement contains a _contents array.
daeMetaElementArrayAttributegetContents ()
 Gets the attribute associated with the contents meta information.
void appendElement (daeMetaElement *metaElement, daeInt offset, daeString name=NULL)
 Appends another element type to be a potential child element of this element type.
void appendArrayElement (daeMetaElement *metaElement, daeInt offset, daeString name=NULL)
 Appends the potential child element as a list of potential child elements rather than as a singleton.
void appendAttribute (daeMetaAttribute *attr)
 Appends a daeMetaAttribute that represents a field corresponding to an XML attribute to the C++ version of this element type.
void appendPossibleChild (daeString name, daeMetaElementAttribute *cont, daeString type=NULL)
 Appends a possible child and maps the name to the actual container.
void setStaticPointerAddress (daeMetaElement **addr)
 Sets the address where the static pointer lives for this element type's daeMetaElement.
daeMetaElement ** getStaticPointerAddress ()
 Gets the address where the static pointer lives for this element type's daeMetaElement.
void registerConstructor (daeElementConstructFunctionPtr func)
 Registers the function that can construct a C++ instance of this class.
daeBool needsResolve ()
 Determines if this element contains attributes of type daeURI which need to be resolved after they are read or setup.
void validate ()
 Validates this class to be used by the runtime c++ object model including factory creation.
daeBool place (daeElementRef parent, daeElementRef child)
 Places a child element into the parent element where the calling object is the daeMetaElement for the parent element.
daeElementRef create ()
 Invokes the factory element creation routine set by registerConstructor() to return a C++ COLLADA Object Model instance of this element type.
daeElementRef create (daeString childElementTypeName)
 Looks through the list of potential child elements for this element type finding the corresponding element type; if a corresponding element type is found, use that type as a factory and return an instance of that child type.
daeMetaElementgetChildMetaElement (daeString s)
 Gets the meta information for a given subelement.

Static Public Member Functions

static void initializeSchemaMeta ()
 Empty no-op function.
static void releaseMetas ()
 Releases all of the meta information contained in daeMetaElements.

Static Public Attributes

static daeMetaElement_Schema = NULL
 Unused.

Protected Attributes

daeStringRef _name
daeElementConstructFunctionPtr _createFunc
daeInt _minOccurs
daeInt _maxOccurs
daeStringRef _ref
daeBool _isSequence
daeBool _isChoice
daeBool _needsResolve
daeInt _elementSize
daeMetaElementAttributeArray _metaElements
daeMetaAttributeRefArray _metaAttributes
daeMetaAttributeRef _metaValue
daeMetaElementArrayAttribute_metaContents
daeMetaElement_metaIntegration
daeMetaAttributeRef _metaID
daeMetaElement_parent
daeMetaElement ** _staticPointerAddress
daeMetaAttributePtrArray _resolvers
daeBool _isTrackableForQueries
daeBool _usesStringContents
daeBool _isTransparent
daeBool _isAbstract
daeBool _allowsAny
daeStringArray _otherChildren
daeStringArray _otherChildrenTypes
daeTArray< daeMetaElementAttribute * > _otherChildrenContainer

Static Protected Attributes

static daeMetaElementRefArray _metas

Member Function Documentation

void daeMetaElement::addContents daeInt  offset  ) 
 

Resisters with the reflective object system that the dom class described by this daeMetaElement contains a _contents array.

This method is only for daeMetaElement contstuction, and should only be called by the system as it sets up the Reflective Object System.

Parameters:
offset Byte offset for the contents field in the C++ element class.

void daeMetaElement::appendArrayElement daeMetaElement metaElement,
daeInt  offset,
daeString  name = NULL
 

Appends the potential child element as a list of potential child elements rather than as a singleton.

Parameters:
metaElement daeMetaElement of the potential child element.
offset Byte offset where the corresponding C++ field lives in each C++ class instance for this element type. In this case the C++ field will be an array of elements rather than merely a pointer to one.
name The name for this attribute if the type is complex, if none is specified, the name of the metaElement will be used.
Note:
This function is the same as appendElement(), except that it appends the potential child element as a list of potential child elements rather than as a singleton.

void daeMetaElement::appendAttribute daeMetaAttribute attr  ) 
 

Appends a daeMetaAttribute that represents a field corresponding to an XML attribute to the C++ version of this element type.

Parameters:
attr Attribute to append to this element types list of potential attributes.

void daeMetaElement::appendElement daeMetaElement metaElement,
daeInt  offset,
daeString  name = NULL
 

Appends another element type to be a potential child element of this element type.

Parameters:
metaElement daeMetaElement of the potential child element.
offset Byte offset where the corresponding C++ field lives in each c++ class instance for this element type.
name The name for this attribute if the type is complex, if none is specified, the name of the daeMetaElement will be used.

void daeMetaElement::appendPossibleChild daeString  name,
daeMetaElementAttribute cont,
daeString  type = NULL
 

Appends a possible child and maps the name to the actual container.

Parameters:
name The name of the child element.
cont Pointer to the daeMetaElementAttribute which contains the element.
type The type name of the possible child.

daeElementRef daeMetaElement::create daeString  childElementTypeName  ) 
 

Looks through the list of potential child elements for this element type finding the corresponding element type; if a corresponding element type is found, use that type as a factory and return an instance of that child type.

Typically place() is called after create(childelementname)

Parameters:
childElementTypeName Type name to create.
Returns:
Returns the created element if the type was found as a potential child element.

daeElementRef daeMetaElement::create  ) 
 

Invokes the factory element creation routine set by registerConstructor() to return a C++ COLLADA Object Model instance of this element type.

Returns:
Returns a created daeElement of appropriate type via the object creation function and the daeElement::setup() function.

daeMetaElement * daeMetaElement::findChild daeString  elementName  ) 
 

Gets the daeMetaElement associated with a child element of a given element type.

Parameters:
elementName Name of the element to find as a child of this.
Returns:
Returns the daeMetaElement describing the potential child element, or NULL if no such child type exists in the context of this element.

daeBool daeMetaElement::getAllowsAny  )  [inline]
 

Determines if elements of this type allow for any element as a child.

Returns:
Returns true if this element can have any child element, false otherwise.

daeMetaElement * daeMetaElement::getChildMetaElement daeString  s  ) 
 

Gets the meta information for a given subelement.

Parameters:
s Name of the child element type to look up.
Returns:
Returns the meta information for a given subelement.

daeMetaElementArrayAttribute* daeMetaElement::getContents  )  [inline]
 

Gets the attribute associated with the contents meta information.

See also:
addContents()
Returns:
Returns the daeMetaElementArrayAttribute.

daeInt daeMetaElement::getElementSize  )  [inline]
 

Gets the size in bytes of each instance of this element type.

Used for factory element creation.

Returns:
Returns the number of bytes for each C++ element instance.

daeMetaAttribute* daeMetaElement::getIDAttribute  )  [inline]
 

Gets the daeMetaAttribute for the ID attribute of a daeElement.

Returns:
Returns the ID daeMetaAttribute, or NULL if the element type does not have an ID attribute.

daeBool daeMetaElement::getIsAbstract  )  [inline]
 

Determines if elements of this type can be placed in the object model.

Returns:
Returns true if this element type is abstract, false otherwise.

daeBool daeMetaElement::getIsTrackableForQueries  )  [inline]
 

Determines if elements of this type should be tracked for daeDatabase queries.

Returns:
Returns true if this element type should be tracked

daeBool daeMetaElement::getIsTransparent  )  [inline]
 

Determines if elements of this type should have an element tag printed when saving.

Returns:
Returns true if this element type should not have a tag, false otherwise.

daeMetaAttribute * daeMetaElement::getMetaAttribute daeString  s  ) 
 

Gets the attribute which has a name as provided by the s parameter.

Parameters:
s String containing the desired attribute's name.
Returns:
Returns the corresponding daeMetaAttribute, or NULL if none found.

daeMetaAttributeRefArray& daeMetaElement::getMetaAttributes  )  [inline]
 

Gets the array of all known attributes on this element type.

This includes all meta attributes except those describing child elements. It does include the value element.

Returns:
Returns the array of daeMetaAttributeRefs.

daeMetaElementAttributeArray& daeMetaElement::getMetaElementArray  )  [inline]
 

Gets the array of element attributes associated with this element type.

Returns:
Returns the array of potential child elements in the XML COLLADA hierarchy.

daeMetaElementAttributeArray& daeMetaElement::getMetaElements  )  [inline]
 

Gets the array of element attributes associated with this element type.

Returns:
Returns the array of potential child elements in the XML COLLADA hierarchy.

daeMetaElement* daeMetaElement::getMetaIntegration  )  [inline]
 

Gets the daeMetaElement for the corresponding integration object associated with this COLLADA element (if any).

Returns:
Returns the daeMetaElement for the integration object; this can be used as a factory.

daeMetaAttributePtrArray& daeMetaElement::getMetaResolvers  )  [inline]
 

Gets the array of attributes that represent URI fields that need to be "resolved" after the database is completely read in.

Returns:
Returns the array of daeMetaAttribute*'s with all of the relevant attributes.

daeStringRef daeMetaElement::getName  )  [inline]
 

Gets the name of this element type.

Returns:
Returns the name of this element type.

daeMetaElement* daeMetaElement::getParent  )  [inline]
 

Gets the container of this element type as defined by the COLLADA's XML schema.

This parent type controls where this element can be directly inlined inside of another element. Although an element can be referred to in multiple places, it is only included in one; thus a single parent.

Returns:
Returns the parent daeMetaElement.

daeMetaElementAttribute* daeMetaElement::getPossibleChildContainer daeInt  index  )  [inline]
 

Gets the containing element for the possible child specified.

Parameters:
index Index into the _otherChildrenContainer array.
Returns:
Returns the containing element for the possible child specified.

daeString daeMetaElement::getPossibleChildName daeInt  index  )  [inline]
 

Gets the name of the possible child specified.

Parameters:
index Index into the _otherChildren array.
Returns:
Returns the name of the possible child specified.

size_t daeMetaElement::getPossibleChildrenCount  )  [inline]
 

Gets the number of possible children of elements of this type that don't actually belong to this type.

Returns:
Returns the number of other possible children.

daeString daeMetaElement::getPossibleChildType daeInt  index  )  [inline]
 

Gets the type of the possible child specified.

Parameters:
index Index into the _otherChildren array.
Returns:
Returns a string of the type of the possible child specified.

daeMetaElement** daeMetaElement::getStaticPointerAddress  )  [inline]
 

Gets the address where the static pointer lives for this element type's daeMetaElement.

For instance, daeNode::_Meta will point to its corresponding daeMetaElement. If the daeMetaElement is deleted independently, this pointer is automatically set to NULL.

Returns:
Returns the address of the storage for the pointer to the daeMetaElement.

daeBool daeMetaElement::getUsesStringContents  )  [inline]
 

Gets whether elements of this type have "string" based contents; this is necessary to change the parsing mode for strings.

Returns:
Returns true if this element type has string contents, false if not.

daeMetaAttribute* daeMetaElement::getValueAttribute  )  [inline]
 

Gets the daeMetaAttribute for the non-element contents of a daeElement.

This corresponds to a daeMetaFloatAttribute, daeMetaFloatArrayAttribute, et cetera.

Returns:
Returns the daeMetaAttribute pointer for the non-element contents of this element type.

daeBool daeMetaElement::needsResolve  )  [inline]
 

Determines if this element contains attributes of type daeURI which need to be resolved after they are read or setup.

Returns:
Returns true if this element type requires resolving, false if not.

daeBool daeMetaElement::place daeElementRef  parent,
daeElementRef  child
 

Places a child element into the parent element where the calling object is the daeMetaElement for the parent element.

Parameters:
parent Element to act as the container.
child Child element to place in the parent.
Returns:
Returns true if the operation was successful, false otherwise.

void daeMetaElement::registerConstructor daeElementConstructFunctionPtr  func  )  [inline]
 

Registers the function that can construct a C++ instance of this class.

Necessary for the factory system such that C++ can still call new and the vptr will still be initialized even when constructed via the factory system.

Parameters:
func Pointer to a function that does object construction.

void daeMetaElement::setAllowsAny daeBool  allows  )  [inline]
 

Sets if elements of this type allow for any element as a child.

Parameters:
allows True if this element allows for any child element, false otherwise.

void daeMetaElement::setElementSize daeInt  size  )  [inline]
 

Sets the size in bytes of each instance of this element type.

Used for factory element creation.

Parameters:
size Number of bytes for each C++ element instance.

void daeMetaElement::setIsAbstract daeBool  abstract  )  [inline]
 

Sets if elements of this type are abstract.

Parameters:
abstract True if this type is abstract.

void daeMetaElement::setIsTrackableForQueries daeBool  trackable  )  [inline]
 

Sets whether elements of this type should be tracked for daeDatabase queries.

Parameters:
trackable Indicates whether this element should be tracked. A value of true indicates this element type should be tracked and be available for database queries.

void daeMetaElement::setIsTransparent daeBool  transparent  )  [inline]
 

Sets whether or not elements of this type should have an element tag printed when saving.

Parameters:
transparent True if this type is transparent.

void daeMetaElement::setMetaIntegration daeMetaElement mI  )  [inline]
 

Sets the daeMetaElement for the corresponding integration object associated with this COLLADA element (if any).

Parameters:
mI daeMetaElement for the integration object; this is used as a factory to automatically create this integration object whenever an instance of this element is created.

void daeMetaElement::setName daeString  s  )  [inline]
 

Sets the name of this element type.

Parameters:
s String name to set.

void daeMetaElement::setStaticPointerAddress daeMetaElement **  addr  )  [inline]
 

Sets the address where the static pointer lives for this element type's daeMetaElement.

For instance, daeNode::_Meta will point to its corresponding daeMetaElement. If the daeMetaElement is deleted independently, this pointer is automatically set to NULL.

Parameters:
addr Address of the storage for the pointer to the daeMetaElement.


The documentation for this class was generated from the following files:
  • C:/SVN_wf/COLLADA_DOM/include/dae/daeMetaElement.h
  • C:/SVN_wf/COLLADA_DOM/src/dae/daeMetaElement.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