#include <plib/sg.h>
#include <simgear/compiler.h>
+#include <simgear/props/props.hxx>
#include <simgear/math/SGMath.hxx>
#include "tiny_xdr.hxx"
xdr_data_t angularAccel[3];
};
-// Property message
-struct T_PropertyMsg {
- xdr_data_t id;
- xdr_data_t value;
-};
-
-struct FGFloatPropertyData {
+struct FGPropertyData {
unsigned id;
- float value;
+
+ // While the type isn't transmitted, it is needed for the destructor
+ SGPropertyNode::Type type;
+ union {
+ int int_value;
+ float float_value;
+ char* string_value;
+ };
+
+ ~FGPropertyData() {
+ if ((type == SGPropertyNode::STRING) || (type == SGPropertyNode::UNSPECIFIED))
+ {
+ delete [] string_value;
+ }
+ }
};
+
+
// Position message
struct FGExternalMotionData {
// simulation time when this packet was generated
SGVec3f angularAccel;
// The set of properties recieved for this timeslot
- std::vector<FGFloatPropertyData> properties;
+ std::vector<FGPropertyData*> properties;
};
#endif