#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
< OneToOneUniQueues
queues
 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

Definition at line 298 of file Queue.h.

Constructor & Destructor Documentation

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

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

Definition at line 154 of file Queue.cc.

References Ipc::QueueReader::balance.

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

Definition at line 140 of file Queue.cc.

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

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.

Referenced by CollapsedForwardingRr::create().

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

Definition at line 168 of file Queue.cc.

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

Implements Ipc::BaseMultiQueue.

Definition at line 386 of file Queue.cc.

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

Definition at line 183 of file Queue.h.

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

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

Definition at line 171 of file Queue.h.

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

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

Definition at line 177 of file Queue.h.

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

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

Definition at line 184 of file Queue.cc.

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

Implements Ipc::BaseMultiQueue.

Definition at line 398 of file Queue.cc.

Referenced by MultiQueue().

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

Definition at line 367 of file Queue.cc.

References assert.

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

Definition at line 176 of file Queue.cc.

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

Implements Ipc::BaseMultiQueue.

Definition at line 392 of file Queue.cc.

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

Definition at line 186 of file Queue.h.

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

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

Definition at line 161 of file Queue.cc.

References Ipc::QueueReader::rateLimit.

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

Definition at line 378 of file Queue.cc.

References assert.

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

Definition at line 192 of file Queue.cc.

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

Implements Ipc::BaseMultiQueue.

Definition at line 404 of file Queue.cc.

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

Implements Ipc::BaseMultiQueue.

Definition at line 410 of file Queue.cc.

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

Implements Ipc::BaseMultiQueue.

Definition at line 416 of file Queue.cc.

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

Definition at line 360 of file Queue.cc.

Member Data Documentation

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

Definition at line 343 of file Queue.h.

Referenced by MultiQueue().

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

Definition at line 344 of file Queue.h.

Referenced by MultiQueue().

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

Definition at line 345 of file Queue.h.

Referenced by MultiQueue().

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