#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...
 
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...
 
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

virtual const OneToOneUniQueueinQueue (const int remoteProcessId) const
 incoming queue from a given remote process More...
 
virtual const OneToOneUniQueueoutQueue (const int remoteProcessId) const
 outgoing queue to a given remote process More...
 
virtual const QueueReaderlocalReader () const
 
virtual const QueueReaderremoteReader (const int remoteProcessId) const
 
virtual int remotesCount () const
 
virtual int remotesIdOffset () const
 
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...
 

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 295 of file Queue.h.

Member Typedef Documentation

◆ Full

Definition at line 298 of file Queue.h.

◆ ItemTooLarge

Constructor & Destructor Documentation

◆ MultiQueue()

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

Definition at line 347 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 154 of file Queue.cc.

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

◆ clearReaderSignal()

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

◆ 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 342 of file Queue.cc.

References Ipc::FewToFewBiQueue::Owner::Owner().

Referenced by CollapsedForwardingRr::create().

◆ inQueue() [1/2]

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

Definition at line 168 of file Queue.cc.

References Ipc::BaseMultiQueue::inQueue().

◆ inQueue() [2/2]

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

Implements Ipc::BaseMultiQueue.

Definition at line 386 of file Queue.cc.

References oneToOneQueue(), and Ipc::BaseMultiQueue::theLocalProcessId.

◆ inSize()

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

Definition at line 183 of file Queue.h.

◆ localBalance()

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

Definition at line 171 of file Queue.h.

References Ipc::QueueReader::balance.

◆ localRateLimit()

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

Definition at line 177 of file Queue.h.

References Ipc::QueueReader::rateLimit.

◆ localReader() [1/2]

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

Definition at line 184 of file Queue.cc.

References Ipc::BaseMultiQueue::localReader().

◆ localReader() [2/2]

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

Implements Ipc::BaseMultiQueue.

Definition at line 398 of file Queue.cc.

References reader(), and Ipc::BaseMultiQueue::theLocalProcessId.

Referenced by MultiQueue().

◆ oneToOneQueue()

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

Definition at line 367 of file Queue.cc.

References assert, metadata, queues, and validProcessId().

Referenced by inQueue(), and outQueue().

◆ outQueue() [1/2]

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

Definition at line 176 of file Queue.cc.

References Ipc::BaseMultiQueue::outQueue().

◆ outQueue() [2/2]

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

Implements Ipc::BaseMultiQueue.

Definition at line 392 of file Queue.cc.

References oneToOneQueue(), and Ipc::BaseMultiQueue::theLocalProcessId.

◆ outSize()

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

Definition at line 186 of file Queue.h.

◆ peek()

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

Definition at line 461 of file Queue.h.

References i, and Ipc::OneToOneUniQueue::peek().

◆ pop()

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

Definition at line 433 of file Queue.h.

References debugs, HERE(), i, Ipc::OneToOneUniQueue::pop(), and Ipc::OneToOneUniQueue::size().

◆ push()

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

Definition at line 451 of file Queue.h.

References debugs, HERE(), Ipc::OneToOneUniQueue::push(), and Ipc::OneToOneUniQueue::size().

◆ rateLimit()

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

Definition at line 161 of file Queue.cc.

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

◆ reader()

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

Definition at line 378 of file Queue.cc.

References assert, metadata, readers, and validProcessId().

Referenced by localReader(), and remoteReader().

◆ remoteReader() [1/2]

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

Definition at line 192 of file Queue.cc.

References Ipc::BaseMultiQueue::remoteReader().

◆ remoteReader() [2/2]

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

Implements Ipc::BaseMultiQueue.

Definition at line 404 of file Queue.cc.

References reader().

◆ remotesCount()

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

Implements Ipc::BaseMultiQueue.

Definition at line 410 of file Queue.cc.

References metadata.

◆ remotesIdOffset()

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

Implements Ipc::BaseMultiQueue.

Definition at line 416 of file Queue.cc.

References metadata.

◆ validProcessId()

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

Definition at line 360 of file Queue.cc.

References metadata.

Referenced by oneToOneQueue(), and reader().

Member Data Documentation

◆ metadata

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

◆ queues

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

Definition at line 344 of file Queue.h.

Referenced by MultiQueue(), and oneToOneQueue().

◆ readers

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

Definition at line 345 of file Queue.h.

Referenced by MultiQueue(), and reader().

◆ 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