proxygen
|
#include <PriorityMPMCQueue.h>
Public Member Functions | |
PriorityMPMCQueue (size_t numPriorities, size_t capacity) | |
size_t | getNumPriorities () |
bool | write (T &&item) |
bool | writeWithPriority (T &&item, size_t priority) |
bool | writeWithPriority (T &&item, size_t priority, std::chrono::milliseconds timeout) |
bool | read (T &item) |
bool | readWithPriority (T &item, size_t priority) |
size_t | size () const |
size_t | sizeGuess () const |
bool | isEmpty () const |
Returns true if there are no items available for dequeue. More... | |
Private Attributes | |
std::vector< folly::MPMCQueue< T, Atom, Dynamic > > | queues_ |
PriorityMPMCQueue is a thin wrapper on MPMCQueue, providing priorities by managing multiple underlying MPMCQueues. As of now, this does not implement a blocking interface. For the purposes of this class, lower number is higher priority
Definition at line 35 of file PriorityMPMCQueue.h.
|
inline |
Definition at line 37 of file PriorityMPMCQueue.h.
References i, and folly::PriorityMPMCQueue< T, Atom, Dynamic >::queues_.
|
inline |
Definition at line 45 of file PriorityMPMCQueue.h.
References folly::PriorityMPMCQueue< T, Atom, Dynamic >::queues_.
Referenced by TEST(), folly::PriorityMPMCQueue< T, Atom, Dynamic >::write(), and folly::PriorityMPMCQueue< T, Atom, Dynamic >::writeWithPriority().
|
inline |
Returns true if there are no items available for dequeue.
Definition at line 106 of file PriorityMPMCQueue.h.
References folly::PriorityMPMCQueue< T, Atom, Dynamic >::size().
Referenced by TEST().
|
inline |
Definition at line 70 of file PriorityMPMCQueue.h.
References folly::PriorityMPMCQueue< T, Atom, Dynamic >::queues_.
Referenced by TEST().
|
inline |
Definition at line 79 of file PriorityMPMCQueue.h.
References folly::PriorityMPMCQueue< T, Atom, Dynamic >::queues_.
Referenced by TEST().
|
inline |
Definition at line 83 of file PriorityMPMCQueue.h.
References folly::PriorityMPMCQueue< T, Atom, Dynamic >::queues_.
Referenced by folly::PriorityMPMCQueue< T, Atom, Dynamic >::isEmpty(), and TEST().
|
inline |
Definition at line 94 of file PriorityMPMCQueue.h.
References folly::PriorityMPMCQueue< T, Atom, Dynamic >::queues_.
Referenced by TEST().
|
inline |
Definition at line 50 of file PriorityMPMCQueue.h.
References folly::PriorityMPMCQueue< T, Atom, Dynamic >::getNumPriorities(), folly::gen::move, and folly::PriorityMPMCQueue< T, Atom, Dynamic >::writeWithPriority().
Referenced by TEST().
|
inline |
Definition at line 54 of file PriorityMPMCQueue.h.
References folly::PriorityMPMCQueue< T, Atom, Dynamic >::getNumPriorities(), min, folly::gen::move, and folly::PriorityMPMCQueue< T, Atom, Dynamic >::queues_.
Referenced by TEST(), and folly::PriorityMPMCQueue< T, Atom, Dynamic >::write().
|
inline |
Definition at line 60 of file PriorityMPMCQueue.h.
References folly::PriorityMPMCQueue< T, Atom, Dynamic >::getNumPriorities(), min, folly::gen::move, now(), and folly::PriorityMPMCQueue< T, Atom, Dynamic >::queues_.
|
private |
Definition at line 111 of file PriorityMPMCQueue.h.
Referenced by folly::PriorityMPMCQueue< T, Atom, Dynamic >::getNumPriorities(), folly::PriorityMPMCQueue< T, Atom, Dynamic >::PriorityMPMCQueue(), folly::PriorityMPMCQueue< T, Atom, Dynamic >::read(), folly::PriorityMPMCQueue< T, Atom, Dynamic >::readWithPriority(), folly::PriorityMPMCQueue< T, Atom, Dynamic >::size(), folly::PriorityMPMCQueue< T, Atom, Dynamic >::sizeGuess(), and folly::PriorityMPMCQueue< T, Atom, Dynamic >::writeWithPriority().