queue Class Template Reference

#include <queue.hpp>

Inheritance diagram for queue:

Inheritance graph
[legend]
Collaboration diagram for queue:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<typename T>
class gsgl::data::queue< T >

A queue is a FIFO structure.

Definition at line 48 of file queue.hpp.


Public Member Functions

virtual bool contains_index (const I &) const =0
T & front ()
 Returns the item at the head of the queue.
const T & front () const
 Returns the item at the head of the queue.
T & get_head ()
const T & get_head () const
T & get_tail ()
const T & get_tail () const
virtual bool is_empty () const
 Returns true if the collection is empty.
virtual T & item (const I &index)=0
virtual const T & item (const I &index) const =0
queueoperator= (const queue &q)
bool operator== (const list &) const
T & operator[] (const I &index)
const T & operator[] (const I &index) const
void pop ()
 Removes the front item from the queue.
void push (const T &a)
 Adds an item on the back of the queue.
 queue (const queue &q)
 queue ()
virtual ~queue ()
Other Useful Functions
virtual void append (const iterable< T, IBase > &)
 Append all members of a collection to this one.
virtual iterator find_value (const T &)
virtual const_iterator find_value (const T &) const
 A generic find function that iterates over the collection to find a particular value.
Iterable Implementation
Adds a data item to the end of the list.

virtual void append (const T &)
 Add an item to the end of the collection.
virtual void insert (const iterator &, const T &)
virtual void remove (const iterator &)
 Remove the item specified by the iterator.
Countable Implementation
virtual void clear ()
 Clears the contents of the collection.
virtual gsgl::index_t size () const
 A generic count function that iterates over the collection.
Indexable Implementation
virtual bool contains_index (const gsgl::index_t &) const
virtual T & item (const gsgl::index_t &)
virtual const T & item (const gsgl::index_t &) const
Iterators
iterator iter ()
const_iterator iter () const

Protected Attributes

gsgl::index_t count
list_nodehead
list_nodetail

Constructor & Destructor Documentation

queue (  )  [inline]

Definition at line 72 of file queue.hpp.

queue ( const queue< T > &  q  )  [inline]

Definition at line 75 of file queue.hpp.

~queue (  )  [inline, virtual]

Definition at line 86 of file queue.hpp.


Member Function Documentation

void append ( const iterable< T, IBase > &  a  )  [inline, virtual, inherited]

Append all members of a collection to this one.

Definition at line 145 of file iterable.hpp.

void append ( const T &   )  [inline, virtual, inherited]

void clear (  )  [inline, virtual, inherited]

Clears the contents of the collection.

Implements countable.

Definition at line 217 of file list.hpp.

References list::count, list::head, list::list_node::next, and list::tail.

Referenced by application::load_scenery(), queue::operator=(), list::operator=(), application::~application(), and list::~list().

virtual bool contains_index ( const I &   )  const [pure virtual, inherited]

Implemented in dictionary.

bool contains_index ( const gsgl::index_t index  )  const [inline, virtual, inherited]

Definition at line 235 of file list.hpp.

References list::count.

iterable< T, IBase >::iterator find_value ( const T &  item  )  [inline, virtual, inherited]

Definition at line 168 of file iterable.hpp.

References iterable::iterator::is_valid().

iterable< T, IBase >::const_iterator find_value ( const T &  item  )  const [inline, virtual, inherited]

A generic find function that iterates over the collection to find a particular value.

Note:
Not efficient; should be overridden if possible.

Definition at line 153 of file iterable.hpp.

References iterable::const_iterator::is_valid().

Referenced by gsgl::data::global_unregister_resource_aux().

T & front (  )  [inline]

Returns the item at the head of the queue.

Definition at line 95 of file queue.hpp.

References list::head, and list::list_node::item.

const T & front (  )  const [inline]

Returns the item at the head of the queue.

Definition at line 90 of file queue.hpp.

References list::head, and list::list_node::item.

T & get_head (  )  [inline, inherited]

Definition at line 161 of file list.hpp.

References list::head, and list::list_node::item.

const T & get_head (  )  const [inline, inherited]

Definition at line 151 of file list.hpp.

References list::head, and list::list_node::item.

T & get_tail (  )  [inline, inherited]

Definition at line 181 of file list.hpp.

References list::list_node::item, and list::tail.

const T & get_tail (  )  const [inline, inherited]

Definition at line 171 of file list.hpp.

References list::list_node::item, and list::tail.

void insert ( const iterator i,
const T &  item 
) [inline, virtual, inherited]

Todo:
Implement list::insert().

Implements iterable.

Definition at line 288 of file list.hpp.

References list::append(), list::count, and list::head.

virtual bool is_empty (  )  const [inline, virtual, inherited]

virtual T& item ( const I &  index  )  [pure virtual, inherited]

Implemented in dictionary.

virtual const T& item ( const I &  index  )  const [pure virtual, inherited]

T & item ( const gsgl::index_t index  )  [inline, virtual, inherited]

Definition at line 256 of file list.hpp.

References list::head, list::list_node::item, and list::list_node::next.

const T & item ( const gsgl::index_t index  )  const [inline, virtual, inherited]

Definition at line 242 of file list.hpp.

References list::head, list::list_node::item, and list::list_node::next.

iterator iter (  )  [inline, inherited]

Returns:
An iterator pointing to the first item in the collection.

Definition at line 101 of file iterable.hpp.

const_iterator iter (  )  const [inline, inherited]

queue< T > & operator= ( const queue< T > &  q  )  [inline]

Definition at line 78 of file queue.hpp.

References list::clear(), list::head, and list::list_node::next.

bool operator== ( const list< T > &  l  )  const [inline, inherited]

Definition at line 191 of file list.hpp.

References iterable::iter().

T& operator[] ( const I &  index  )  [inline, inherited]

Definition at line 58 of file indexable.hpp.

const T& operator[] ( const I &  index  )  const [inline, inherited]

Definition at line 57 of file indexable.hpp.

void pop (  )  [inline]

Removes the front item from the queue.

Definition at line 105 of file queue.hpp.

References list::head, and list::list_node::next.

void push ( const T &  a  )  [inline]

Adds an item on the back of the queue.

Definition at line 100 of file queue.hpp.

void remove ( const iterator  )  [inline, virtual, inherited]

Remove the item specified by the iterator.

Implements iterable.

Definition at line 309 of file list.hpp.

References list::count, list::head, and list::tail.

Referenced by gsgl::data::global_unregister_resource_aux().

gsgl::index_t size (  )  const [inline, virtual, inherited]

A generic count function that iterates over the collection.

Note:
Not very efficient; should be overridden if possible.

Reimplemented from iterable.

Definition at line 210 of file list.hpp.

References list::count.

Referenced by mesh_file::load_obj_file(), and application::load_scenery().


Member Data Documentation

gsgl::index_t count [protected, inherited]

list_node* head [protected, inherited]

list_node * tail [protected, inherited]

Definition at line 73 of file list.hpp.

Referenced by list::append(), list::clear(), list::get_tail(), and list::remove().


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

Generated on Sat Mar 1 13:50:06 2008 for Periapsis Project by  doxygen 1.5.5