NSortedList Class Template Reference

NSortedList class provides a sorted list class, it is implemented by subclassing NList class. More...

Inheritance diagram for NSortedList:

NList

List of all members.

Public Member Functions

 NSortedList (void)
 Constructs an empty NSortedList object.
 NSortedList (const T &val)
 Constructs a NSortedList object and inserts val.
 NSortedList (const NSortedList< T > &other)
 Copy constructor.
NSortedList< T > & insert (const T &val)
 Inserts a item on the list.


Detailed Description

template<typename T>
class NSortedList< T >

NSortedList class provides a sorted list class, it is implemented by subclassing NList class.

Note:
Note that the item to be inserted must overload the operators = and <

You should not use this class to store a large amount of itens because this class is very slow (+/- 200 itens added p/ sec on a p4 2.2ghz). You should use a NSkipList instead

Examples:

ex_nsortedlist.cpp, and ex_skip_vs_sorted.cpp.

Definition at line 41 of file nsortedlist.hpp.


Constructor & Destructor Documentation

NSortedList ( const T &  val  )  [inline]

Constructs a NSortedList object and inserts val.

Parameters:
val The first item to be inserted

Definition at line 91 of file nsortedlist.hpp.

NSortedList ( const NSortedList< T > &  other  )  [inline]

Copy constructor.

Parameters:
other A NSortedList object containing the items to be copied

Definition at line 99 of file nsortedlist.hpp.

References NList::copy().


Member Function Documentation

NSortedList< T > & insert ( const T &  val  )  [inline]

Inserts a item on the list.

Parameters:
val Item to be inserted
Returns:
A reference to this

Definition at line 125 of file nsortedlist.hpp.

References NList::contains(), NListNode::data, NListNode::next, and NListNode::previous.


The documentation for this class was generated from the following file:
Generated on Wed Mar 5 23:10:37 2008 for NemesisUtilitiesSystem by  doxygen 1.5.4