|
Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
|
A multi-producer, multi-consumer queue. Properties: More...
#include <QueueMPMC.h>
Inherits gts::AlignedAllocator< GTS_NO_SHARING_CACHE_LINE_SIZE >.
Public Types | |
| using | value_type = T |
| using | mutex_type = TMutex |
| using | size_type = size_t |
| using | allocator_type = TAllocator |
Public Member Functions | |
| TicketQueueMPMC (size_t numQueues, allocator_type const &allocator=allocator_type()) | |
| TicketQueueMPMC (size_t numQueues, size_type sizePow2, allocator_type const &allocator=allocator_type()) | |
| TicketQueueMPMC (TicketQueueMPMC const &other) | |
| TicketQueueMPMC (TicketQueueMPMC &&other) | |
| TicketQueueMPMC & | operator= (TicketQueueMPMC const &other) |
| TicketQueueMPMC & | operator= (TicketQueueMPMC &&other) |
| bool | empty () const |
| size_type | size () const |
| size_type | capacity () const |
| allocator_type | get_allocator () const |
| void | reserve (size_type sizePow2) |
| void | clear () |
| bool | tryPush (size_type ticket, const value_type &val) |
| bool | tryPush (size_type ticket, value_type &&val) |
| bool | tryPop (size_type ticket, value_type &out) |
A multi-producer, multi-consumer queue. Properties:
| T | The type stored in the container. |
| TMutex | The mutex type that guards access to the container. |
| TAllocator | The allocator used for T. |
| TSize | The integral type used for the container size. |
| gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::TicketQueueMPMC | ( | TicketQueueMPMC< T, TMutex, TAllocator > const & | other | ) |
Copy constructor.
| gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::TicketQueueMPMC | ( | TicketQueueMPMC< T, TMutex, TAllocator > && | other | ) |
Move constructor.
| TicketQueueMPMC< T, TMutex, TAllocator >::size_type gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::capacity |
| void gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::clear |
Removes all elements from the queue.
| bool gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::empty |
| TicketQueueMPMC< T, TMutex, TAllocator >::allocator_type gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::get_allocator |
| TicketQueueMPMC< T, TMutex, TAllocator > & gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::operator= | ( | TicketQueueMPMC< T, TMutex, TAllocator > && | other | ) |
Move assignment.
| TicketQueueMPMC< T, TMutex, TAllocator > & gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::operator= | ( | TicketQueueMPMC< T, TMutex, TAllocator > const & | other | ) |
Copy assignment.
| void gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::reserve | ( | size_type | sizePow2 | ) |
Increases the capacity of the queue. Does nothing if 'sizePow2' < capacity.
| TicketQueueMPMC< T, TMutex, TAllocator >::size_type gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::size |
| bool gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::tryPop | ( | size_type | ticket, |
| value_type & | out | ||
| ) |
Pops an element from the queue and copies it into 'out'.
| bool gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::tryPush | ( | size_type | ticket, |
| const value_type & | val | ||
| ) |
Copies 'val' into the queue.
| bool gts::internal::TicketQueueMPMC< T, TMutex, TAllocator >::tryPush | ( | size_type | ticket, |
| value_type && | val | ||
| ) |
Moves 'val' into the queue.