domIDREF_array.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 __domIDREF_array_h__
  14. #define __domIDREF_array_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. class DAE;
  19. /**
  20. * The IDREF_array element declares the storage for a homogenous array of
  21. * ID reference values.
  22. */
  23. class domIDREF_array : public daeElement
  24. {
  25. public:
  26. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::IDREF_ARRAY; }
  27. static daeInt ID() { return 604; }
  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. protected: // Value
  46. /**
  47. * The xsIDREFS value of the text data of this element.
  48. */
  49. xsIDREFS _value;
  50. public: //Accessors and Mutators
  51. /**
  52. * Gets the id attribute.
  53. * @return Returns a xsID of the id attribute.
  54. */
  55. xsID getId() const { return attrId; }
  56. /**
  57. * Sets the id attribute.
  58. * @param atId The new value for the id attribute.
  59. */
  60. void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true;
  61. if( _document != NULL ) _document->changeElementID( this, attrId );
  62. }
  63. /**
  64. * Gets the name attribute.
  65. * @return Returns a xsNCName of the name attribute.
  66. */
  67. xsNCName getName() const { return attrName; }
  68. /**
  69. * Sets the name attribute.
  70. * @param atName The new value for the name attribute.
  71. */
  72. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; }
  73. /**
  74. * Gets the count attribute.
  75. * @return Returns a domUint of the count attribute.
  76. */
  77. domUint getCount() const { return attrCount; }
  78. /**
  79. * Sets the count attribute.
  80. * @param atCount The new value for the count attribute.
  81. */
  82. void setCount( domUint atCount ) { attrCount = atCount; _validAttributeArray[2] = true; }
  83. /**
  84. * Gets the _value array.
  85. * @return Returns a xsIDREFS reference of the _value array.
  86. */
  87. xsIDREFS &getValue() { return _value; }
  88. /**
  89. * Gets the _value array.
  90. * @return Returns a constant xsIDREFS reference of the _value array.
  91. */
  92. const xsIDREFS &getValue() const { return _value; }
  93. /**
  94. * Sets the _value array.
  95. * @param val The new value for the _value array.
  96. */
  97. void setValue( const xsIDREFS &val ) { _value = val; }
  98. protected:
  99. /**
  100. * Constructor
  101. */
  102. domIDREF_array(DAE& dae) : daeElement(dae), attrId(), attrName(), attrCount(), _value(new xsIDREF(*this)) {}
  103. /**
  104. * Destructor
  105. */
  106. virtual ~domIDREF_array() {}
  107. /**
  108. * Overloaded assignment operator
  109. */
  110. virtual domIDREF_array &operator=( const domIDREF_array &cpy ) { (void)cpy; return *this; }
  111. public: // STATIC METHODS
  112. /**
  113. * Creates an instance of this class and returns a daeElementRef referencing it.
  114. * @return a daeElementRef referencing an instance of this object.
  115. */
  116. static DLLSPEC daeElementRef create(DAE& dae);
  117. /**
  118. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  119. * If a daeMetaElement already exists it will return that instead of creating a new one.
  120. * @return A daeMetaElement describing this COLLADA element.
  121. */
  122. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  123. };
  124. #endif