Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
QListProtectedWait< items > Class Template Reference

A BufferQueue that adds the ability to wait on the next buffer. More...

#include <Queue.hxx>

Inheritance diagram for QListProtectedWait< items >:
QList< ITEMS > OSSem

Public Types

typedef QListProtected< items >::Result Result
 Translate the Result type.
 
- Public Types inherited from QList< ITEMS >
typedef ::Result Result
 

Public Member Functions

 QListProtectedWait ()
 Default Constructor.
 
 ~QListProtectedWait ()
 Default destructor.
 
void insert (QMember *item, unsigned index)
 Add an item to the back of the queue.
 
Result next ()
 Get an item from the front of the queue.
 
Result wait ()
 Wait for an item from the front of the queue.
 
void wakeup ()
 Wakeup anyone waiting on the wait queue.
 
- Public Member Functions inherited from QList< ITEMS >
 QList ()
 Default Constructor.
 
 ~QList ()
 Destructor.
 
Atomiclock ()
 
void insert (QMember *item, unsigned index)
 Add an item to the back of the queue.
 
void insert_locked (QMember *item, unsigned index)
 Add an item to the back 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 queue in priority order.
 
Result next_locked ()
 
size_t pending (unsigned index)
 Get the number of pending items in the queue.
 
size_t pending ()
 Get the total number of pending items in all queues in the list.
 
size_t size ()
 
bool empty (unsigned index)
 Test if the queue is empty.
 
bool empty ()
 Test if all the queues are empty.
 
- Public Member Functions inherited from OSSem
 OSSem (unsigned int value=0)
 Initialize a Semaphore.
 
void post ()
 Post (increment) a semaphore.
 
void wait ()
 Wait on (decrement) a semaphore.
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (QListProtectedWait)
 

Detailed Description

template<unsigned items>
class QListProtectedWait< items >

A BufferQueue that adds the ability to wait on the next buffer.

Yes this uses multiple inheritance. The priority of pulling items out of of the list is fixed to look at index 0 first and the highest index last.

Definition at line 809 of file Queue.hxx.

Member Typedef Documentation

◆ Result

template<unsigned items>
typedef QListProtected<items>::Result QListProtectedWait< items >::Result

Translate the Result type.

Definition at line 850 of file Queue.hxx.

Constructor & Destructor Documentation

◆ QListProtectedWait()

template<unsigned items>
QListProtectedWait< items >::QListProtectedWait ( )
inline

Default Constructor.

Definition at line 814 of file Queue.hxx.

◆ ~QListProtectedWait()

template<unsigned items>
QListProtectedWait< items >::~QListProtectedWait ( )
inline

Default destructor.

Definition at line 822 of file Queue.hxx.

Member Function Documentation

◆ insert()

template<unsigned items>
void QListProtectedWait< items >::insert ( QMember item,
unsigned  index 
)
inline

Add an item to the back of the queue.

Parameters
itemitem to add to queue
indexin the list to operate on

Definition at line 830 of file Queue.hxx.

◆ next()

template<unsigned items>
Result QListProtectedWait< items >::next ( )
inline

Get an item from the front of the queue.

Returns
item retrieved from one of the queues

Definition at line 855 of file Queue.hxx.

◆ wait()

template<unsigned items>
Result QListProtectedWait< items >::wait ( )
inline

Wait for an item from the front of the queue.

Returns
item retrieved from queue, else NULL with errno set: EINTR - woken up asynchronously

Definition at line 870 of file Queue.hxx.

◆ wakeup()

template<unsigned items>
void QListProtectedWait< items >::wakeup ( )
inline

Wakeup anyone waiting on the wait queue.

Definition at line 906 of file Queue.hxx.


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