2#include <boost/container/deque.hpp>
3#include <boost/thread/mutex.hpp>
4#include <boost/thread/condition.hpp>
5#include <boost/thread/thread.hpp>
6#include <boost/call_traits.hpp>
7#include <boost/bind/bind.hpp>
10using namespace boost::placeholders;
18 typedef typename container_type::size_type
size_type;
20 typedef typename boost::call_traits<value_type>::param_type
param_type;
24 void push(
typename boost::call_traits<value_type>::param_type item)
27 boost::mutex::scoped_lock lock(
m_mutex);
43 void push_back(
typename boost::call_traits<value_type>::param_type item)
46 boost::mutex::scoped_lock lock(
m_mutex);
48 if (
m_accept && isCommandQueueNotFull)
50 LOG_TRACE <<
"command pushed" << std::endl;
65 boost::mutex::scoped_lock lock(
m_mutex);
83 bool try_push(
typename boost::call_traits<value_type>::param_type item)
85 boost::mutex::scoped_lock lock(
m_mutex);
102 boost::mutex::scoped_lock lock(
m_mutex);
108 boost::mutex::scoped_lock lock(
m_mutex);
119 boost::mutex::scoped_lock lock(
m_mutex);
128 boost::mutex::scoped_lock lock(
m_mutex);
144 boost::mutex::scoped_lock lock(
m_mutex);
154 boost::mutex::scoped_lock lock(
m_mutex);
161 boost::mutex::scoped_lock lock(
m_mutex);
168 boost::mutex::scoped_lock lock(
m_mutex);
boost::mutex m_mutex
Definition BoundBuffer.h:188
bounded_buffer(const bounded_buffer &)
size_type m_unread
Definition BoundBuffer.h:185
boost::condition m_not_empty
Definition BoundBuffer.h:189
boost::call_traits< value_type >::param_type param_type
Definition BoundBuffer.h:20
friend class NonBlockingAllOrNonePushStrategy
Definition BoundBuffer.h:192
bool is_ready_to_accept() const
Definition BoundBuffer.h:179
bool isFull()
Definition BoundBuffer.h:100
size_type m_capacity
Definition BoundBuffer.h:186
bool is_not_empty() const
Definition BoundBuffer.h:177
boost::container::deque< T > container_type
Definition BoundBuffer.h:17
container_type::size_type size_type
Definition BoundBuffer.h:18
value_type peek()
Definition BoundBuffer.h:118
boost::condition m_not_full
Definition BoundBuffer.h:190
bool is_not_full() const
Definition BoundBuffer.h:178
void clear()
Definition BoundBuffer.h:143
void acquireLock()
Definition BoundBuffer.h:194
bool try_push(typename boost::call_traits< value_type >::param_type item)
Definition BoundBuffer.h:83
value_type try_pop()
Definition BoundBuffer.h:127
void releaseLock()
Definition BoundBuffer.h:199
size_t size()
Definition BoundBuffer.h:166
container_type m_container
Definition BoundBuffer.h:187
void push_back(typename boost::call_traits< value_type >::param_type item)
Definition BoundBuffer.h:43
bounded_buffer(size_type capacity)
Definition BoundBuffer.h:22
bool m_accept
Definition BoundBuffer.h:184
void push_drop_oldest(typename boost::call_traits< value_type >::param_type item)
Definition BoundBuffer.h:63
value_type pop()
Definition BoundBuffer.h:107
void push(typename boost::call_traits< value_type >::param_type item)
Definition BoundBuffer.h:24
bounded_buffer & operator=(const bounded_buffer &)
void flush()
Definition BoundBuffer.h:153
void pushUnsafeForQuePushStrategy(typename boost::call_traits< value_type >::param_type item)
Definition BoundBuffer.h:205
void accept()
Definition BoundBuffer.h:160
container_type::value_type value_type
Definition BoundBuffer.h:19