bt_file_logger.h
Go to the documentation of this file.
1 #ifndef BT_FILE_LOGGER_H
2 #define BT_FILE_LOGGER_H
3 
4 #include <fstream>
5 #include <deque>
6 #include <array>
7 #include "abstract_logger.h"
8 
9 namespace BT
10 {
12 {
13  public:
14  FileLogger(const Tree &tree, const char* filename, uint16_t buffer_size = 10);
15 
16  virtual ~FileLogger() override;
17 
18  virtual void callback(Duration timestamp, const TreeNode& node, NodeStatus prev_status,
19  NodeStatus status) override;
20 
21  virtual void flush() override;
22 
23  private:
24  std::ofstream file_os_;
25 
26  std::chrono::high_resolution_clock::time_point start_time;
27 
28  std::vector<SerializedTransition> buffer_;
29 
31 };
32 
33 } // end namespace
34 
35 #endif // BT_FILE_LOGGER_H
FileLogger(const Tree &tree, const char *filename, uint16_t buffer_size=10)
std::ofstream file_os_
virtual void flush() override
virtual void callback(Duration timestamp, const TreeNode &node, NodeStatus prev_status, NodeStatus status) override
size_t buffer_max_size_
Abstract base class for Behavior Tree Nodes.
Definition: tree_node.h:53
std::vector< SerializedTransition > buffer_
std::chrono::high_resolution_clock::time_point start_time
NodeStatus
Definition: basic_types.h:35
Struct used to store a tree. If this object goes out of scope, the tree is destroyed.
Definition: bt_factory.h:78
virtual ~FileLogger() override
std::chrono::high_resolution_clock::duration Duration
Definition: basic_types.h:339


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Jun 8 2019 18:04:04