31 #include <condition_variable> 33 #include <boost/circular_buffer.hpp> 34 #include <boost/call_traits.hpp> 60 using size_type =
typename container_type::size_type;
64 using param_type =
typename boost::call_traits<value_type>::param_type;
93 std::unique_lock<std::mutex> lock{
m_mutex};
111 std::unique_lock<std::mutex> lock{
m_mutex};
150 #endif // BOUNDEDBUFFER BoundedBuffer & operator=(const BoundedBuffer &)=delete
Copy assignment operator deleted.
bool IsNotFull() const
Test if buffer not full.
Definition: BoundedBuffer.h:142
~BoundedBuffer()=default
Default destructor.
size_type m_unreadCount
Unread count.
Definition: BoundedBuffer.h:127
typename boost::call_traits< value_type >::param_type param_type
Typedef for container param type.
Definition: BoundedBuffer.h:64
typename container_type::size_type size_type
Typedef for container size type.
Definition: BoundedBuffer.h:60
bool IsNotEmpty() const
Test if buffer not empty.
Definition: BoundedBuffer.h:134
std::mutex m_mutex
Synchronization mutex.
Definition: BoundedBuffer.h:121
container_type m_container
Circular buffer.
Definition: BoundedBuffer.h:129
typename container_type::value_type value_type
Typedef for container value type.
Definition: BoundedBuffer.h:62
The core_lib namespace.
Definition: AsioDefines.h:59
boost::circular_buffer< T > container_type
Typedef for container type.
Definition: BoundedBuffer.h:58
std::condition_variable m_notFullEvent
Condition variable to flag not full.
Definition: BoundedBuffer.h:125
void PopBack(value_type &item)
Pop item from the back.
Definition: BoundedBuffer.h:108
void PushFront(param_type item)
Push new item to the front.
Definition: BoundedBuffer.h:90
std::condition_variable m_notEmptyEvent
Condition variable to flag not empty.
Definition: BoundedBuffer.h:123
Class defining a bounded buffer.
Definition: BoundedBuffer.h:54
BoundedBuffer(size_type capacity)
Constructor.
Definition: BoundedBuffer.h:69