Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
QAsync Class Reference

Asynchronous specialization of Q. More...

#include <Queue.hxx>

Inheritance diagram for QAsync:
TypedQAsync< openlcb::DatagramClient > TypedQAsync< openlcb::StreamSender > AsyncMutex AsyncNotifiableBlock TypedQAsync< T >

Public Member Functions

 QAsync ()
 Default Constructor.
 
 ~QAsync ()
 Default destructor.
 
void insert (QMember *item, unsigned index=0)
 Add an item to the back of the queue.
 
void next_async (Executable *flow)
 Get an item from the front of the queue.
 
QMembernext (unsigned index)
 Get an item from the front of the queue.
 
Result next ()
 Get an item from the front of the queue.
 
Result next_locked ()
 Get an item from the front of the queue.
 
size_t pending (unsigned index)
 Get the number of pending items in the queue.
 
size_t pending ()
 Get the number of pending items in the queue.
 
bool empty (unsigned index)
 Test if the queue is empty.
 
bool empty ()
 Test if the queue is empty.
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (QAsync)
 

Private Attributes

bool waiting
 true if someone is waiting for an insertion
 
Q impl_
 Implementation helper.
 

Detailed Description

Asynchronous specialization of Q.

Definition at line 253 of file Queue.hxx.

Constructor & Destructor Documentation

◆ QAsync()

QAsync::QAsync ( )
inline

Default Constructor.

Definition at line 258 of file Queue.hxx.

◆ ~QAsync()

QAsync::~QAsync ( )
inline

Default destructor.

Definition at line 265 of file Queue.hxx.

Member Function Documentation

◆ empty() [1/2]

bool QAsync::empty ( )
inline

Test if the queue is empty.

Returns
true if empty, else false

Definition at line 388 of file Queue.hxx.

◆ empty() [2/2]

bool QAsync::empty ( unsigned  index)
inline

Test if the queue is empty.

Parameters
indexin the list to operate on
Returns
true if empty, else false

Definition at line 380 of file Queue.hxx.

◆ insert()

void QAsync::insert ( QMember item,
unsigned  index = 0 
)
inline

Add an item to the back of the queue.

Parameters
itemto add to queue
indexunused parameter

Definition at line 273 of file Queue.hxx.

◆ next() [1/2]

Result QAsync::next ( )
inline

Get an item from the front of the queue.

Returns
Result structure with item retrieved from queue, NULL if no item available

Definition at line 343 of file Queue.hxx.

◆ next() [2/2]

QMember * QAsync::next ( unsigned  index)
inline

Get an item from the front of the queue.

Parameters
indexin the list to operate on
Returns
item retrieved from queue, NULL if no item available

Definition at line 334 of file Queue.hxx.

◆ next_async()

void QAsync::next_async ( Executable flow)
inline

Get an item from the front of the queue.

Parameters
flowExecutable that will wait on the item
Returns
item retrieved from queue, NULL if no item available

Definition at line 305 of file Queue.hxx.

◆ next_locked()

Result QAsync::next_locked ( )
inline

Get an item from the front of the queue.

Caller must hold lock().

Returns
Result structure with item retrieved from queue, NULL if no item available

Definition at line 353 of file Queue.hxx.

◆ pending() [1/2]

size_t QAsync::pending ( )
inline

Get the number of pending items in the queue.

Returns
number of pending items in the queue

Definition at line 370 of file Queue.hxx.

◆ pending() [2/2]

size_t QAsync::pending ( unsigned  index)
inline

Get the number of pending items in the queue.

Parameters
indexin the list to operate on
Returns
number of pending items in the queue

Definition at line 362 of file Queue.hxx.

Member Data Documentation

◆ impl_

Q QAsync::impl_
private

Implementation helper.

Definition at line 399 of file Queue.hxx.

◆ waiting

bool QAsync::waiting
private

true if someone is waiting for an insertion

Definition at line 396 of file Queue.hxx.


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