 |
OpendTect
6.6
|
Go to the documentation of this file.
25 template <
class VT,
class AVT>
30 : maxsize_( maxsize ) {}
37 inline VT getValue(
int rank)
const;
38 inline AVT getAssociatedValue(
int rank)
const;
40 inline bool getHighestValue( VT& )
const;
41 inline bool getLowestValue( VT& )
const;
43 inline int size()
const;
44 inline int isEmpty()
const {
return !size(); }
46 inline void addValue( VT val, AVT aval );
54 template <
class VT,
class AVT>
inline
61 template <
class VT,
class AVT>
inline
63 {
return values_[pos].first; }
66 template <
class VT,
class AVT>
inline
68 {
return values_[pos].second; }
71 template <
class VT,
class AVT>
inline
73 {
return values_.size(); }
77 template <
class VT,
class AVT>
inline
82 res = values_[0].first;
90 template <
class VT,
class AVT>
inline
93 const int sz = size();
96 res = values_[sz-1].first;
105 template <
class VT,
class AVT>
inline
109 const int mysize = size();
111 while ( pos<mysize && values_[pos].first>val ) pos++;
115 if ( mysize>=maxsize_ )
118 values_ += std::pair<VT,AVT>( val, aval );
122 values_.insert( pos, std::pair<VT,AVT>(val,aval) );
124 if ( mysize==maxsize_ )
125 values_.removeSingle(mysize);
int isEmpty() const
Definition: toplist.h:44
void reset()
Definition: toplist.h:55
VT getValue(int rank) const
Definition: toplist.h:62
const int maxsize_
Definition: toplist.h:50
#define mClass(module)
Definition: commondefs.h:181
void addValue(VT val, AVT aval)
Definition: toplist.h:106
AVT getAssociatedValue(int rank) const
Definition: toplist.h:67
int size() const
Definition: toplist.h:72
TopList(int maxsize)
Definition: toplist.h:29
TypeSet< std::pair< VT, AVT > > values_
Definition: toplist.h:49
bool getHighestValue(VT &) const
Definition: toplist.h:78
bool getLowestValue(VT &) const
Definition: toplist.h:91
virtual ~TopList()
Definition: toplist.h:32
Is a class that holds a "top N" list with the N highest (or lowest) values that is added....
Definition: houghtransform.h:22
Sets of (small) copyable elements.
Definition: commontypes.h:29
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021