#include #include #include /* * Length in bytes: 20 * * UINT16 | UINT16 | DOUBLE | DOUBLE | * ---------+-------------+----------+-----------+ * ALTITUDE | GROUNDSPEED | LATITUDE | LONGITUDE | */ class PathSegment { private: std::uint16_t altitude; std::uint16_t groundSpeed; double latitude; double longitude; std::vector file; public: PathSegment(std::uint16_t altitude, std::uint16_t groundSpeed, double latitude, double longitude) { this->altitude = altitude; file = std::vector(20, 0); std::uint8_t *bufPtr = file.data(); memcpy(bufPtr, &this->altitude, sizeof(this->altitude)); bufPtr += sizeof(this->altitude); memcpy(bufPtr, &this->groundSpeed, sizeof(this->groundSpeed)); bufPtr += sizeof(this->groundSpeed); memcpy(bufPtr, &this->latitude, sizeof(this->latitude)); bufPtr += sizeof(this->latitude); memcpy(bufPtr, &this->longitude, sizeof(this->longitude)); } };