msg_queue_manager.h
Go to the documentation of this file.
1 
23 #ifndef MSG_QUEUE_MANAGER_H_
24 #define MSG_QUEUE_MANAGER_H_
25 
26 #include <iostream>
27 #include <boost/thread.hpp>
29 
30 namespace micros_swarm{
31 
32  class MsgQueueManager;
33 
35  {
36  public:
37  OutMsgQueue(const std::string& name, int size, MsgQueueManager *manager_ptr);
38  ~OutMsgQueue();
39  bool full();
40  bool empty();
41  int size();
42  const std::vector<uint8_t>& front();
43  void pop();
44  void push(const std::vector<uint8_t>& msg);
45  private:
46  std::string name_;
47  int size_;
49  boost::shared_mutex mutex_;
51  };
52 
54  {
55  public:
57  ~MsgQueueManager();
58  void createOutMsgQueue(std::string name, int size);
59  OutMsgQueue* getOutMsgQueue(std::string name);
60  void spinAllOutMsgQueueOnce(std::vector<std::vector<uint8_t> >& msg_vec);
61  bool allOutMsgQueueEmpty();
62 
63  boost::shared_mutex msg_queue_mutex;
65  private:
66  std::map<std::string, OutMsgQueue*> queue_map_;
67  };
68 };
69 
70 #endif
boost::condition_variable_any msg_queue_condition
OutMsgQueue(const std::string &name, int size, MsgQueueManager *manager_ptr)
MsgQueueManager * queue_manager_ptr_
boost::shared_mutex mutex_
boost::shared_ptr< cqueue< std::vector< uint8_t > > > queue_
boost::shared_mutex msg_queue_mutex
void push(const std::vector< uint8_t > &msg)
const std::vector< uint8_t > & front()
std::map< std::string, OutMsgQueue * > queue_map_


micros_swarm
Author(s):
autogenerated on Mon Jun 10 2019 14:02:06