]> git.mxchange.org Git - simgear.git/blobdiff - simgear/hla/HLADataTypeVisitor.hxx
hla: Initially request update for subscribed unowned attributes.
[simgear.git] / simgear / hla / HLADataTypeVisitor.hxx
index d3cd9b223d38531757111a055117d4a26f6cfee6..2af1012c5eeb37691ae92e51cc1a4be052ca1b44 100644 (file)
@@ -24,7 +24,7 @@
 #include <simgear/math/SGMath.hxx>
 #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<HLADataElement> _dataElement;
+};
+
 } // namespace simgear
 
 #endif