Main Page | Class List | File List | Class Members

Rha::SortedQueue< T > Class Template Reference

Priority queue implementation class. More...

#include <SortedQueue.hpp>

List of all members.

Public Types

typedef SortedQueue< T > OfType
typedef T Task
typedef T value_type

Public Member Functions

 SortedQueue ()
 Constructs SortedQueue object.

 ~SortedQueue ()
 Destructs instance of SortedQueue object.

void setUp ()
 Initializes queuing environemnt.

bool empty () const
 Returns true if queue does not have any tasks.

bool full () const
 Always returns false.

void flush ()
 Clears the queue.

Task & front ()
 Returns reference to the top (highest priority) task in the queue which must be non-empty.

const Task & front () const
void push (const Task &val)
 Pushes a task onto the queue for pickup by Executor.

void pop ()
 Removes a top (highest priority) task from the queue.


Protected Types

typedef std::deque< Task > Container

Protected Attributes

Container M_container


Detailed Description

template<class T>
class Rha::SortedQueue< T >

Priority queue implementation class.

Use SortedQueue class to create objects that will serve as priority task queues. Scheduler uses an instance of a queue object to buffer arriving tasks. SortedQueue requires that queued tasks be less-than comparable.


Constructor & Destructor Documentation

template<class T>
Rha::SortedQueue< T >::~SortedQueue  ) 
 

Destructs instance of SortedQueue object.

Attention:
Declared as non-virtual.


Member Function Documentation

template<class T>
bool Rha::SortedQueue< T >::empty  )  const [inline]
 

Returns true if queue does not have any tasks.

Otherwise returns false.

Exceptions:
doesn't throw

template<class T>
void Rha::SortedQueue< T >::flush  )  [inline]
 

Clears the queue.

Exceptions:
doesn't throw

template<class T>
Rha::SortedQueue< T >::Task & Rha::SortedQueue< T >::front  )  [inline]
 

Returns reference to the top (highest priority) task in the queue which must be non-empty.

Exceptions:
doesn't throw

template<class T>
bool Rha::SortedQueue< T >::full  )  const [inline]
 

Always returns false.

Exceptions:
doesn't throw

template<class T>
void Rha::SortedQueue< T >::pop  )  [inline]
 

Removes a top (highest priority) task from the queue.

Exceptions:
doesn't throw

template<class T>
void Rha::SortedQueue< T >::push const Task &  val  )  [inline]
 

Pushes a task onto the queue for pickup by Executor.

Exceptions:
doesn't throw

template<class T>
void Rha::SortedQueue< T >::setUp  )  [inline]
 

Initializes queuing environemnt.

Called just before Scheduler begins queing tasks.


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