2022-09-08 02:02:09 +02:00

28 lines
1.0 KiB
C++

#include "pathSegment.h"
namespace germanairlinesva_recording
{
PathSegment::PathSegment(std::uint32_t time,
std::uint16_t altitude,
std::uint16_t groundSpeed,
struct germanairlinesva_geodata::point coordinates)
{
this->time = time;
this->altitude = altitude;
this->groundSpeed = groundSpeed;
this->coordinates = coordinates;
file = std::vector<std::uint8_t>(
sizeof(this->time) + sizeof(this->altitude) +
sizeof(this->groundSpeed) + sizeof(this->coordinates),
0);
std::uint8_t *bufPtr = file.data();
std::memcpy(bufPtr, &this->time, sizeof(this->time));
bufPtr += sizeof(this->time);
std::memcpy(bufPtr, &this->altitude, sizeof(this->altitude));
bufPtr += sizeof(this->altitude);
std::memcpy(bufPtr, &this->groundSpeed, sizeof(this->groundSpeed));
bufPtr += sizeof(this->groundSpeed);
std::memcpy(bufPtr, &this->coordinates, sizeof(this->coordinates));
};
} // namespace germanairlinesva_recording