domInt_array.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * Copyright 2006 Sony Computer Entertainment Inc.
  3. *
  4. * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this
  5. * file except in compliance with the License. You may obtain a copy of the License at:
  6. * http://research.scea.com/scea_shared_source_license.html
  7. *
  8. * Unless required by applicable law or agreed to in writing, software distributed under the License
  9. * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  10. * implied. See the License for the specific language governing permissions and limitations under the
  11. * License.
  12. */
  13. #ifndef __domInt_array_h__
  14. #define __domInt_array_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. class DAE;
  19. /**
  20. * The int_array element declares the storage for a homogenous array of integer
  21. * values.
  22. */
  23. class domInt_array : public daeElement
  24. {
  25. public:
  26. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::INT_ARRAY; }
  27. static daeInt ID() { return 608; }
  28. virtual daeInt typeID() const { return ID(); }
  29. protected: // Attributes
  30. /**
  31. * The id attribute is a text string containing the unique identifier of
  32. * this element. This value must be unique within the instance document.
  33. * Optional attribute.
  34. */
  35. xsID attrId;
  36. /**
  37. * The name attribute is the text string name of this element. Optional attribute.
  38. */
  39. xsNCName attrName;
  40. /**
  41. * The count attribute indicates the number of values in the array. Required
  42. * attribute.
  43. */
  44. domUint attrCount;
  45. /**
  46. * The minInclusive attribute indicates the smallest integer value that can
  47. * be contained in the array. The default value is –2147483648. Optional
  48. * attribute.
  49. */
  50. xsInteger attrMinInclusive;
  51. /**
  52. * The maxInclusive attribute indicates the largest integer value that can
  53. * be contained in the array. The default value is 2147483647. Optional attribute.
  54. */
  55. xsInteger attrMaxInclusive;
  56. protected: // Value
  57. /**
  58. * The domListOfInts value of the text data of this element.
  59. */
  60. domListOfInts _value;
  61. public: //Accessors and Mutators
  62. /**
  63. * Gets the id attribute.
  64. * @return Returns a xsID of the id attribute.
  65. */
  66. xsID getId() const { return attrId; }
  67. /**
  68. * Sets the id attribute.
  69. * @param atId The new value for the id attribute.
  70. */
  71. void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true;
  72. if( _document != NULL ) _document->changeElementID( this, attrId );
  73. }
  74. /**
  75. * Gets the name attribute.
  76. * @return Returns a xsNCName of the name attribute.
  77. */
  78. xsNCName getName() const { return attrName; }
  79. /**
  80. * Sets the name attribute.
  81. * @param atName The new value for the name attribute.
  82. */
  83. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; }
  84. /**
  85. * Gets the count attribute.
  86. * @return Returns a domUint of the count attribute.
  87. */
  88. domUint getCount() const { return attrCount; }
  89. /**
  90. * Sets the count attribute.
  91. * @param atCount The new value for the count attribute.
  92. */
  93. void setCount( domUint atCount ) { attrCount = atCount; _validAttributeArray[2] = true; }
  94. /**
  95. * Gets the minInclusive attribute.
  96. * @return Returns a xsInteger of the minInclusive attribute.
  97. */
  98. xsInteger getMinInclusive() const { return attrMinInclusive; }
  99. /**
  100. * Sets the minInclusive attribute.
  101. * @param atMinInclusive The new value for the minInclusive attribute.
  102. */
  103. void setMinInclusive( xsInteger atMinInclusive ) { attrMinInclusive = atMinInclusive; _validAttributeArray[3] = true; }
  104. /**
  105. * Gets the maxInclusive attribute.
  106. * @return Returns a xsInteger of the maxInclusive attribute.
  107. */
  108. xsInteger getMaxInclusive() const { return attrMaxInclusive; }
  109. /**
  110. * Sets the maxInclusive attribute.
  111. * @param atMaxInclusive The new value for the maxInclusive attribute.
  112. */
  113. void setMaxInclusive( xsInteger atMaxInclusive ) { attrMaxInclusive = atMaxInclusive; _validAttributeArray[4] = true; }
  114. /**
  115. * Gets the _value array.
  116. * @return Returns a domListOfInts reference of the _value array.
  117. */
  118. domListOfInts &getValue() { return _value; }
  119. /**
  120. * Gets the _value array.
  121. * @return Returns a constant domListOfInts reference of the _value array.
  122. */
  123. const domListOfInts &getValue() const { return _value; }
  124. /**
  125. * Sets the _value array.
  126. * @param val The new value for the _value array.
  127. */
  128. void setValue( const domListOfInts &val ) { _value = val; }
  129. protected:
  130. /**
  131. * Constructor
  132. */
  133. domInt_array(DAE& dae) : daeElement(dae), attrId(), attrName(), attrCount(), attrMinInclusive(), attrMaxInclusive(), _value() {}
  134. /**
  135. * Destructor
  136. */
  137. virtual ~domInt_array() {}
  138. /**
  139. * Overloaded assignment operator
  140. */
  141. virtual domInt_array &operator=( const domInt_array &cpy ) { (void)cpy; return *this; }
  142. public: // STATIC METHODS
  143. /**
  144. * Creates an instance of this class and returns a daeElementRef referencing it.
  145. * @return a daeElementRef referencing an instance of this object.
  146. */
  147. static DLLSPEC daeElementRef create(DAE& dae);
  148. /**
  149. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  150. * If a daeMetaElement already exists it will return that instead of creating a new one.
  151. * @return A daeMetaElement describing this COLLADA element.
  152. */
  153. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  154. };
  155. #endif