OpendTect  6.6
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 addValue (VT val, AVT aval)
 
AVT getAssociatedValue (int rank) const
 
bool getHighestValue (VT &) const
 
bool getLowestValue (VT &) const
 
VT getValue (int rank) const
 
int isEmpty () const
 
void reset ()
 
int size () const
 

Private Attributes

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

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

◆ TopList()

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

◆ ~TopList()

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

Member Function Documentation

◆ addValue()

template<class VT , class AVT >
void TopList< VT, AVT >::addValue ( VT  val,
AVT  aval 
)
inline

◆ getAssociatedValue()

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

◆ getHighestValue()

template<class VT , class AVT >
bool TopList< VT, AVT >::getHighestValue ( VT &  res) const
inline

◆ getLowestValue()

template<class VT , class AVT >
bool TopList< VT, AVT >::getLowestValue ( VT &  res) const
inline

◆ getValue()

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

◆ isEmpty()

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

◆ reset()

template<class VT , class AVT >
void TopList< VT, AVT >::reset
inline

Removes all values

◆ size()

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

Member Data Documentation

◆ maxsize_

template<class VT , class AVT >
const int TopList< VT, AVT >::maxsize_
private

◆ values_

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. 1995-2022