/usr/include/collada-dom2.4/dae/daeMetaElementAttribute.h is in libcollada-dom2.4-dp-dev 2.4.4+ds1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | /*
* Copyright 2006 Sony Computer Entertainment Inc.
*
* Licensed under the MIT Open Source License, for details please see license.txt or the website
* http://www.opensource.org/licenses/mit-license.php
*
*/
#ifndef __DAE_META_ELEMENT_ATTRIBUTE_H__
#define __DAE_META_ELEMENT_ATTRIBUTE_H__
#include <dae/daeTypes.h>
#include <dae/daeMetaAttribute.h>
#include <dae/daeMetaCMPolicy.h>
class daeMetaElement;
class daeElement;
class daeDocument;
/**
* The @c daeMetaElementAttribute class represents a content model object that is an element.
*/
class daeMetaElementAttribute : public daeMetaAttribute, public daeMetaCMPolicy
{
public:
/** The metaElement that describes the element type of this attribute */
daeMetaElement* _elementType;
public:
/**
* Constructor.
* @param container The daeMetaElement that this policy object belongs to.
* @param parent The daeMetaCMPolicy parent of this policy object.
* @param odinal The ordinal value offset of this specific policy object. Used for maintaining the
* correct order of child elements.
* @param minO The minimum number of times this CMPolicy object must appear. This value comes from the COLLADA schema.
* @param maxO The maximum number of times this CMPolicy object may appear. This value comes from the COLLADA schema.
*/
daeMetaElementAttribute( daeMetaElement *container, daeMetaCMPolicy *parent = NULL, daeUInt ordinal = 0, daeInt minO = 1, daeInt maxO = 1);
/**
* Destructor
*/
virtual ~daeMetaElementAttribute();
public:
virtual daeElement *placeElement(daeElement* parent, daeElement* child, daeUInt &ordinal, daeInt offset = 0, daeElement* before = NULL, daeElement *after = NULL);
virtual daeBool removeElement(daeElement* parent, daeElement* child);
daeMetaElement *findChild( daeString elementName );
virtual void getChildren( daeElement* parent, daeElementRefArray &array );
public:
/**
* Sets the element type for the element that this attribute points to.
* @param elementType @c daeMetaElement representing the type.
*/
void setElementType(daeMetaElement *elementType) {
_elementType = elementType; }
/**
* Gets the element type for the element that this attribute points to.
* @return Returns the @c daeMetaElement representing the type.
*/
daeMetaElement* getElementType() { return _elementType; }
/**
* Sets the database document associated with this element.
* @param parent The daeElement to set the document.
* @param c The @c daeDocument to associate with this element.
*/
virtual void setDocument(daeElement *parent, daeDocument* c );
inline void setCollection(daeElement *parent, daeDocument* c ) {
setDocument( parent, c );
}
/**
* Gets the number of elements associated with this attribute in instance <tt><i>e.</i></tt>
* @param e Containing element to run the operation on.
* @return Returns the number of elements associated with this attribute
* in instance <tt><i>e.</i></tt>
*/
virtual daeInt getCount(daeElement* e);
/**
* Gets an element from containing element <tt><i>e</i></tt> based on <tt><i>index.</i></tt>
* @param e Containing element from which to get the element.
* @param index Index of the element to retrieve if indeed
* there is an array of elements rather than a singleton.
* @return Returns the associated element out of parent element e, based on index, if necessary.
*/
virtual daeMemoryRef get(daeElement* e, daeInt index);
/**
* Defines the override version of base method.
* @param element Element on which to set this attribute.
* @param s String containing the value to be converted via the
* atomic type system.
*/
virtual void set(daeElement* element, daeString s);
/**
* Defines the override version of base method.
* @param toElement Pointer to a @c daeElement to copy this attribute to.
* @param fromElement Pointer to a @c daeElement to copy this attribute from.
*/
virtual void copy(daeElement* toElement, daeElement* fromElement);
/**
* Gets if this attribute is an array attribute.
* @return Returns true if this attribute is an array type.
*/
virtual daeBool isArrayAttribute() { return false; }
};
typedef daeSmartRef<daeMetaElementAttribute> daeMetaElementAttributeRef;
typedef daeTArray<daeMetaElementAttributeRef> daeMetaElementAttributeArray;
/**
* The @c daeMetaElementArrayAttribute class is similar to daeMetaElementAttribute
* except that this meta attribute describes an array of elements rather than a singleton.
*/
class daeMetaElementArrayAttribute : public daeMetaElementAttribute
{
public:
/**
* Constructor.
* @param container The daeMetaElement that this policy object belongs to.
* @param parent The daeMetaCMPolicy parent of this policy object.
* @param odinal The ordinal value offset of this specific policy object. Used for maintaining the
* correct order of child elements.
* @param minO The minimum number of times this CMPolicy object must appear. This value comes from the COLLADA schema.
* @param maxO The maximum number of times this CMPolicy object may appear. This value comes from the COLLADA schema.
*/
daeMetaElementArrayAttribute(daeMetaElement *container, daeMetaCMPolicy *parent = NULL, daeUInt ordinal = 0, daeInt minO = 1, daeInt maxO = 1);
~daeMetaElementArrayAttribute();
public:
virtual daeElement *placeElement(daeElement* parent, daeElement* child, daeUInt &ordinal, daeInt offset = 0, daeElement* before = NULL, daeElement *after = NULL);
virtual daeBool removeElement(daeElement* parent, daeElement* child);
void getChildren( daeElement* parent, daeElementRefArray &array );
/**
* Sets the database document associated with this element.
* @param c The @c daeDocument to associate with this element.
*/
virtual void setDocument(daeElement *parent, daeDocument* c );
inline void setCollection(daeElement *parent, daeDocument* c ) {
setDocument( parent, c );
}
/**
* Defines the override version of this method from @c daeMetaElement.
* @param e Containing element to run the operation on.
* @return Returns the number of particles associated with this attribute
* in instance <tt><i>e.</i></tt>
*/
virtual daeInt getCount(daeElement* e);
/**
* Defines the override version of this method from @c daeMetaElement.
* @param e Containing element from which to get the element.
* @param index Index of the particle to retrieve if indeed
* there is an array of elements rather than a singleton.
* @return Returns the associated particle out of parent element e, based on index, if necessary.
*/
virtual daeMemoryRef get(daeElement* e, daeInt index);
/**
* Defines the override version of this method from @c daeMetaElement.
* @param toElement Pointer to a @c daeElement to copy this attribute to.
* @param fromElement Pointer to a @c daeElement to copy this attribute from.
*/
virtual void copy(daeElement* toElement, daeElement* fromElement);
/**
* Gets if this attribute is an array attribute.
* @return Returns true if this attribute is an array type.
*/
virtual daeBool isArrayAttribute() { return true; }
};
typedef daeSmartRef<daeMetaElementArrayAttribute> daeMetaElementArrayAttributeRef;
typedef daeTArray<daeMetaElementArrayAttributeRef> daeMetaElementArrayAttributeArray;
#endif
|