X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fhla%2FHLADataTypeVisitor.hxx;h=2af1012c5eeb37691ae92e51cc1a4be052ca1b44;hb=264e336a4941a719362c75b3415a92e9098b2719;hp=d3cd9b223d38531757111a055117d4a26f6cfee6;hpb=3a0fbae4d90187d96eb991a7d7dccc339a3bcb48;p=simgear.git diff --git a/simgear/hla/HLADataTypeVisitor.hxx b/simgear/hla/HLADataTypeVisitor.hxx index d3cd9b22..2af1012c 100644 --- a/simgear/hla/HLADataTypeVisitor.hxx +++ b/simgear/hla/HLADataTypeVisitor.hxx @@ -24,7 +24,7 @@ #include #include "HLAArrayDataType.hxx" #include "HLABasicDataType.hxx" -#include "HLADataTypeVisitor.hxx" +#include "HLADataElement.hxx" #include "HLAEnumeratedDataType.hxx" #include "HLAFixedRecordDataType.hxx" #include "HLAVariantDataType.hxx" @@ -629,6 +629,43 @@ inline void HLADataTypeEncodeVisitor::apply(const HLAVariableArrayDataType& data dataType.getSizeDataType()->accept(numElementsVisitor); } +/// Generate standard data elements according to the traversed type +class HLADataElementFactoryVisitor : public HLADataTypeVisitor { +public: + virtual ~HLADataElementFactoryVisitor(); + + virtual void apply(const HLADataType& dataType); + + virtual void apply(const HLAInt8DataType& dataType); + virtual void apply(const HLAUInt8DataType& dataType); + virtual void apply(const HLAInt16DataType& dataType); + virtual void apply(const HLAUInt16DataType& dataType); + virtual void apply(const HLAInt32DataType& dataType); + virtual void apply(const HLAUInt32DataType& dataType); + virtual void apply(const HLAInt64DataType& dataType); + virtual void apply(const HLAUInt64DataType& dataType); + virtual void apply(const HLAFloat32DataType& dataType); + virtual void apply(const HLAFloat64DataType& dataType); + + virtual void apply(const HLAFixedArrayDataType& dataType); + virtual void apply(const HLAVariableArrayDataType& dataType); + + virtual void apply(const HLAEnumeratedDataType& dataType); + + virtual void apply(const HLAFixedRecordDataType& dataType); + + virtual void apply(const HLAVariantDataType& dataType); + + HLADataElement* getDataElement() + { return _dataElement.release(); } + +protected: + class ArrayDataElementFactory; + class VariantDataElementFactory; + + SGSharedPtr _dataElement; +}; + } // namespace simgear #endif