CrystalSpace

Public API Reference

CS::Container::InvasiveList< Tag > Class Template Reference

"Invasive" double-linked list. More...

#include <csutil/invasivelist.h>

List of all members.

Public Member Functions

void Delete (Element *item)
 Delete an element from the list.
bool IsEmpty () const
 Return if the list is empty.
Element * PopFront ()
 Remove and return the first element.
void PushBack (Element *item)
 Push an element to the end of the list.

Detailed Description

template<typename Tag>
class CS::Container::InvasiveList< Tag >

"Invasive" double-linked list.

The list is invasive as all elements in the list have to be derived from, or have a member of, the Element class. However, this allows for more flexibility in the data structures you can construct - elements from the double-linked list can also be members of other structures simultaneously (e.g. hashes, or other linked list).

Template Parameters:
Tag is an arbitrary type to distinguish different list types.

Definition at line 40 of file invasivelist.h.


Member Function Documentation

template<typename Tag >
void CS::Container::InvasiveList< Tag >::Delete ( Element *  item  )  [inline]

Delete an element from the list.

Definition at line 76 of file invasivelist.h.

template<typename Tag >
bool CS::Container::InvasiveList< Tag >::IsEmpty (  )  const [inline]

Return if the list is empty.

Definition at line 87 of file invasivelist.h.

template<typename Tag >
Element* CS::Container::InvasiveList< Tag >::PopFront (  )  [inline]

Remove and return the first element.

Returns:
Previous first element; nullptr if list was empty.

Definition at line 68 of file invasivelist.h.

template<typename Tag >
void CS::Container::InvasiveList< Tag >::PushBack ( Element *  item  )  [inline]

Push an element to the end of the list.

Definition at line 56 of file invasivelist.h.


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

Generated for Crystal Space 2.1 by doxygen 1.6.1