X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fhla%2FHLAArrayDataElement.hxx;h=72f1478b878476d99ae371868cc1e0819a7b197c;hb=1f585d67199896749f5f532657d17afe586f6615;hp=c236c4e442cf3a340330a126768d92ac8855cc69;hpb=110753e92c4d512432b93d8789348a54341dec98;p=simgear.git diff --git a/simgear/hla/HLAArrayDataElement.hxx b/simgear/hla/HLAArrayDataElement.hxx index c236c4e4..72f1478b 100644 --- a/simgear/hla/HLAArrayDataElement.hxx +++ b/simgear/hla/HLAArrayDataElement.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2009 - 2010 Mathias Froehlich - Mathias.Froehlich@web.de +// Copyright (C) 2009 - 2012 Mathias Froehlich - Mathias.Froehlich@web.de // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public @@ -23,7 +23,7 @@ #include #include "HLAArrayDataType.hxx" #include "HLADataElement.hxx" -#include "HLAVariantDataElement.hxx" +#include "HLAVariantRecordDataElement.hxx" #include "HLADataTypeVisitor.hxx" namespace simgear { @@ -78,6 +78,9 @@ public: void setDataElementFactory(DataElementFactory* dataElementFactory); DataElementFactory* getDataElementFactory(); +protected: + virtual void _setStamp(Stamp* stamp); + private: HLADataElement* newElement(unsigned index); @@ -102,20 +105,23 @@ public: virtual unsigned getNumElements() const; virtual bool encodeElement(HLAEncodeStream& stream, unsigned i) const; - const HLAVariantDataElement* getElement(unsigned index) const; - HLAVariantDataElement* getElement(unsigned index); - HLAVariantDataElement* getOrCreateElement(unsigned index); - void setElement(unsigned index, HLAVariantDataElement* value); + const HLAVariantRecordDataElement* getElement(unsigned index) const; + HLAVariantRecordDataElement* getElement(unsigned index); + HLAVariantRecordDataElement* getOrCreateElement(unsigned index); + void setElement(unsigned index, HLAVariantRecordDataElement* value); - typedef HLAVariantDataElement::DataElementFactory AlternativeDataElementFactory; + typedef HLAVariantRecordDataElement::DataElementFactory AlternativeDataElementFactory; void setAlternativeDataElementFactory(AlternativeDataElementFactory* alternativeDataElementFactory); AlternativeDataElementFactory* getAlternativeDataElementFactory(); +protected: + virtual void _setStamp(Stamp* stamp); + private: - HLAVariantDataElement* newElement(); + HLAVariantRecordDataElement* newElement(); - typedef std::vector > ElementVector; + typedef std::vector > ElementVector; ElementVector _elementVector; SGSharedPtr _alternativeDataElementFactory; @@ -133,7 +139,7 @@ public: const std::string& getValue() const { return _value; } void setValue(const std::string& value) - { _value = value; } + { _value = value; setDirty(true); } virtual bool setNumElements(unsigned count) { @@ -210,11 +216,11 @@ public: const SGVec2& getValue() const { return _value; } void setValue(const SGVec2& value) - { _value = value; } + { _value = value; setDirty(true); } virtual bool setNumElements(unsigned count) { - for (unsigned i = 2; i < count; ++i) + for (unsigned i = count; i < 2; ++i) _value[i] = 0; return true; } @@ -302,11 +308,11 @@ public: const SGVec3& getValue() const { return _value; } void setValue(const SGVec3& value) - { _value = value; } + { _value = value; setDirty(true); } virtual bool setNumElements(unsigned count) { - for (unsigned i = 3; i < count; ++i) + for (unsigned i = count; i < 3; ++i) _value[i] = 0; return true; } @@ -394,11 +400,11 @@ public: const SGVec4& getValue() const { return _value; } void setValue(const SGVec4& value) - { _value = value; } + { _value = value; setDirty(true); } virtual bool setNumElements(unsigned count) { - for (unsigned i = 4; i < count; ++i) + for (unsigned i = count; i < 4; ++i) _value[i] = 0; return true; } @@ -486,11 +492,11 @@ public: const SGQuat& getValue() const { return _value; } void setValue(const SGQuat& value) - { _value = value; } + { _value = value; setDirty(true); } virtual bool setNumElements(unsigned count) { - for (unsigned i = 4; i < count; ++i) + for (unsigned i = count; i < 4; ++i) _value[i] = 0; return true; }