Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

look::LookTLList Class Template Reference

A double-linked list. More...

#include <t_list.h>

List of all members.

Public Types

typedef iterator const_iterator
typedef reverse_iterator const_reverse_iterator
typedef tBody value_type

Public Methods

reverse_iterator rbegin (void) const
 Like std::list::rbegin().

reverse_iterator rend (void) const
 Like std::list::rend().

iterator begin (void) const
 Like std::list::begin().

iterator end (void) const
 Like std::list::end().

iterator insert (iterator anIt, const tBody &theThing)
 Like std::list::insert(). More...

iterator erase (iterator anIt)
 Like std::list::erase().

iterator erase (iterator first, iterator last)
 Like std::list::erase().

void clear (void)
 Like std::list::clear().

 LookTLList ()
 Constructor.

 ~LookTLList ()
 Destructor.

void push_back (const tBody &a)
 Like std::list::push_back().

void push_front (const tBody &a)
 Like std::list::push_front().

void pop_back (void)
 Like std::list::pop_back().

void pop_front (void)
 Like std::list::pop_front().

tBody& back (void)
 Like std::list::back().

tBody& front (void)
 Like std::list::front().

void pushIfAbsent (const tBody &a)
 push_back() if absent. More...

tBody& at (size_t i) const
 Almost like std::deque::at(). More...

size_t size (void) const
 Like std::vector::size().

tBody& operator[] (size_t i) const
 Same as at().

void assign (const_iterator first, const_iterator last)
 Same as std::list::assign().

bool empty (void)
 Same as std::list::empty().


Protected Methods

void append (const tBody &a)
void prepend (const tBody &a)
void InvalidateMemoryIterator (void)
void MoveMemoryIteratorToItemAt (size_t i) const

Protected Attributes

ListItem* itsFirstItem
ListItem* itsLastItem
ListItem* itsMemoryItem
size_t itsMemoryItemNumber
size_t itsNumberOfItems

Friends

class  iterator
class  reverse_iterator


Detailed Description

template<class tBody> class look::LookTLList

A double-linked list.

This is quite like std::list. It originally existed because some compilers we used didn't have the STL.

It also has access by index and size() is constant time. The former uses a cached internal iterator, and the latter is because it stores the number of elements.


Member Function Documentation

template<class tBody>
tBody & look::LookTLList<tBody>::at ( size_t i ) const [inline]
 

Almost like std::deque::at().

If i is out of range (too big or negative) the last item obtained by at() is returned, or the first item in the list if the memory iterator was invalidated. (The first item may of course not exist).

Ie results are undefined if you try to access out of range.

template<class tBody>
iterator look::LookTLList<tBody>::insert ( iterator anIt,
const tBody & theThing ) [inline]
 

Like std::list::insert().

Insert before anIt.

template<class tBody>
void look::LookTLList<tBody>::pushIfAbsent ( const tBody & a ) [inline]
 

push_back() if absent.

This is one of the differences from the STL.

It only inserts if there is no matching (using ==) item.


The documentation for this class was generated from the following file:
Generated at Thu Jan 17 12:53:09 2002 for liblookdb by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001