Bites
A small library of miscellaneous C++ codes.
 All Classes Namespaces Functions Friends Pages
Public Member Functions | List of all members
bites::SortedList< T > Class Template Reference

#include <SortedList.hpp>

Public Member Functions

 SortedList (const std::list< T > &donor=std::list< T >())
 
void add (const T &item)
 
unsigned int getCountLT (const T &item) const
 
unsigned int getCountGT (const T &item) const
 
unsigned int removeLT (const T &item)
 

Detailed Description

template<typename T>
class bites::SortedList< T >

Sorted list with fast trimming using less-than/greater-than comparison.

Constructor & Destructor Documentation

template<typename T>
bites::SortedList< T >::SortedList ( const std::list< T > &  donor = std::list<T>())
inline

Initialize the object with a copy of the donor list, sorted.

Member Function Documentation

template<typename T>
void bites::SortedList< T >::add ( const T &  item)
inline

Add item to the list while maintaining sorted order.

template<typename T>
unsigned int bites::SortedList< T >::getCountLT ( const T &  item) const
inline

Return number of elements less than item.

template<typename T>
unsigned int bites::SortedList< T >::getCountGT ( const T &  item) const
inline

Return number of elements greater than item.

template<typename T>
unsigned int bites::SortedList< T >::removeLT ( const T &  item)
inline

Trim off any elements less than item. Return number of elements trimmed.


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