OpendTect-6_4  6.4
Public Member Functions | Private Attributes | List of all members
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 comes from or something like that. More...

Public Member Functions

 TopList (int maxsize)
 
virtual ~TopList ()
 
void reset ()
 
VT getValue (int rank) const
 
AVT getAssociatedValue (int rank) const
 
bool getHighestValue (VT &) const
 
bool getLowestValue (VT &) const
 
int size () const
 
int isEmpty () const
 
void addValue (VT val, AVT aval)
 

Private Attributes

TypeSet< std::pair< VT, AVT > > values_
 
const int maxsize_
 

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 comes from or something like that.

Constructor & Destructor Documentation

template<class VT, class AVT>
TopList< VT, AVT >::TopList ( int  maxsize)
inline
template<class VT, class AVT>
virtual TopList< VT, AVT >::~TopList ( )
inlinevirtual

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  rank) const
inline
template<class VT , class AVT >
bool TopList< VT, AVT >::getHighestValue ( VT &  res) const
inline
template<class VT , class AVT >
bool TopList< VT, AVT >::getLowestValue ( VT &  res) const
inline
template<class VT , class AVT >
VT TopList< VT, AVT >::getValue ( int  rank) const
inline
template<class VT, class AVT>
int TopList< VT, AVT >::isEmpty ( ) const
inline
template<class VT , class AVT >
void TopList< VT, AVT >::reset ( )
inline

Removes all values

template<class VT , class AVT >
int TopList< VT, AVT >::size ( ) const
inline

Member Data Documentation

template<class VT, class AVT>
const int TopList< VT, AVT >::maxsize_
private
template<class VT, class AVT>
TypeSet<std::pair<VT,AVT> > TopList< VT, AVT >::values_
private

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019