OpendTect-6_4  6.4
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SortedList< T > Class Template Reference

A SortedList is a list where all objects are stored in ascending order. The objects should be capable of doing <,> and ==. If allowmultiples is true, multiple objects with the same value are allowed in the list. More...

Inheritance diagram for SortedList< T >:
[legend]

Public Types

typedef int size_type
 
typedef T object_type
 

Public Member Functions

 SortedList (bool allowmultiples=true)
 
bool isEmpty () const
 
size_type size () const
 
const T & operator[] (size_type idx) const
 
bool isPresent (const T &t) const
 
size_type indexOf (const T &) const
 
SortedList< T > & operator+= (const T &)
 
SortedList< T > & operator-= (const T &)
 
SortedList< T > & add (const T &t)
 
template<class U >
SortedList< T > & copy (const U &)
 
template<class U >
SortedList< T > & operator= (const U &)
 
template<class U >
SortedList< T > & operator+= (const U &)
 
template<class U >
SortedList< T > & operator-= (const U &)
 
template<class U >
void intersect (const U &)
 
void erase ()
 
void setEmpty ()
 
void removeSingle (size_type)
 
void removeRange (size_type, size_type)
 
std::vector< T > & vec ()
 
const std::vector< T > & vec () const
 
T * arr ()
 
const T * arr () const
 

Protected Member Functions

size_type getPos (const T &) const
 

Protected Attributes

VectorAccess< T, size_typevec_
 
bool allowmultiples_
 

Detailed Description

template<class T>
class SortedList< T >

A SortedList is a list where all objects are stored in ascending order. The objects should be capable of doing <,> and ==. If allowmultiples is true, multiple objects with the same value are allowed in the list.

A SortedList can be used together with all other lists that have a [] operator, such as TypeSets.

Member Typedef Documentation

template<class T>
typedef T SortedList< T >::object_type
template<class T>
typedef int SortedList< T >::size_type

Constructor & Destructor Documentation

template<class T>
SortedList< T >::SortedList ( bool  allowmultiples = true)
inline

Member Function Documentation

template<class T>
SortedList<T>& SortedList< T >::add ( const T &  t)
inline
template<class T>
T* SortedList< T >::arr ( )
inline
template<class T>
const T* SortedList< T >::arr ( ) const
inline
template<class T >
template<class U >
SortedList< T > & SortedList< T >::copy ( const U &  array)
inline
template<class T>
void SortedList< T >::erase ( )
inline
template<class T>
SortedList< T >::size_type SortedList< T >::getPos ( const T &  typ) const
inlineprotected

If not found, it will return position of the item just above, and size() if val is higher than highest val

template<class T>
SortedList< T >::size_type SortedList< T >::indexOf ( const T &  typ) const
inline

Returns -1 if not found

template<class T >
template<class U >
void SortedList< T >::intersect ( const U &  b)
inline

Remove all entries not present in both lists.

template<class T>
bool SortedList< T >::isEmpty ( ) const
inline
template<class T>
bool SortedList< T >::isPresent ( const T &  t) const
inline
template<class T>
SortedList< T > & SortedList< T >::operator+= ( const T &  nv)
inline
template<class T >
template<class U >
SortedList< T > & SortedList< T >::operator+= ( const U &  array)
inline
template<class T>
SortedList< T > & SortedList< T >::operator-= ( const T &  nv)
inline
template<class T >
template<class U >
SortedList< T > & SortedList< T >::operator-= ( const U &  array)
inline
template<class T >
template<class U >
SortedList< T > & SortedList< T >::operator= ( const U &  array)
inline
template<class T>
const T& SortedList< T >::operator[] ( size_type  idx) const
inline
template<class T >
void SortedList< T >::removeRange ( size_type  p1,
size_type  p2 
)
inline
template<class T >
void SortedList< T >::removeSingle ( size_type  pos)
inline
template<class T>
void SortedList< T >::setEmpty ( )
inline
template<class T>
size_type SortedList< T >::size ( ) const
inline
template<class T>
std::vector<T>& SortedList< T >::vec ( )
inline
template<class T>
const std::vector<T>& SortedList< T >::vec ( ) const
inline

Member Data Documentation

template<class T>
bool SortedList< T >::allowmultiples_
protected
template<class T>
VectorAccess<T,size_type> SortedList< T >::vec_
protected

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