#include <Queue.h>
Classes | |
struct | Metadata |
Shared metadata for MultiQueue. More... | |
class | Owner |
Public Types | |
typedef OneToOneUniQueue::Full | Full |
typedef OneToOneUniQueue::ItemTooLarge | ItemTooLarge |
Public Member Functions | |
MultiQueue (const String &id, const int localProcessId) | |
void | clearReaderSignal (const int remoteProcessId) |
clears the reader notification received by the local process from the remote process More... | |
void | clearAllReaderSignals () |
clears all reader notifications received by the local process More... | |
template<class Value > | |
bool | pop (int &remoteProcessId, Value &value) |
picks a process and calls OneToOneUniQueue::pop() using its queue More... | |
template<class Value > | |
bool | push (const int remoteProcessId, const Value &value) |
calls OneToOneUniQueue::push() using the given process queue More... | |
template<class Value > | |
bool | peek (int &remoteProcessId, Value &value) const |
peeks at the item likely to be pop()ed next More... | |
template<class Value > | |
void | stat (std::ostream &) const |
prints current state; suitable for cache manager reports More... | |
QueueReader::Balance & | localBalance () |
returns local reader's balance More... | |
const QueueReader::Balance & | balance (const int remoteProcessId) const |
returns reader's balance for a given remote process More... | |
QueueReader::Rate & | localRateLimit () |
returns local reader's rate limit More... | |
const QueueReader::Rate & | rateLimit (const int remoteProcessId) const |
returns reader's rate limit for a given remote process More... | |
int | inSize (const int remoteProcessId) const |
number of items in incoming queue from a given remote process More... | |
int | outSize (const int remoteProcessId) const |
number of items in outgoing queue to a given remote process More... | |
Static Public Member Functions | |
static Owner * | Init (const String &id, const int processCount, const int processIdOffset, const unsigned int maxItemSize, const int capacity) |
Protected Member Functions | |
const OneToOneUniQueue & | inQueue (const int remoteProcessId) const override |
incoming queue from a given remote process More... | |
const OneToOneUniQueue & | outQueue (const int remoteProcessId) const override |
outgoing queue to a given remote process More... | |
const QueueReader & | localReader () const override |
const QueueReader & | remoteReader (const int remoteProcessId) const override |
int | remotesCount () const override |
int | remotesIdOffset () const override |
OneToOneUniQueue & | inQueue (const int remoteProcessId) |
OneToOneUniQueue & | outQueue (const int remoteProcessId) |
QueueReader & | localReader () |
QueueReader & | remoteReader (const int remoteProcessId) |
Protected Attributes | |
const int | theLocalProcessId |
process ID of this queue More... | |
Private Member Functions | |
bool | validProcessId (const int processId) const |
const OneToOneUniQueue & | oneToOneQueue (const int fromProcessId, const int toProcessId) const |
const QueueReader & | reader (const int processId) const |
Private Attributes | |
const Mem::Pointer< Metadata > | metadata |
shared metadata More... | |
const Mem::Pointer< OneToOneUniQueues > | queues |
unidirection one-to-one queues More... | |
const Mem::Pointer< QueueReaders > | readers |
readers array More... | |
int | theLastPopProcessId |
the ID of the last process we tried to pop() from More... | |
Detailed Description
Lockless fixed-capacity bidirectional queue for a limited number processes. Any process may send data to and receive from any other process (including itself). Each process has a unique integer ID in [processIdOffset, processIdOffset + processCount) range.
Member Typedef Documentation
◆ Full
◆ ItemTooLarge
Constructor & Destructor Documentation
◆ MultiQueue()
Member Function Documentation
◆ balance()
|
inherited |
Definition at line 180 of file Queue.cc.
References Ipc::QueueReader::balance.
◆ clearAllReaderSignals()
|
inherited |
Definition at line 172 of file Queue.cc.
References Ipc::QueueReader::clearSignal(), debugs, and Ipc::QueueReader::id.
◆ clearReaderSignal()
|
inherited |
◆ Init()
|
static |
Definition at line 368 of file Queue.cc.
Referenced by CollapsedForwardingRr::create().
◆ inQueue() [1/2]
|
protectedinherited |
◆ inQueue() [2/2]
|
overrideprotectedvirtual |
Implements Ipc::BaseMultiQueue.
◆ inSize()
Definition at line 204 of file Queue.h.
References Ipc::BaseMultiQueue::inQueue(), and Ipc::OneToOneUniQueue::size().
◆ localBalance()
|
inlineinherited |
Definition at line 192 of file Queue.h.
References Ipc::QueueReader::balance, and Ipc::BaseMultiQueue::localReader().
◆ localRateLimit()
|
inlineinherited |
Definition at line 198 of file Queue.h.
References Ipc::BaseMultiQueue::localReader(), and Ipc::QueueReader::rateLimit.
◆ localReader() [1/2]
|
protectedinherited |
◆ localReader() [2/2]
|
overrideprotectedvirtual |
Implements Ipc::BaseMultiQueue.
Definition at line 424 of file Queue.cc.
Referenced by MultiQueue().
◆ oneToOneQueue()
|
private |
◆ outQueue() [1/2]
|
protectedinherited |
◆ outQueue() [2/2]
|
overrideprotectedvirtual |
Implements Ipc::BaseMultiQueue.
◆ outSize()
Definition at line 207 of file Queue.h.
References Ipc::BaseMultiQueue::outQueue(), and Ipc::OneToOneUniQueue::size().
◆ peek()
|
inherited |
Definition at line 568 of file Queue.h.
References Ipc::BaseMultiQueue::inQueue(), Ipc::OneToOneUniQueue::peek(), Ipc::BaseMultiQueue::remotesCount(), Ipc::BaseMultiQueue::remotesIdOffset(), and Ipc::BaseMultiQueue::theLastPopProcessId.
◆ pop()
|
inherited |
Definition at line 540 of file Queue.h.
References debugs, Ipc::BaseMultiQueue::inQueue(), Ipc::BaseMultiQueue::localReader(), Ipc::OneToOneUniQueue::pop(), Ipc::BaseMultiQueue::remotesCount(), Ipc::BaseMultiQueue::remotesIdOffset(), Ipc::OneToOneUniQueue::size(), Ipc::BaseMultiQueue::theLastPopProcessId, and Ipc::BaseMultiQueue::theLocalProcessId.
◆ push()
|
inherited |
Definition at line 558 of file Queue.h.
References debugs, Ipc::BaseMultiQueue::outQueue(), Ipc::OneToOneUniQueue::push(), Ipc::BaseMultiQueue::remoteReader(), Ipc::OneToOneUniQueue::size(), and Ipc::BaseMultiQueue::theLocalProcessId.
◆ rateLimit()
|
inherited |
Definition at line 187 of file Queue.cc.
References Ipc::QueueReader::rateLimit.
◆ reader()
|
private |
◆ remoteReader() [1/2]
|
protectedinherited |
◆ remoteReader() [2/2]
|
overrideprotectedvirtual |
Implements Ipc::BaseMultiQueue.
◆ remotesCount()
|
overrideprotectedvirtual |
Implements Ipc::BaseMultiQueue.
◆ remotesIdOffset()
|
overrideprotectedvirtual |
Implements Ipc::BaseMultiQueue.
◆ stat()
|
inherited |
Definition at line 586 of file Queue.h.
References Ipc::BaseMultiQueue::inQueue(), Ipc::BaseMultiQueue::localReader(), Ipc::BaseMultiQueue::outQueue(), Ipc::BaseMultiQueue::remotesCount(), Ipc::BaseMultiQueue::remotesIdOffset(), and Ipc::BaseMultiQueue::theLocalProcessId.
◆ validProcessId()
|
private |
Member Data Documentation
◆ metadata
|
private |
Definition at line 364 of file Queue.h.
Referenced by MultiQueue().
◆ queues
|
private |
Definition at line 365 of file Queue.h.
Referenced by MultiQueue().
◆ readers
|
private |
Definition at line 366 of file Queue.h.
Referenced by MultiQueue().
◆ theLastPopProcessId
|
privateinherited |
Definition at line 231 of file Queue.h.
Referenced by Ipc::BaseMultiQueue::peek(), and Ipc::BaseMultiQueue::pop().
◆ theLocalProcessId
|
protectedinherited |
Definition at line 228 of file Queue.h.
Referenced by Ipc::FewToFewBiQueue::findOldest(), Ipc::BaseMultiQueue::pop(), Ipc::BaseMultiQueue::push(), and Ipc::BaseMultiQueue::stat().
The documentation for this class was generated from the following files: