21 file_os_.open(filename, std::ofstream::binary | std::ofstream::out);
25 flatbuffers::WriteScalar(size_buff, static_cast<int32_t>(builder.
GetSize()));
45 file_os_.write(reinterpret_cast<const char*>(buffer.data()), buffer.size());
59 for (
const auto& array :
buffer_)
61 file_os_.write(reinterpret_cast<const char*>(array.data()), array.size());
std::array< uint8_t, 12 > SerializedTransition
static raw_event_t * buffer
virtual void flush() override
FileLogger(TreeNode *root_node, const char *filename, uint16_t buffer_size=10)
Helper class to hold data needed in creation of a FlatBuffer. To serialize data, you typically call o...
virtual void callback(Duration timestamp, const TreeNode &node, NodeStatus prev_status, NodeStatus status) override
uoffset_t GetSize() const
The current size of the serialized buffer, counting from the end.
std::vector< SerializedTransition > buffer_
void CreateFlatbuffersBehaviorTree(flatbuffers::FlatBufferBuilder &builder, BT::TreeNode *root_node)
virtual ~FileLogger() override
void enableTransitionToIdle(bool enable)
std::chrono::high_resolution_clock::duration Duration
uint8_t * GetBufferPointer() const
Get the serialized buffer (after you call Finish()).
SerializedTransition SerializeTransition(uint16_t UID, Duration timestamp, NodeStatus prev_status, NodeStatus status)