#include <daeMetaElement.h>
Each instance of the daeMetaElement
class describes a C++ COLLADA dom element type.
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. daeElement
for information about the functionality that every daeElement
implements. Definition at line 42 of file daeMetaElement.h.
DLLSPEC daeMetaElement::daeMetaElement | ( | DAE & | dae | ) |
Constructor
DLLSPEC daeMetaElement::~daeMetaElement | ( | ) |
Destructor
Registers with the reflective object system that the dom class described by this daeMetaElement
contains at least one choice group in the content model for this element. This method is only for daeMetaElement
contstuction, and should only be called by the system as it sets up the Reflective Object System.
offset | Byte offset for the contents field in the C++ element class. | |
numChoices | The number of choice content model blocks there are for this element type. |
DLLSPEC void daeMetaElement::addContents | ( | daeInt | offset | ) |
Registers 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.
offset | Byte offset for the contents field in the C++ element class. |
DLLSPEC void daeMetaElement::addContentsOrder | ( | daeInt | offset | ) |
Registers with the reflective object system the array that stores the _contents ordering. This method is only for daeMetaElement
contstuction, and should only be called by the system as it sets up the Reflective Object System.
offset | Byte offset for the contents order array in the C++ element class. |
DLLSPEC 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.
attr | Attribute to append to this element types list of potential attributes. |
DLLSPEC 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)
childElementTypeName | Type name to create. |
DLLSPEC daeElementRef daeMetaElement::create | ( | ) |
Invokes the factory element creation routine set by registerConstructor()
to return a C++ COLLADA Object Model instance of this element type.
daeElement
of appropriate type via the object creation function and the daeElement::setup()
function. daeBool daeMetaElement::getAllowsAny | ( | ) | [inline] |
Determines if elements of this type allow for any element as a child.
Definition at line 142 of file daeMetaElement.h.
DLLSPEC void daeMetaElement::getChildren | ( | daeElement * | parent, | |
daeElementRefArray & | array | |||
) |
Gets all of the children from an element of this type.
parent | The element that you want to get the children from. | |
array | The return value. An elementref array to append this element's children to. |
daeMetaCMPolicy* daeMetaElement::getCMRoot | ( | ) | [inline] |
Gets the root of the content model policy tree.
Definition at line 347 of file daeMetaElement.h.
daeMetaElementArrayAttribute* daeMetaElement::getContents | ( | ) | [inline] |
Gets the attribute associated with the contents meta information.
addContents()
daeMetaElementArrayAttribute
. Definition at line 237 of file daeMetaElement.h.
DAE* daeMetaElement::getDAE | ( | ) |
Gets the DAE object that owns this daeMetaElement.
daeInt daeMetaElement::getElementSize | ( | ) | [inline] |
Gets the size in bytes of each instance of this element type. Used for factory element creation.
Definition at line 205 of file daeMetaElement.h.
daeMetaAttribute* daeMetaElement::getIDAttribute | ( | ) | [inline] |
Gets the daeMetaAttribute
for the ID attribute of a daeElement
.
daeMetaAttribute
, or NULL if the element type does not have an ID attribute. Definition at line 163 of file daeMetaElement.h.
daeBool daeMetaElement::getIsAbstract | ( | ) | [inline] |
Determines if elements of this type can be placed in the object model.
Definition at line 104 of file daeMetaElement.h.
daeBool daeMetaElement::getIsInnerClass | ( | ) | [inline] |
Determines if elements of this type is an inner class.
Definition at line 94 of file daeMetaElement.h.
daeBool daeMetaElement::getIsTrackableForQueries | ( | ) | [inline] |
Determines if elements of this type should be tracked for daeDatabase queries.
Definition at line 126 of file daeMetaElement.h.
daeBool daeMetaElement::getIsTransparent | ( | ) | [inline] |
Determines if elements of this type should have an element tag printed when saving.
Definition at line 109 of file daeMetaElement.h.
DLLSPEC daeMetaAttribute* daeMetaElement::getMetaAttribute | ( | daeString | s | ) |
Gets the attribute which has a name as provided by the s
parameter.
s | String containing the desired attribute's name. |
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.
daeMetaAttributeRefs
. Definition at line 183 of file daeMetaElement.h.
daeMetaArrayAttribute* daeMetaElement::getMetaCMData | ( | ) | [inline] |
Gets the attribute associated with the CMData array meta information.
addCMDataArray()
daeMetaArrayAttribute
for the CMData of an element. Definition at line 243 of file daeMetaElement.h.
daeStringRef daeMetaElement::getName | ( | ) | [inline] |
Gets the name of this element type.
Definition at line 169 of file daeMetaElement.h.
daeUInt daeMetaElement::getNumChoices | ( | ) | const [inline] |
Gets the number of choice content model blocks there are for this element type.
Definition at line 248 of file daeMetaElement.h.
daeMetaAttribute* daeMetaElement::getValueAttribute | ( | ) | [inline] |
Gets the daeMetaAttribute
for the non-element contents of a daeElement
. This corresponds to a daeMetaFloatAttribute
, daeMetaFloatArrayAttribute
, et cetera.
daeMetaAttribute
pointer for the non-element contents of this element type. Definition at line 156 of file daeMetaElement.h.
DLLSPEC daeBool daeMetaElement::place | ( | daeElement * | parent, | |
daeElement * | child, | |||
daeUInt * | ordinal = NULL | |||
) |
Places a child element into the parent
element where the calling object is the daeMetaElement
for the parent element.
parent | Element to act as the container. | |
child | Child element to place in the parent. |
DLLSPEC daeBool daeMetaElement::placeAfter | ( | daeElement * | marker, | |
daeElement * | parent, | |||
daeElement * | child, | |||
daeUInt * | ordinal = NULL | |||
) |
Places a child element into the parent
element at a specific location which is right after the marker element.
marker | The element location in the contents array to insert after. | |
parent | Element to act as the container. | |
child | Child element to place in the parent. |
DLLSPEC daeBool daeMetaElement::placeAt | ( | daeInt | index, | |
daeElement * | parent, | |||
daeElement * | child | |||
) |
Places a child element into the parent
element at a specific location where the calling object is the daeMetaElement
for the parent element.
index | The location in the contents array to insert. | |
parent | Element to act as the container. | |
child | Child element to place in the parent. |
DLLSPEC daeBool daeMetaElement::placeBefore | ( | daeElement * | marker, | |
daeElement * | parent, | |||
daeElement * | child, | |||
daeUInt * | ordinal = NULL | |||
) |
Places a child element into the parent
element at a specific location which is right before the marker element.
marker | The element location in the contents array to insert before. | |
parent | Element to act as the container. | |
child | Child element to place in the parent. |
void daeMetaElement::registerClass | ( | 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.
func | Pointer to a function that does object construction. |
Definition at line 264 of file daeMetaElement.h.
DLLSPEC daeBool daeMetaElement::remove | ( | daeElement * | parent, | |
daeElement * | child | |||
) |
Removes a child element from its parent element.
parent | Element That is the parent. | |
child | Child element to remove. |
void daeMetaElement::setAllowsAny | ( | daeBool | allows | ) | [inline] |
Sets if elements of this type allow for any element as a child.
allows | True if this element allows for any child element, false otherwise. |
Definition at line 147 of file daeMetaElement.h.
DLLSPEC void daeMetaElement::setCMRoot | ( | daeMetaCMPolicy * | cm | ) |
Sets the root of the content model policy tree.
cm | The root element of the tree of content model policy elements. |
void daeMetaElement::setElementSize | ( | daeInt | size | ) | [inline] |
Sets the size in bytes of each instance of this element type. Used for factory element creation.
size | Number of bytes for each C++ element instance. |
Definition at line 198 of file daeMetaElement.h.
void daeMetaElement::setIsAbstract | ( | daeBool | abstract | ) | [inline] |
Sets if elements of this type are abstract.
abstract | True if this type is abstract. |
Definition at line 114 of file daeMetaElement.h.
void daeMetaElement::setIsInnerClass | ( | daeBool | ic | ) | [inline] |
Sets if elements of this type are inner classes.
abstract | True if this type is an inner class. |
Definition at line 99 of file daeMetaElement.h.
void daeMetaElement::setIsTrackableForQueries | ( | daeBool | trackable | ) | [inline] |
Sets whether elements of this type should be tracked for daeDatabase
queries.
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. |
Definition at line 135 of file daeMetaElement.h.
void daeMetaElement::setIsTransparent | ( | daeBool | transparent | ) | [inline] |
Sets whether or not elements of this type should have an element tag printed when saving.
transparent | True if this type is transparent. |
Definition at line 119 of file daeMetaElement.h.
void daeMetaElement::setName | ( | daeString | s | ) | [inline] |
Sets the name of this element type.
s | String name to set. |
Definition at line 175 of file daeMetaElement.h.
DLLSPEC void daeMetaElement::validate | ( | ) |
Validates this class to be used by the runtime c++ object model including factory creation.
daeBool daeMetaElement::_allowsAny [protected] |
Definition at line 62 of file daeMetaElement.h.
daeMetaCMPolicy* daeMetaElement::_contentModel [protected] |
Definition at line 65 of file daeMetaElement.h.
Definition at line 47 of file daeMetaElement.h.
daeInt daeMetaElement::_elementSize [protected] |
Definition at line 48 of file daeMetaElement.h.
daeBool daeMetaElement::_innerClass [protected] |
Definition at line 63 of file daeMetaElement.h.
daeBool daeMetaElement::_isAbstract [protected] |
Definition at line 61 of file daeMetaElement.h.
daeBool daeMetaElement::_isTrackableForQueries [protected] |
Definition at line 57 of file daeMetaElement.h.
daeBool daeMetaElement::_isTransparent [protected] |
Definition at line 60 of file daeMetaElement.h.
Definition at line 50 of file daeMetaElement.h.
daeMetaArrayAttribute* daeMetaElement::_metaCMData [protected] |
Definition at line 66 of file daeMetaElement.h.
Definition at line 52 of file daeMetaElement.h.
daeMetaArrayAttribute* daeMetaElement::_metaContentsOrder [protected] |
Definition at line 53 of file daeMetaElement.h.
daeMetaAttributeRef daeMetaElement::_metaID [protected] |
Definition at line 55 of file daeMetaElement.h.
daeMetaAttributeRef daeMetaElement::_metaValue [protected] |
Definition at line 51 of file daeMetaElement.h.
daeStringRef daeMetaElement::_name [protected] |
Definition at line 45 of file daeMetaElement.h.
daeUInt daeMetaElement::_numMetaChoices [protected] |
Definition at line 67 of file daeMetaElement.h.
daeBool daeMetaElement::_usesStringContents [protected] |
Definition at line 58 of file daeMetaElement.h.
DAE& daeMetaElement::dae [protected] |
Definition at line 69 of file daeMetaElement.h.