#include <Queue.h>

Collaboration diagram for Ipc::QueueReader:

Public Types

typedef std::atomic< intRate
 pop()s per second More...
typedef std::atomic< intAtomicSignedMsec
typedef AtomicSignedMsec Balance

Public Member Functions

 QueueReader ()
bool blocked () const
 whether the reader is waiting for a notification signal More...
void block ()
 marks the reader as blocked, waiting for a notification signal More...
void unblock ()
 removes the block() effects More...
bool raiseSignal ()
void clearSignal ()
 marks sent reader notification as received (also removes pop blocking) More...

Public Attributes

Rate rateLimit
 pop()s per second limit if positive More...
Balance balance
 how far ahead the reader is compared to a perfect read/sec event rate More...
const InstanceId< QueueReaderid
 unique ID for debugging which reader is used (works across processes) More...

Private Attributes

std::atomic< bool > popBlocked
 whether the reader is blocked on pop() More...
std::atomic< bool > popSignal
 whether writer has sent and reader has not received notification More...

Detailed Description

State of the reading end of a queue (i.e., of the code calling pop()). Multiple queues attached to one reader share this state.

Definition at line 28 of file Queue.h.

Member Typedef Documentation

◆ AtomicSignedMsec

Definition at line 58 of file Queue.h.

◆ Balance

Definition at line 59 of file Queue.h.

◆ Rate

typedef std::atomic<int> Ipc::QueueReader::Rate

Definition at line 54 of file Queue.h.

Constructor & Destructor Documentation

◆ QueueReader()

Ipc::QueueReader::QueueReader ( )

Definition at line 47 of file Queue.cc.

References debugs, and HERE().

Member Function Documentation

◆ block()

void Ipc::QueueReader::block ( )

Definition at line 37 of file Queue.h.

References popBlocked.

Referenced by Ipc::OneToOneUniQueue::pop().

◆ blocked()

bool Ipc::QueueReader::blocked ( ) const

Definition at line 34 of file Queue.h.

References popBlocked.

Referenced by raiseSignal().

◆ clearSignal()

void Ipc::QueueReader::clearSignal ( )

Definition at line 47 of file Queue.h.

References popSignal, and unblock().

Referenced by Ipc::BaseMultiQueue::clearReaderSignal().

◆ raiseSignal()

bool Ipc::QueueReader::raiseSignal ( )

if reader is blocked and not notified, marks the notification signal as sent and not received, returning true; otherwise, returns false

Definition at line 44 of file Queue.h.

References blocked(), and popSignal.

Referenced by Ipc::OneToOneUniQueue::push().

◆ unblock()

void Ipc::QueueReader::unblock ( )

Definition at line 40 of file Queue.h.

References popBlocked.

Referenced by clearSignal(), and Ipc::OneToOneUniQueue::pop().

Member Data Documentation

◆ balance

Balance Ipc::QueueReader::balance

Definition at line 61 of file Queue.h.

Referenced by Ipc::BaseMultiQueue::balance(), and Ipc::BaseMultiQueue::localBalance().

◆ id

const InstanceId<QueueReader> Ipc::QueueReader::id

Definition at line 64 of file Queue.h.

Referenced by Ipc::BaseMultiQueue::clearReaderSignal().

◆ popBlocked

std::atomic<bool> Ipc::QueueReader::popBlocked

Definition at line 50 of file Queue.h.

Referenced by block(), blocked(), and unblock().

◆ popSignal

std::atomic<bool> Ipc::QueueReader::popSignal

Definition at line 51 of file Queue.h.

Referenced by clearSignal(), and raiseSignal().

◆ rateLimit

Rate Ipc::QueueReader::rateLimit

Definition at line 55 of file Queue.h.

Referenced by Ipc::BaseMultiQueue::localRateLimit(), and Ipc::BaseMultiQueue::rateLimit().

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






Web Site Translations