#include <vector>
-#include <plib/sg.h>
#include <simgear/compiler.h>
#include <simgear/props/props.hxx>
#include <simgear/math/SGMath.hxx>
// angular acceleration wrt the earth centered frame measured in
// the earth centered frame
xdr_data_t angularAccel[3];
+ // Padding. The alignment is 8 bytes on x86_64 because there are
+ // 8-byte types in the message, so the size should be explicitly
+ // rounded out to a multiple of 8. Of course, it's a bad idea to
+ // put a C struct directly on the wire, but that's a fight for
+ // another day...
+ xdr_data_t pad;
};
struct FGPropertyData {
unsigned id;
// While the type isn't transmitted, it is needed for the destructor
- SGPropertyNode::Type type;
+ simgear::props::Type type;
union {
int int_value;
float float_value;
};
~FGPropertyData() {
- if ((type == SGPropertyNode::STRING) || (type == SGPropertyNode::UNSPECIFIED))
+ if ((type == simgear::props::STRING) || (type == simgear::props::UNSPECIFIED))
{
delete [] string_value;
}
// simulation time when this packet was generated
double time;
// the artificial lag the client should stay behind the average
- // simulation time to arrival time diference
+ // simulation time to arrival time difference
// FIXME: should be some 'per model' instead of 'per packet' property
double lag;
// the earth centered frame
SGVec3f angularAccel;
- // The set of properties recieved for this timeslot
+ // The set of properties received for this timeslot
std::vector<FGPropertyData*> properties;
+
+ ~FGExternalMotionData()
+ {
+ std::vector<FGPropertyData*>::const_iterator propIt;
+ std::vector<FGPropertyData*>::const_iterator propItEnd;
+ propIt = properties.begin();
+ propItEnd = properties.end();
+
+ while (propIt != propItEnd)
+ {
+ delete *propIt;
+ propIt++;
+ }
+ }
};
#endif