Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

queue_base Class Reference

The base class for all queues. More...

#include <queue.h>

Inherited by iqueue< T >.

Public Types

typedef size_t size_type
 The type used for determining the size of queue.

Public Member Functions

size_type size () const
 Returns the current number of items in the queue.
size_type max_size () const
 Returns the maximum number of items that can be queued.
bool empty () const
 Checks to see if the queue is empty.
bool full () const
 Checks to see if the queue is full.
size_t available () const
 Returns the remaining capacity.

Protected Member Functions

 queue_base (size_type max_size_)
 The constructor that is called from derived classes.
void add_in ()
 Increments (and wraps) the 'in' index value to record a queue addition.
void del_out ()
 Decrements (and wraps) the 'out' index value to record a queue deletion.

Protected Attributes

size_type in
 Where to input new data.
size_type out
 Where to get the oldest data.
size_type current_size
 The number of items in the queue.
const size_type CAPACITY
 The maximum number of items in the queue.
etl::debug_count construct_count
 For internal debugging purposes.

Detailed Description

The base class for all queues.

Definition at line 105 of file queue.h.


Member Typedef Documentation

typedef size_t size_type

The type used for determining the size of queue.

Reimplemented in iqueue< T >.

Definition at line 109 of file queue.h.


Constructor & Destructor Documentation

queue_base ( size_type  max_size_ ) [protected]

The constructor that is called from derived classes.

Definition at line 159 of file queue.h.


Member Function Documentation

void add_in (  ) [protected]

Increments (and wraps) the 'in' index value to record a queue addition.

Definition at line 170 of file queue.h.

size_t available (  ) const

Returns the remaining capacity.

Returns:
The remaining capacity.

Definition at line 149 of file queue.h.

void del_out (  ) [protected]

Decrements (and wraps) the 'out' index value to record a queue deletion.

Definition at line 184 of file queue.h.

bool empty (  ) const

Checks to see if the queue is empty.

Returns:
true if the queue is empty, otherwise false

Definition at line 131 of file queue.h.

bool full (  ) const

Checks to see if the queue is full.

Returns:
true if the queue is full, otherwise false

Definition at line 140 of file queue.h.

size_type max_size (  ) const

Returns the maximum number of items that can be queued.

Definition at line 122 of file queue.h.

size_type size (  ) const

Returns the current number of items in the queue.

Definition at line 114 of file queue.h.


Field Documentation

const size_type CAPACITY [protected]

The maximum number of items in the queue.

Definition at line 197 of file queue.h.

For internal debugging purposes.

Definition at line 198 of file queue.h.

size_type current_size [protected]

The number of items in the queue.

Definition at line 196 of file queue.h.

size_type in [protected]

Where to input new data.

Definition at line 194 of file queue.h.

size_type out [protected]

Where to get the oldest data.

Definition at line 195 of file queue.h.