OE_LIST< _UserType > Class Template Reference

#include <common.h>

Inheritance diagram for OE_LIST< _UserType >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<typename _UserType>
class OE_LIST< _UserType >

Generic linked list implementation.

Definition at line 16 of file common.h.

Public Member Functions

 OE_LIST ()
 Construct new empty linked list.
 ~OE_LIST ()
 Destroy the linked list and all elements contained therein.
iterator get_first ()
 Returns iterator to first element of the list.
iterator get_last ()
 Returns iterator to last element of the list.
void insert_before (iterator pos, const _UserType &data)
 Insert new element before given position in the list.
void insert_after (iterator pos, const _UserType &data)
 Insert new element after given position in the list.
void prepend (const _UserType &data)
 Insert before first element of the list.
void append (const _UserType &data)
 Insert after last element of the list.
void delete_first ()
 Delete first element from the list.
void delete_last ()
 Delete last element from the list.
void clear ()
 Clear the list: delete all elements.
void copy_from (OE_LIST *src)
 // NOTE ON THIS FUNCTION: Since the data this LL deals in is void *'s, it can only copy the entries and their void * pointers - NOT what the void * pointers point to! Old contents of the list are lost.
uint32 num_entries ()
 Return number of entries in this list.
void seek_entry (uint32 num)
 Seek to element in list given by it's ordinal number in list.
_UserType & get_entry (uint32 num)
_UserType & get_cur ()
 Retrieve user pointer in the CURRENT element.
uint32 is_last ()
 Checks if the current entry is the last one.

Classes

class  iterator
 Iterator over OE_LIST. More...


Constructor & Destructor Documentation

template<typename _UserType>
OE_LIST< _UserType >::OE_LIST (  )  [inline]

Construct new empty linked list.

Definition at line 167 of file common.h.

template<typename _UserType>
OE_LIST< _UserType >::~OE_LIST (  )  [inline]

Destroy the linked list and all elements contained therein.

Definition at line 173 of file common.h.


Member Function Documentation

template<typename _UserType>
iterator OE_LIST< _UserType >::get_first (  )  [inline]

Returns iterator to first element of the list.

Note:
If the list is empty - will return invalid iterator.

Definition at line 181 of file common.h.

template<typename _UserType>
iterator OE_LIST< _UserType >::get_last (  )  [inline]

Returns iterator to last element of the list.

Note:
If the list is empty - will return "invalid" iterator.

Definition at line 189 of file common.h.

template<typename _UserType>
void OE_LIST< _UserType >::insert_before ( iterator  pos,
const _UserType &  data 
) [inline]

Insert new element before given position in the list.

Note:
This can also be used to insert new element before beginning of the list by passing get_first() as a "pos" parameter.

It is forbidden to call this with pos being "invalid".

Definition at line 199 of file common.h.

template<typename _UserType>
void OE_LIST< _UserType >::insert_after ( iterator  pos,
const _UserType &  data 
) [inline]

Insert new element after given position in the list.

Note:
This can also be used to insert new element after end of the list by passing get_last() as a "pos" parameter.

It is forbidden to call this with pos being "invalid".

Definition at line 210 of file common.h.

template<typename _UserType>
void OE_LIST< _UserType >::prepend ( const _UserType &  data  )  [inline]

Insert before first element of the list.

Note:
This is just a convenience function, since same effect can be achieved by calling list.insert_before(list.get_first());

Definition at line 220 of file common.h.

Referenced by OE_LAYER_1::test_ll().

template<typename _UserType>
void OE_LIST< _UserType >::append ( const _UserType &  data  )  [inline]

Insert after last element of the list.

Note:
This is just a convenience function, since same effect can be achieved by calling list.insert_after(list.get_last());

Definition at line 229 of file common.h.

Referenced by OE_LAYER_2::pass_message(), and OE_LAYER_1::test_ll().

template<typename _UserType>
void OE_LIST< _UserType >::delete_first (  ) 

Delete first element from the list.

template<typename _UserType>
void OE_LIST< _UserType >::delete_last (  ) 

Delete last element from the list.

template<typename _UserType>
void OE_LIST< _UserType >::clear (  ) 

Clear the list: delete all elements.

Referenced by OE_LIST< OE_INPUT_EVENT >::~OE_LIST().

template<typename _UserType>
void OE_LIST< _UserType >::copy_from ( OE_LIST< _UserType > *  src  ) 

// NOTE ON THIS FUNCTION: Since the data this LL deals in is void *'s, it can only copy the entries and their void * pointers - NOT what the void * pointers point to! Old contents of the list are lost.

And it doesn't work yet.

Todo:
fix it?

template<typename _UserType>
uint32 OE_LIST< _UserType >::num_entries (  ) 

Return number of entries in this list.

Referenced by OE_LAYER_2::pass_message().

template<typename _UserType>
void OE_LIST< _UserType >::seek_entry ( uint32  num  ) 

Seek to element in list given by it's ordinal number in list.

Referenced by OE_LAYER_1::test_ll().

template<typename _UserType>
_UserType& OE_LIST< _UserType >::get_entry ( uint32  num  ) 

Todo:
document this

template<typename _UserType>
_UserType& OE_LIST< _UserType >::get_cur (  ) 

Retrieve user pointer in the CURRENT element.

Note:
if list is empty returns NULL.

Referenced by OE_LAYER_2::pass_message(), and OE_LAYER_1::test_ll().

template<typename _UserType>
uint32 OE_LIST< _UserType >::is_last (  ) 

Checks if the current entry is the last one.

Referenced by OE_LAYER_2::pass_message().


The documentation for this class was generated from the following file:
Generated on Sat Sep 9 03:50:53 2006 for Openem APIs by  doxygen 1.4.7