OpendTect  7.0
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 T object_type
 
typedef int size_type
 

Public Member Functions

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

Protected Member Functions

size_type getPos (const T &) const
 

Protected Attributes

bool allowmultiples_
 
VectorAccess< T, size_typevec_
 

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

◆ object_type

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

◆ size_type

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

Constructor & Destructor Documentation

◆ SortedList()

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

Member Function Documentation

◆ add()

template<class T >
SortedList<T>& SortedList< T >::add ( const T &  t)
inline

◆ arr() [1/2]

template<class T >
T* SortedList< T >::arr ( )
inline

◆ arr() [2/2]

template<class T >
const T* SortedList< T >::arr ( ) const
inline

◆ copy()

template<class T >
template<class U >
SortedList< T > & SortedList< T >::copy ( const U &  array)
inline

◆ erase()

template<class T >
void SortedList< T >::erase ( )
inline

◆ getPos()

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

◆ indexOf()

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

Returns -1 if not found

◆ intersect()

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

Remove all entries not present in both lists.

◆ isEmpty()

template<class T >
bool SortedList< T >::isEmpty ( ) const
inline

◆ isPresent()

template<class T >
bool SortedList< T >::isPresent ( const T &  t) const
inline

◆ operator+=() [1/2]

template<class T >
SortedList< T > & SortedList< T >::operator+= ( const T &  nv)
inline

◆ operator+=() [2/2]

template<class T >
template<class U >
SortedList< T > & SortedList< T >::operator+= ( const U &  array)
inline

◆ operator-=() [1/2]

template<class T >
SortedList< T > & SortedList< T >::operator-= ( const T &  nv)
inline

◆ operator-=() [2/2]

template<class T >
template<class U >
SortedList< T > & SortedList< T >::operator-= ( const U &  array)
inline

◆ operator=()

template<class T >
template<class U >
SortedList< T > & SortedList< T >::operator= ( const U &  array)
inline

◆ operator[]()

template<class T >
const T& SortedList< T >::operator[] ( size_type  idx) const
inline

◆ removeRange()

template<class T >
void SortedList< T >::removeRange ( size_type  p1,
size_type  p2 
)
inline

◆ removeSingle()

template<class T >
void SortedList< T >::removeSingle ( size_type  pos)
inline

◆ setEmpty()

template<class T >
void SortedList< T >::setEmpty ( )
inline

◆ size()

template<class T >
size_type SortedList< T >::size ( ) const
inline

◆ vec() [1/2]

template<class T >
std::vector<T>& SortedList< T >::vec ( )
inline

◆ vec() [2/2]

template<class T >
const std::vector<T>& SortedList< T >::vec ( ) const
inline

Member Data Documentation

◆ allowmultiples_

template<class T >
bool SortedList< T >::allowmultiples_
protected

◆ vec_

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