00001 /* 00002 * Copyright 2006 Sony Computer Entertainment Inc. 00003 * 00004 * Licensed under the MIT Open Source License, for details please see license.txt or the website 00005 * http://www.opensource.org/licenses/mit-license.php 00006 * 00007 */ 00008 #ifndef __domAny_h__ 00009 #define __domAny_h__ 00010 00011 #include <dae/daeElement.h> 00012 #include <dae/daeMetaElement.h> 00013 #include <dae/daeArray.h> 00014 #include <dae/daeURI.h> 00015 #include <dae/daeIDRef.h> 00016 #include <dom/domTypes.h> 00017 00023 class domAny : public daeElement 00024 { 00025 friend class domAnyAttribute; 00026 protected: // Attribute 00030 daeTArray<daeString> attrs; 00034 daeString _value; 00038 daeElementRefArray _contents; 00042 daeUIntArray _contentsOrder; 00043 00044 public: 00049 daeElementRefArray &getContents() { return _contents; } 00054 const daeElementRefArray &getContents() const { return _contents; } 00055 00060 daeUInt getAttributeCount() const { return (daeUInt)_meta->getMetaAttributes().getCount(); } 00066 daeString getAttributeName( daeUInt index ) const { return _meta->getMetaAttributes()[index]->getName(); } 00072 daeString getAttributeValue( daeUInt index ) const { return attrs[ index ]; } 00077 daeString getValue() const { return _value; } 00082 void setValue( daeString val ) { *(daeStringRef*)&_value = val; } 00083 00088 virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::ANY; } 00089 00090 static daeInt ID() { return colladaTypeCount()-1; } 00091 virtual daeInt typeID() const { return colladaTypeCount()-1; } 00092 00093 protected: 00097 domAny() : _value() {} 00101 virtual ~domAny(); 00105 domAny( const domAny &cpy ) : daeElement() { (void)cpy; } 00109 virtual domAny &operator=( const domAny &cpy ) { (void)cpy; return *this; } 00110 00111 public: //METHODS 00119 virtual DLLSPEC daeBool setAttribute(daeString attrName, daeString attrValue); 00120 00121 public: // STATIC METHODS 00126 static DLLSPEC daeElementRef create(DAE& dae); 00133 static DLLSPEC daeMetaElement* registerElement(DAE& dae); 00134 00135 }; 00136 00137 typedef daeSmartRef<domAny> domAnyRef; 00138 typedef daeTArray<domAnyRef> domAny_Array; 00139 00140 #endif 00141