1 /* 2 * Copyright 2006 Sony Computer Entertainment Inc. 3 * 4 * Licensed under the MIT Open Source License, for details please see license.txt or the website 5 * http://www.opensource.org/licenses/mit-license.php 6 * 7 */ 8 9 #ifndef __domIDREF_array_h__ 10 #define __domIDREF_array_h__ 11 12 #include <dae/daeDocument.h> 13 #include <dom/domTypes.h> 14 #include <dom/domElements.h> 15 16 class DAE; 17 18 /** 19 * The IDREF_array element declares the storage for a homogenous array of 20 * ID reference values. 21 */ 22 class domIDREF_array : public daeElement 23 { 24 public: 25 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::IDREF_ARRAY; } 26 static daeInt ID() { return 604; } 27 virtual daeInt typeID() const { return ID(); } 28 protected: // Attributes 29 /** 30 * The id attribute is a text string containing the unique identifier of 31 * this element. This value must be unique within the instance document. 32 * Optional attribute. 33 */ 34 xsID attrId; 35 /** 36 * The name attribute is the text string name of this element. Optional attribute. 37 */ 38 xsNCName attrName; 39 /** 40 * The count attribute indicates the number of values in the array. Required 41 * attribute. 42 */ 43 domUint attrCount; 44 45 protected: // Value 46 /** 47 * The xsIDREFS value of the text data of this element. 48 */ 49 xsIDREFS _value; 50 51 public: //Accessors and Mutators 52 /** 53 * Gets the id attribute. 54 * @return Returns a xsID of the id attribute. 55 */ 56 xsID getId() const { return attrId; } 57 /** 58 * Sets the id attribute. 59 * @param atId The new value for the id attribute. 60 */ 61 void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true; 62 if( _document != NULL ) _document->changeElementID( this, attrId ); 63 } 64 65 /** 66 * Gets the name attribute. 67 * @return Returns a xsNCName of the name attribute. 68 */ 69 xsNCName getName() const { return attrName; } 70 /** 71 * Sets the name attribute. 72 * @param atName The new value for the name attribute. 73 */ 74 void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; } 75 76 /** 77 * Gets the count attribute. 78 * @return Returns a domUint of the count attribute. 79 */ 80 domUint getCount() const { return attrCount; } 81 /** 82 * Sets the count attribute. 83 * @param atCount The new value for the count attribute. 84 */ 85 void setCount( domUint atCount ) { attrCount = atCount; _validAttributeArray[2] = true; } 86 87 /** 88 * Gets the _value array. 89 * @return Returns a xsIDREFS reference of the _value array. 90 */ 91 xsIDREFS &getValue() { return _value; } 92 /** 93 * Gets the _value array. 94 * @return Returns a constant xsIDREFS reference of the _value array. 95 */ 96 const xsIDREFS &getValue() const { return _value; } 97 /** 98 * Sets the _value array. 99 * @param val The new value for the _value array. 100 */ 101 void setValue( const xsIDREFS &val ) { _value = val; } 102 103 protected: 104 /** 105 * Constructor 106 */ 107 domIDREF_array(DAE& dae) : daeElement(dae), attrId(), attrName(), attrCount(), _value(new xsIDREF(*this)) {} 108 /** 109 * Destructor 110 */ 111 virtual ~domIDREF_array() {} 112 /** 113 * Overloaded assignment operator 114 */ 115 virtual domIDREF_array &operator=( const domIDREF_array &cpy ) { (void)cpy; return *this; } 116 117 public: // STATIC METHODS 118 /** 119 * Creates an instance of this class and returns a daeElementRef referencing it. 120 * @return a daeElementRef referencing an instance of this object. 121 */ 122 static DLLSPEC daeElementRef create(DAE& dae); 123 /** 124 * Creates a daeMetaElement object that describes this element in the meta object reflection framework. 125 * If a daeMetaElement already exists it will return that instead of creating a new one. 126 * @return A daeMetaElement describing this COLLADA element. 127 */ 128 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 129 }; 130 131 132 #endif 133