Circular List


A container with sequential access, and constant access of either end.

Circular implementation provides constant access time to both ends of list without additional pointer members. For iteration see Iterator.

Library

ETL<ToolKit>

Declaration


#include<ospace/advanced/List.h>

template
  <
  class Instantiator
  >
class os_List

Interface

Constructor
os_List(void)
This the default constructor.
Destructor
~os_List()
Destroys all entries in the list.
operator =
os_List<T>& operator=(const os_List<T>&)
Replaces contents of one list with another..
operator ==
int operator==(const os_List<T>&)
Returns 1 (true) if two lists contain items that are equal to one another, otherwise returns 0 (false).
operator !=
int operator!=(const os_List<T>&)
The negation of operator==, above.
operator +=
os_List<T>& operator+=(const os_List<T>&)
Appends one list to another, making a bigger list .
make_empty
os_List<T>& make_empty(void)
Removes and destroys the contents. The list is in state of initial construction.
Size
unsigned int Size(void)
Returns the number of items in the list.
insert
os_List<T>& insert(const T& item)
Inserts the item at the head of list.
append
os_List<T>& append(const T& item)
Appends the item to the tail of list.
remove
os_List<T>& remove(const T& item)
Removes one occurrence of item from list.
remove_all
os_List<T>& remove_all(const T& item)
Removes all occurrences of item from list.
exists
int exists(const T& item)
Returns 1 (true) if item is in list. Otherwise returns 0 (false).
top
const T& top(void)
Returns a const reference to the head of list without removing it.
Head
T& Head(void)
Removes and returns the head of list.
bottom
const T& bottom(void)
Returns a const reference to the tail of list without removing it.
Tail
T& tail(void)
Removes and returns the tail of list.

Copyright©2005-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.