AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType > Class Template Reference

#include <BaseQueue.h>

List of all members.

Public Member Functions

void Clear ()
 Clears this queue.
 BaseQueue ()
 Constructor.
bool IsEmpty (void)
 Returns whether the queue is empty or not.
bool IsFull (void)
 Returns whether the queue is full or not.
DataType & Front ()
 Returns reference of first item.
DataType & Back ()
 Returns reference of last item.

Protected Attributes

ListType data
volatile SizeType write_pointer
volatile SizeType read_pointer
struct {
   volatile uint8_t   is_full: 1
}; 


Detailed Description

template<typename DataType, typename SizeType, typename ListType>
class AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType >

Definition at line 52 of file BaseQueue.h.


Constructor & Destructor Documentation

template<typename DataType, typename SizeType, typename ListType>
AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType >::BaseQueue (  )  [inline]

Constructor.

Definition at line 79 of file BaseQueue.h.

00080                 {
00081                         Clear();                        
00082                 }


Member Function Documentation

template<typename DataType, typename SizeType, typename ListType>
void AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType >::Clear (  )  [inline]

Clears this queue.

Definition at line 69 of file BaseQueue.h.

00070                 {
00071                         this->write_pointer     = 0;
00072                         this->read_pointer  = 0;
00073                         this->is_full           = 0;
00074                 }

template<typename DataType, typename SizeType, typename ListType>
bool AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType >::IsEmpty ( void   )  [inline]

Returns whether the queue is empty or not.

Definition at line 87 of file BaseQueue.h.

00088                 {
00089                         return ((this->read_pointer == this->write_pointer) && (this->is_full == 0));
00090                 }

template<typename DataType, typename SizeType, typename ListType>
bool AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType >::IsFull ( void   )  [inline]

Returns whether the queue is full or not.

Definition at line 95 of file BaseQueue.h.

00096                 {
00097                         return this->is_full;
00098                 }

template<typename DataType, typename SizeType, typename ListType>
DataType& AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType >::Front (  )  [inline]

Returns reference of first item.

NB! For speed purposes does not check constraints!

Definition at line 104 of file BaseQueue.h.

00105                 {
00106                         return this->data[this->read_pointer];
00107                 }

template<typename DataType, typename SizeType, typename ListType>
DataType& AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType >::Back (  )  [inline]

Returns reference of last item.

NB! For speed purposes does not check constraints!

Definition at line 113 of file BaseQueue.h.

00114                 {
00115                         return this->data[this->write_pointer];
00116                 }


Member Data Documentation

template<typename DataType, typename SizeType, typename ListType>
ListType AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType >::data [protected]

Definition at line 55 of file BaseQueue.h.

template<typename DataType, typename SizeType, typename ListType>
volatile SizeType AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType >::write_pointer [protected]

Definition at line 56 of file BaseQueue.h.

template<typename DataType, typename SizeType, typename ListType>
volatile SizeType AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType >::read_pointer [protected]

Definition at line 57 of file BaseQueue.h.

template<typename DataType, typename SizeType, typename ListType>
volatile uint8_t AVRCpp::Collection::BaseQueue< DataType, SizeType, ListType >::is_full

Definition at line 61 of file BaseQueue.h.

struct { ... } [protected]


The documentation for this class was generated from the following file:
Generated on Sat Sep 15 23:41:47 2007 for AVR C++ Lib (common) by  doxygen 1.5.2
SourceForge.net Logo MTÜ TTÜ Robotiklubi