2022-09-04 03:06:09 +02:00

29 lines
699 B
C++

#ifndef GERMANAIRLINESVA_GACONNECTOR_RECORDINGPATH_H
#define GERMANAIRLINESVA_GACONNECTOR_RECORDINGPATH_H
#include <cstdint>
#include <cstring>
#include <vector>
#include "pathSegment.hpp"
class Path
{
private:
std::uint64_t count = 0;
std::vector<std::uint8_t> file;
public:
void addSegment(PathSegment segment)
{
file.resize(file.size() + segment.getBinaryLength());
std::uint8_t *bufPtr = file.data() + count * segment.getBinaryLength();
memcpy(bufPtr, segment.getBinaryData(), segment.getBinaryLength());
count++;
}
std::uint8_t *getBinaryData() { return file.data(); }
std::size_t getBinaryLength() { return file.size(); }
};
#endif