22 #ifndef INCLUDED_MSG_QUEUE_H
23 #define INCLUDED_MSG_QUEUE_H
47 std::deque<pmt::pmt_t> d_msgs;
77 bool empty_p()
const {
return d_msgs.empty(); }
80 bool full_p()
const {
return d_limit != 0 && count() >= d_limit; }
83 unsigned int count()
const {
return d_msgs.size(); }
86 unsigned int limit()
const {
return d_limit; }
#define GRUEL_API
Definition: gruel/src/include/gruel/api.h:30
boost::condition_variable condition_variable
Definition: thread.h:46
boost::mutex mutex
Definition: thread.h:44
bool full_p() const
is the queue full?
Definition: msg_queue.h:80
bool empty_p() const
is the queue empty?
Definition: msg_queue.h:77
unsigned int count() const
return number of messages in queue
Definition: msg_queue.h:83
thread-safe message queue
Definition: msg_queue.h:40
msg_queue_sptr make_msg_queue(unsigned int limit=0)
boost::intrusive_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
Definition: pmt.h:54
unsigned int limit() const
return limit on number of message in queue. 0 -> unbounded
Definition: msg_queue.h:86