A FIFO Data Structure (Queue) which we specialize to store Orders. More...
#include <orderqueue.h>
Public Member Functions | |
| OrderQueue (const OrderAllocator &order_alloc) | |
| Constructor. | |
| ~OrderQueue () | |
| Destructor. | |
| void | PushBack (const Order &ord) |
| Insert the provided order at the end of the queue. This operation is thread safe and will block until it can be completed. | |
| Order | PopFront () |
| Remove and return the front Order of the queue. This operation is thread safe and will block until it can be completed (if there are no orders in the queue, this operation will pend until one becomes available). | |
| bool | Empty () |
| Check if the queue is empty. | |
Private Attributes | |
| OrderList | order_list_ |
| Underlying non-thread-safe container used to store the Orders. | |
| boost::interprocess::interprocess_mutex | mutex_ |
| Mutex used to allow thread-safe access to the underlying order_list_. | |
| boost::interprocess::interprocess_semaphore | sem_fill_ |
| Semaphore used to track the size of the queue. The semaphore is incremented on calls to PushBack and decremented on calls to PopFront. | |
A FIFO Data Structure (Queue) which we specialize to store Orders.
Definition at line 24 of file orderqueue.h.
| OrderQueue::OrderQueue | ( | const OrderAllocator & | order_alloc | ) | [explicit] |
Constructor.
| order_alloc | Shared Memory Allocator from which Orders are allocated |
Definition at line 16 of file orderqueue.cpp.
| OrderQueue::~OrderQueue | ( | ) |
Destructor.
Definition at line 22 of file orderqueue.cpp.
| bool OrderQueue::Empty | ( | ) |
Check if the queue is empty.
Definition at line 57 of file orderqueue.cpp.

| Order OrderQueue::PopFront | ( | ) |
Remove and return the front Order of the queue. This operation is thread safe and will block until it can be completed (if there are no orders in the queue, this operation will pend until one becomes available).
Definition at line 40 of file orderqueue.cpp.
| void OrderQueue::PushBack | ( | const Order & | ord | ) |
Insert the provided order at the end of the queue. This operation is thread safe and will block until it can be completed.
| ord | Order to insert |
Definition at line 25 of file orderqueue.cpp.
boost::interprocess::interprocess_mutex OrderQueue::mutex_ [private] |
Mutex used to allow thread-safe access to the underlying order_list_.
Definition at line 74 of file orderqueue.h.
OrderList OrderQueue::order_list_ [private] |
Underlying non-thread-safe container used to store the Orders.
Definition at line 68 of file orderqueue.h.
boost::interprocess::interprocess_semaphore OrderQueue::sem_fill_ [private] |
Semaphore used to track the size of the queue. The semaphore is incremented on calls to PushBack and decremented on calls to PopFront.
Definition at line 81 of file orderqueue.h.
1.6.3