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(TreeNode* root_node, 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
std::ofstream file_os_
virtual void flush() override
FileLogger(TreeNode *root_node, const char *filename, uint16_t buffer_size=10)
virtual void callback(Duration timestamp, const TreeNode &node, NodeStatus prev_status, NodeStatus status) override
std::vector< SerializedTransition > buffer_
std::chrono::high_resolution_clock::time_point start_time
NodeStatus
Definition: basic_types.h:28
virtual ~FileLogger() override
std::chrono::high_resolution_clock::duration Duration
Definition: tree_node.h:36


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sun Feb 3 2019 03:14:32