X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fhla%2FHLAObjectInstance.cxx;h=ae726ee4da83e52965a84b5d820162ba6302958a;hb=264e336a4941a719362c75b3415a92e9098b2719;hp=0324d328b54a3584b6f811984e175007867f32af;hpb=44ff23b227dcc1f3efbd10a4df4d8b723165c11c;p=simgear.git diff --git a/simgear/hla/HLAObjectInstance.cxx b/simgear/hla/HLAObjectInstance.cxx index 0324d328..ae726ee4 100644 --- a/simgear/hla/HLAObjectInstance.cxx +++ b/simgear/hla/HLAObjectInstance.cxx @@ -123,7 +123,7 @@ HLAObjectInstance::getAttributeDataElement(unsigned index) const return _rtiObjectInstance->getDataElement(index); } -class HLAObjectInstance::DataElementFactoryVisitor : public HLADataTypeVisitor { +class HLAObjectInstance::DataElementFactoryVisitor : public HLADataElementFactoryVisitor { public: DataElementFactoryVisitor(const HLAPathElementMap& pathElementMap) : _pathElementMap(pathElementMap) @@ -150,7 +150,7 @@ public: if (_dataElement.valid()) return; - _dataElement = new HLASCharDataElement(&dataType); + HLADataElementFactoryVisitor::apply(dataType); } virtual void apply(const HLAUInt8DataType& dataType) { @@ -158,7 +158,7 @@ public: if (_dataElement.valid()) return; - _dataElement = new HLAUCharDataElement(&dataType); + HLADataElementFactoryVisitor::apply(dataType); } virtual void apply(const HLAInt16DataType& dataType) { @@ -166,7 +166,7 @@ public: if (_dataElement.valid()) return; - _dataElement = new HLAShortDataElement(&dataType); + HLADataElementFactoryVisitor::apply(dataType); } virtual void apply(const HLAUInt16DataType& dataType) { @@ -174,7 +174,7 @@ public: if (_dataElement.valid()) return; - _dataElement = new HLAUShortDataElement(&dataType); + HLADataElementFactoryVisitor::apply(dataType); } virtual void apply(const HLAInt32DataType& dataType) { @@ -182,7 +182,7 @@ public: if (_dataElement.valid()) return; - _dataElement = new HLAIntDataElement(&dataType); + HLADataElementFactoryVisitor::apply(dataType); } virtual void apply(const HLAUInt32DataType& dataType) { @@ -190,7 +190,7 @@ public: if (_dataElement.valid()) return; - _dataElement = new HLAUIntDataElement(&dataType); + HLADataElementFactoryVisitor::apply(dataType); } virtual void apply(const HLAInt64DataType& dataType) { @@ -198,7 +198,7 @@ public: if (_dataElement.valid()) return; - _dataElement = new HLALongDataElement(&dataType); + HLADataElementFactoryVisitor::apply(dataType); } virtual void apply(const HLAUInt64DataType& dataType) { @@ -206,7 +206,7 @@ public: if (_dataElement.valid()) return; - _dataElement = new HLAULongDataElement(&dataType); + HLADataElementFactoryVisitor::apply(dataType); } virtual void apply(const HLAFloat32DataType& dataType) { @@ -214,7 +214,7 @@ public: if (_dataElement.valid()) return; - _dataElement = new HLAFloatDataElement(&dataType); + HLADataElementFactoryVisitor::apply(dataType); } virtual void apply(const HLAFloat64DataType& dataType) { @@ -222,7 +222,7 @@ public: if (_dataElement.valid()) return; - _dataElement = new HLADoubleDataElement(&dataType); + HLADataElementFactoryVisitor::apply(dataType); } class ArrayDataElementFactory : public HLAArrayDataElement::DataElementFactory { @@ -287,7 +287,7 @@ public: if (_dataElement.valid()) return; - _dataElement = new HLAEnumeratedDataElement(&dataType); + HLADataElementFactoryVisitor::apply(dataType); } virtual void apply(const HLAFixedRecordDataType& dataType) @@ -357,9 +357,6 @@ public: _dataElement = variantDataElement; } - const SGSharedPtr& getDataElement() const - { return _dataElement; } - private: SGSharedPtr createDataElement(const HLADataElement::Path& path, const HLADataType& dataType) { @@ -381,7 +378,6 @@ private: return dataElement; } - SGSharedPtr _dataElement; const HLAPathElementMap& _pathElementMap; HLADataElement::Path _path; };