bt_zmq_publisher.h
Go to the documentation of this file.
1 #ifndef BT_ZMQ_PUBLISHER_H
2 #define BT_ZMQ_PUBLISHER_H
3 
4 #include <array>
5 #include <future>
6 #include "abstract_logger.h"
7 
8 
9 namespace BT
10 {
12 {
13  static std::atomic<bool> ref_count;
14 
15  public:
16  PublisherZMQ(TreeNode* root_node, int max_msg_per_second = 25);
17 
18  virtual ~PublisherZMQ();
19 
20  private:
21  virtual void callback(Duration timestamp, const TreeNode& node, NodeStatus prev_status,
22  NodeStatus status) override;
23 
24  virtual void flush() override;
25 
27  std::vector<uint8_t> tree_buffer_;
28  std::vector<uint8_t> status_buffer_;
29  std::vector<SerializedTransition> transition_buffer_;
30  std::chrono::microseconds min_time_between_msgs_;
31 
32  std::atomic_bool active_server_;
33  std::thread thread_;
34 
35  void createStatusBuffer();
36 
39  std::atomic_bool send_pending_;
40 
41  std::future<void> send_future_;
42 
43  struct Pimpl;
44  Pimpl* zmq_;
45 
46 };
47 }
48 
49 #endif // BT_ZMQ_PUBLISHER_H
std::vector< uint8_t > status_buffer_
std::chrono::high_resolution_clock::time_point TimePoint
Definition: tree_node.h:35
PublisherZMQ(TreeNode *root_node, int max_msg_per_second=25)
std::vector< uint8_t > tree_buffer_
TreeNode * root_node_
std::atomic_bool active_server_
static pthread_mutex_t mutex
Definition: minitrace.cpp:61
static std::atomic< bool > ref_count
virtual void flush() override
std::future< void > send_future_
virtual void callback(Duration timestamp, const TreeNode &node, NodeStatus prev_status, NodeStatus status) override
std::chrono::microseconds min_time_between_msgs_
std::thread thread_
NodeStatus
Definition: basic_types.h:28
std::vector< SerializedTransition > transition_buffer_
std::chrono::high_resolution_clock::duration Duration
Definition: tree_node.h:36
std::atomic_bool send_pending_


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