39 boost::shared_lock<boost::shared_mutex> lock(
mutex_);
45 boost::shared_lock<boost::shared_mutex> lock(
mutex_);
51 boost::shared_lock<boost::shared_mutex> lock(
mutex_);
57 boost::shared_lock<boost::shared_mutex> lock(
mutex_);
63 boost::unique_lock<boost::shared_mutex> lock(
mutex_);
69 boost::unique_lock<boost::shared_mutex> lock(
mutex_);
81 std::map<std::string, OutMsgQueue*>::iterator it;
82 for(it = queue_map_.begin(); it != queue_map_.end(); it++) {
91 queue_map_.insert(std::pair<std::string, OutMsgQueue*>(name, queue));
96 std::map<std::string, OutMsgQueue*>::iterator it = queue_map_.find(name);
97 if(it != queue_map_.end()) {
101 std::cout<<
"get out msg queue "<<name<<
" failed!"<<std::endl;
108 boost::shared_lock<boost::shared_mutex> lock(msg_queue_mutex);
109 std::map<std::string, OutMsgQueue*>::iterator it;
110 for(it = queue_map_.begin(); it != queue_map_.end(); it++) {
111 std::string name = it->first;
113 if(name ==
"scds_pso") {
114 for(
int i = 0; i < msg_queue->
size(); i++) {
115 msg_vec.push_back(msg_queue->
front());
120 if (!msg_queue->
empty()) {
121 msg_vec.push_back(msg_queue->
front());
126 while(allOutMsgQueueEmpty()) {
127 msg_queue_condition.wait(lock);
133 std::map<std::string, OutMsgQueue*>::iterator it;
134 for(it = queue_map_.begin(); it != queue_map_.end(); it++) {
135 if(!it->second->empty()) {
boost::condition_variable_any msg_queue_condition
OutMsgQueue(const std::string &name, int size, MsgQueueManager *manager_ptr)
void notify_one() BOOST_NOEXCEPT
MsgQueueManager * queue_manager_ptr_
boost::shared_mutex mutex_
OutMsgQueue * getOutMsgQueue(std::string name)
boost::shared_ptr< cqueue< std::vector< uint8_t > > > queue_
void createOutMsgQueue(std::string name, int size)
void push(const std::vector< uint8_t > &msg)
const std::vector< uint8_t > & front()
void spinAllOutMsgQueueOnce(std::vector< std::vector< uint8_t > > &msg_vec)
bool allOutMsgQueueEmpty()