The bliss C++ API
Public Member Functions | List of all members
bliss::KQueue< Type > Class Template Reference

A simple implementation of queues with fixed maximum capacity. More...

#include <kqueue.hh>

Public Member Functions

 KQueue ()
 
void init (const unsigned int N)
 
bool is_empty () const
 
unsigned int size () const
 
void clear ()
 
Type front () const
 
Type pop_front ()
 
void push_front (Type e)
 
Type pop_back ()
 
void push_back (Type e)
 

Detailed Description

template<class Type>
class bliss::KQueue< Type >

A simple implementation of queues with fixed maximum capacity.

Constructor & Destructor Documentation

◆ KQueue()

template<class Type >
bliss::KQueue< Type >::KQueue ( )

Create a new queue with capacity zero. The function init() should be called next.

Member Function Documentation

◆ clear()

template<class Type >
void bliss::KQueue< Type >::clear ( )

Remove all the elements in the queue.

◆ front()

template<class Type >
Type bliss::KQueue< Type >::front ( ) const

Return (but don't remove) the first element in the queue.

◆ init()

template<class Type >
void bliss::KQueue< Type >::init ( const unsigned int  N)

Initialize the queue to have the capacity to hold at most N elements.

◆ is_empty()

template<class Type >
bool bliss::KQueue< Type >::is_empty ( ) const

Is the queue empty?

◆ pop_back()

template<class Type>
Type bliss::KQueue< Type >::pop_back ( )

Remove and return the last element of the queue.

◆ pop_front()

template<class Type >
Type bliss::KQueue< Type >::pop_front ( )

Remove and return the first element of the queue.

◆ push_back()

template<class Type>
void bliss::KQueue< Type >::push_back ( Type  e)

Push the element e in the back of the queue.

◆ push_front()

template<class Type>
void bliss::KQueue< Type >::push_front ( Type  e)

Push the element e in the front of the queue.

◆ size()

template<class Type >
unsigned int bliss::KQueue< Type >::size ( ) const

Return the number of elements in the queue.


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