#include <Queue.h>

Inheritance diagram for Ipc::FewToFewBiQueue:
Collaboration diagram for Ipc::FewToFewBiQueue:

Classes

struct  Metadata
 Shared metadata for FewToFewBiQueue. More...
 
class  Owner
 

Public Types

enum  Group {
  groupA = 0,
  groupB = 1
}
 
typedef OneToOneUniQueue::Full Full
 
typedef OneToOneUniQueue::ItemTooLarge ItemTooLarge
 

Public Member Functions

 FewToFewBiQueue (const String &id, const Group aLocalGroup, const int aLocalProcessId)
 
template<class Value >
bool findOldest (const int remoteProcessId, Value &value) const
 
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 groupASize, const int groupAIdOffset, const int groupBSize, const int groupBIdOffset, const unsigned int maxItemSize, const int capacity)
 
static int MaxItemsCount (const int groupASize, const int groupBSize, const int capacity)
 maximum number of items in the queue More...
 

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 processId) 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 Group group, const int processId) const
 
int oneToOneQueueIndex (const Group fromGroup, const int fromProcessId, const Group toGroup, const int toProcessId) const
 
const OneToOneUniQueueoneToOneQueue (const Group fromGroup, const int fromProcessId, const Group toGroup, const int toProcessId) const
 
int readerIndex (const Group group, const int processId) const
 
Group localGroup () const
 
Group remoteGroup () 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...
 
const Group theLocalGroup
 group of this queue More...
 

Detailed Description

Lockless fixed-capacity bidirectional queue for a limited number processes. Allows communication between two groups of processes: any process in one group may send data to and receive from any process in another group, but processes in the same group can not communicate. Process in each group has a unique integer ID in [groupIdOffset, groupIdOffset + groupSize) range.

Definition at line 221 of file Queue.h.

Member Typedef Documentation

◆ Full

Definition at line 224 of file Queue.h.

◆ ItemTooLarge

Member Enumeration Documentation

◆ Group

Enumerator
groupA 
groupB 

Definition at line 255 of file Queue.h.

Constructor & Destructor Documentation

◆ FewToFewBiQueue()

Ipc::FewToFewBiQueue::FewToFewBiQueue ( const String id,
const Group  aLocalGroup,
const int  aLocalProcessId 
)

Definition at line 207 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

◆ findOldest()

template<class Value >
bool Ipc::FewToFewBiQueue::findOldest ( const int  remoteProcessId,
Value &  value 
) const

finds the oldest item in incoming and outgoing queues between us and the given remote process

Definition at line 481 of file Queue.h.

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

◆ Init()

Ipc::FewToFewBiQueue::Owner * Ipc::FewToFewBiQueue::Init ( const String id,
const int  groupASize,
const int  groupAIdOffset,
const int  groupBSize,
const int  groupBIdOffset,
const unsigned int  maxItemSize,
const int  capacity 
)
static

Definition at line 202 of file Queue.cc.

Referenced by IpcIoRr::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::FewToFewBiQueue::inQueue ( const int  remoteProcessId) const
protectedvirtual

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

◆ localGroup()

Group Ipc::FewToFewBiQueue::localGroup ( ) const
inlineprivate

Definition at line 278 of file Queue.h.

◆ 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::FewToFewBiQueue::localReader ( ) const
protectedvirtual

Implements Ipc::BaseMultiQueue.

Definition at line 292 of file Queue.cc.

References readerIndex(), readers, theLocalGroup, and Ipc::BaseMultiQueue::theLocalProcessId.

Referenced by FewToFewBiQueue().

◆ MaxItemsCount()

int Ipc::FewToFewBiQueue::MaxItemsCount ( const int  groupASize,
const int  groupBSize,
const int  capacity 
)
static

Definition at line 221 of file Queue.cc.

Referenced by IpcIoRr::claimMemoryNeeds().

◆ oneToOneQueue()

const Ipc::OneToOneUniQueue & Ipc::FewToFewBiQueue::oneToOneQueue ( const Group  fromGroup,
const int  fromProcessId,
const Group  toGroup,
const int  toProcessId 
) const
private

Definition at line 263 of file Queue.cc.

References oneToOneQueueIndex(), and queues.

Referenced by inQueue(), and outQueue().

◆ oneToOneQueueIndex()

int Ipc::FewToFewBiQueue::oneToOneQueueIndex ( const Group  fromGroup,
const int  fromProcessId,
const Group  toGroup,
const int  toProcessId 
) const
private

Definition at line 241 of file Queue.cc.

References assert, groupA, metadata, Must, and validProcessId().

Referenced by oneToOneQueue().

◆ 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::FewToFewBiQueue::outQueue ( const int  remoteProcessId) const
protectedvirtual

◆ 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().

◆ readerIndex()

int Ipc::FewToFewBiQueue::readerIndex ( const Group  group,
const int  processId 
) const
private

Definition at line 283 of file Queue.cc.

References groupA, metadata, Must, and validProcessId().

Referenced by localReader(), and remoteReader().

◆ remoteGroup()

Group Ipc::FewToFewBiQueue::remoteGroup ( ) const
inlineprivate

Definition at line 279 of file Queue.h.

Referenced by inQueue(), outQueue(), 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::FewToFewBiQueue::remoteReader ( const int  processId) const
protectedvirtual

Implements Ipc::BaseMultiQueue.

Definition at line 298 of file Queue.cc.

References readerIndex(), readers, and remoteGroup().

◆ remotesCount()

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

Implements Ipc::BaseMultiQueue.

Definition at line 304 of file Queue.cc.

References groupA, metadata, and theLocalGroup.

◆ remotesIdOffset()

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

Implements Ipc::BaseMultiQueue.

Definition at line 311 of file Queue.cc.

References groupA, metadata, and theLocalGroup.

◆ validProcessId()

bool Ipc::FewToFewBiQueue::validProcessId ( const Group  group,
const int  processId 
) const
private

Definition at line 227 of file Queue.cc.

References groupA, groupB, and metadata.

Referenced by oneToOneQueueIndex(), and readerIndex().

Member Data Documentation

◆ metadata

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

◆ queues

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

Definition at line 283 of file Queue.h.

Referenced by FewToFewBiQueue(), and oneToOneQueue().

◆ readers

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

Definition at line 284 of file Queue.h.

Referenced by FewToFewBiQueue(), localReader(), and remoteReader().

◆ theLocalGroup

const Group Ipc::FewToFewBiQueue::theLocalGroup
private

Definition at line 286 of file Queue.h.

Referenced by inQueue(), localReader(), outQueue(), remotesCount(), and remotesIdOffset().

◆ 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