#include <Queue.h>

Inheritance diagram for Ipc::MultiQueue:
Collaboration diagram for Ipc::MultiQueue:

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::BalancelocalBalance ()
 returns local reader's balance More...
 
const QueueReader::Balancebalance (const int remoteProcessId) const
 returns reader's balance for a given remote process More...
 
QueueReader::RatelocalRateLimit ()
 returns local reader's rate limit More...
 
const QueueReader::RaterateLimit (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 OwnerInit (const String &id, const int processCount, const int processIdOffset, const unsigned int maxItemSize, const int capacity)
 

Protected Member Functions

const OneToOneUniQueueinQueue (const int remoteProcessId) const override
 incoming queue from a given remote process More...
 
const OneToOneUniQueueoutQueue (const int remoteProcessId) const override
 outgoing queue to a given remote process More...
 
const QueueReaderlocalReader () const override
 
const QueueReaderremoteReader (const int remoteProcessId) const override
 
int remotesCount () const override
 
int remotesIdOffset () const override
 
OneToOneUniQueueinQueue (const int remoteProcessId)
 
OneToOneUniQueueoutQueue (const int remoteProcessId)
 
QueueReaderlocalReader ()
 
QueueReaderremoteReader (const int remoteProcessId)
 

Protected Attributes

const int theLocalProcessId
 process ID of this queue More...
 

Private Member Functions

bool validProcessId (const int processId) const
 
const OneToOneUniQueueoneToOneQueue (const int fromProcessId, const int toProcessId) const
 
const QueueReaderreader (const int processId) const
 

Private Attributes

const Mem::Pointer< Metadatametadata
 shared metadata More...
 
const Mem::Pointer< OneToOneUniQueuesqueues
 unidirection one-to-one queues More...
 
const Mem::Pointer< QueueReadersreaders
 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.

Definition at line 316 of file Queue.h.

Member Typedef Documentation

◆ Full

Definition at line 319 of file Queue.h.

◆ ItemTooLarge

Constructor & Destructor Documentation

◆ MultiQueue()

Ipc::MultiQueue::MultiQueue ( const String id,
const int  localProcessId 
)

Definition at line 373 of file Queue.cc.

References debugs, localReader(), metadata, Must, queues, and readers.

Member Function Documentation

◆ balance()

const Ipc::QueueReader::Balance & Ipc::BaseMultiQueue::balance ( const int  remoteProcessId) const
inherited

Definition at line 180 of file Queue.cc.

References Ipc::QueueReader::balance.

◆ clearAllReaderSignals()

void Ipc::BaseMultiQueue::clearAllReaderSignals ( )
inherited

Definition at line 172 of file Queue.cc.

References Ipc::QueueReader::clearSignal(), debugs, and Ipc::QueueReader::id.

◆ clearReaderSignal()

void Ipc::BaseMultiQueue::clearReaderSignal ( const int  remoteProcessId)
inherited

Definition at line 159 of file Queue.cc.

◆ Init()

Ipc::MultiQueue::Owner * Ipc::MultiQueue::Init ( const String id,
const int  processCount,
const int  processIdOffset,
const unsigned int  maxItemSize,
const int  capacity 
)
static

Definition at line 368 of file Queue.cc.

Referenced by CollapsedForwardingRr::create().

◆ inQueue() [1/2]

Ipc::OneToOneUniQueue & Ipc::BaseMultiQueue::inQueue ( const int  remoteProcessId)
protectedinherited

Definition at line 194 of file Queue.cc.

◆ inQueue() [2/2]

const Ipc::OneToOneUniQueue & Ipc::MultiQueue::inQueue ( const int  remoteProcessId) const
overrideprotectedvirtual

Implements Ipc::BaseMultiQueue.

Definition at line 412 of file Queue.cc.

◆ inSize()

int Ipc::BaseMultiQueue::inSize ( const int  remoteProcessId) const
inlineinherited

Definition at line 204 of file Queue.h.

References Ipc::BaseMultiQueue::inQueue(), and Ipc::OneToOneUniQueue::size().

◆ localBalance()

QueueReader::Balance & Ipc::BaseMultiQueue::localBalance ( )
inlineinherited

Definition at line 192 of file Queue.h.

References Ipc::QueueReader::balance, and Ipc::BaseMultiQueue::localReader().

◆ localRateLimit()

QueueReader::Rate & Ipc::BaseMultiQueue::localRateLimit ( )
inlineinherited

Definition at line 198 of file Queue.h.

References Ipc::BaseMultiQueue::localReader(), and Ipc::QueueReader::rateLimit.

◆ localReader() [1/2]

Ipc::QueueReader & Ipc::BaseMultiQueue::localReader ( )
protectedinherited

Definition at line 210 of file Queue.cc.

◆ localReader() [2/2]

const Ipc::QueueReader & Ipc::MultiQueue::localReader ( ) const
overrideprotectedvirtual

Implements Ipc::BaseMultiQueue.

Definition at line 424 of file Queue.cc.

Referenced by MultiQueue().

◆ oneToOneQueue()

const Ipc::OneToOneUniQueue & Ipc::MultiQueue::oneToOneQueue ( const int  fromProcessId,
const int  toProcessId 
) const
private

Definition at line 393 of file Queue.cc.

References assert.

◆ outQueue() [1/2]

Ipc::OneToOneUniQueue & Ipc::BaseMultiQueue::outQueue ( const int  remoteProcessId)
protectedinherited

Definition at line 202 of file Queue.cc.

◆ outQueue() [2/2]

const Ipc::OneToOneUniQueue & Ipc::MultiQueue::outQueue ( const int  remoteProcessId) const
overrideprotectedvirtual

Implements Ipc::BaseMultiQueue.

Definition at line 418 of file Queue.cc.

◆ outSize()

int Ipc::BaseMultiQueue::outSize ( const int  remoteProcessId) const
inlineinherited

Definition at line 207 of file Queue.h.

References Ipc::BaseMultiQueue::outQueue(), and Ipc::OneToOneUniQueue::size().

◆ peek()

template<class Value >
bool Ipc::BaseMultiQueue::peek ( int remoteProcessId,
Value &  value 
) const
inherited

◆ pop()

◆ push()

template<class Value >
bool Ipc::BaseMultiQueue::push ( const int  remoteProcessId,
const Value &  value 
)
inherited

◆ rateLimit()

const Ipc::QueueReader::Rate & Ipc::BaseMultiQueue::rateLimit ( const int  remoteProcessId) const
inherited

Definition at line 187 of file Queue.cc.

References Ipc::QueueReader::rateLimit.

◆ reader()

const Ipc::QueueReader & Ipc::MultiQueue::reader ( const int  processId) const
private

Definition at line 404 of file Queue.cc.

References assert.

◆ remoteReader() [1/2]

Ipc::QueueReader & Ipc::BaseMultiQueue::remoteReader ( const int  remoteProcessId)
protectedinherited

Definition at line 218 of file Queue.cc.

◆ remoteReader() [2/2]

const Ipc::QueueReader & Ipc::MultiQueue::remoteReader ( const int  remoteProcessId) const
overrideprotectedvirtual

Implements Ipc::BaseMultiQueue.

Definition at line 430 of file Queue.cc.

◆ remotesCount()

int Ipc::MultiQueue::remotesCount ( ) const
overrideprotectedvirtual

Implements Ipc::BaseMultiQueue.

Definition at line 436 of file Queue.cc.

◆ remotesIdOffset()

int Ipc::MultiQueue::remotesIdOffset ( ) const
overrideprotectedvirtual

Implements Ipc::BaseMultiQueue.

Definition at line 442 of file Queue.cc.

◆ stat()

◆ validProcessId()

bool Ipc::MultiQueue::validProcessId ( const int  processId) const
private

Definition at line 386 of file Queue.cc.

Member Data Documentation

◆ metadata

const Mem::Pointer<Metadata> Ipc::MultiQueue::metadata
private

Definition at line 364 of file Queue.h.

Referenced by MultiQueue().

◆ queues

const Mem::Pointer<OneToOneUniQueues> Ipc::MultiQueue::queues
private

Definition at line 365 of file Queue.h.

Referenced by MultiQueue().

◆ readers

const Mem::Pointer<QueueReaders> Ipc::MultiQueue::readers
private

Definition at line 366 of file Queue.h.

Referenced by MultiQueue().

◆ theLastPopProcessId

int Ipc::BaseMultiQueue::theLastPopProcessId
privateinherited

Definition at line 231 of file Queue.h.

Referenced by Ipc::BaseMultiQueue::peek(), and Ipc::BaseMultiQueue::pop().

◆ theLocalProcessId

const int Ipc::BaseMultiQueue::theLocalProcessId
protectedinherited

The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors