Public Member Functions | Private Attributes

TopList< VT, AVT > Class Template Reference

is a class that holds a "top N" list with the N highest (or lowest) values that is added. Each value has an associated value that can be used as an identifier of where the value come from or something like that. More...

List of all members.

Public Member Functions

 TopList (int maxsize_, VT undefval_, bool istop_)
virtual ~TopList ()
bool isTop () const
void setTop (bool yn)
void reset ()
VT getValue (int pos) const
AVT getAssociatedValue (int pos) const
virtual int size () const
VT getBottomValue () const
void addValue (VT val, AVT aval)

Private Attributes

TypeSet< VT > values
TypeSet< AVT > avals
bool istop
const int maxsize
VT undefval

Detailed Description

template<class VT, class AVT>
class TopList< VT, AVT >

is a class that holds a "top N" list with the N highest (or lowest) values that is added. Each value has an associated value that can be used as an identifier of where the value come from or something like that.


Constructor & Destructor Documentation

template<class VT , class AVT >
TopList< VT, AVT >::TopList ( int  maxsize_,
VT  undefval_,
bool  istop_ 
) [inline]
template<class VT , class AVT >
virtual TopList< VT, AVT >::~TopList (  )  [inline, virtual]

Member Function Documentation

template<class VT , class AVT >
void TopList< VT, AVT >::addValue ( VT  val,
AVT  aval 
) [inline]
template<class VT , class AVT >
AVT TopList< VT, AVT >::getAssociatedValue ( int  pos  )  const [inline]
template<class VT , class AVT >
VT TopList< VT, AVT >::getBottomValue (  )  const [inline]
template<class VT , class AVT >
VT TopList< VT, AVT >::getValue ( int  pos  )  const [inline]
template<class VT , class AVT >
bool TopList< VT, AVT >::isTop (  )  const [inline]
template<class VT , class AVT >
void TopList< VT, AVT >::reset (  )  [inline]

Removes all values

template<class VT , class AVT >
void TopList< VT, AVT >::setTop ( bool  yn  )  [inline]
Note:
If the new setting is different from the current one, the object will be reset
template<class VT , class AVT >
int TopList< VT, AVT >::size (  )  const [inline, virtual]

Member Data Documentation

template<class VT , class AVT >
TypeSet<AVT> TopList< VT, AVT >::avals [private]
template<class VT , class AVT >
bool TopList< VT, AVT >::istop [private]
template<class VT , class AVT >
const int TopList< VT, AVT >::maxsize [private]
template<class VT , class AVT >
VT TopList< VT, AVT >::undefval [private]
template<class VT , class AVT >
TypeSet<VT> TopList< VT, AVT >::values [private]