OpendTect  7.0
Public Types | Public Member Functions | Protected Attributes | List of all members
VectorAccess< T, IT > Class Template Reference

Simple vector-based container simplifying index-based work. More...

Inheritance diagram for VectorAccess< T, IT >:
[legend]

Public Types

typedef impl_type::const_iterator const_iterator
 
typedef size_type idx_type
 
typedef std::vector< T > impl_type
 
typedef impl_type::iterator iterator
 
typedef T object_type
 
typedef IT size_type
 

Public Member Functions

 VectorAccess ()
 
 VectorAccess (const VectorAccess &v2)
 
 VectorAccess (IT n)
 
 VectorAccess (IT n, const T &t)
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
IT count (const T &) const
 
iterator end ()
 
const_iterator end () const
 
void erase ()
 
void erase (const T &t)
 
void fillWith (const T &val)
 
T & first ()
 
const T & first () const
 
IT getCapacity () const
 
idx_type getIdx (const_iterator it) const
 
idx_type getIdx (iterator it) const
 
IT indexOf (const T &, bool forward, IT start=-1) const
 
void insert (IT pos, const T &val)
 
bool isPresent (const T &) const
 
T & last ()
 
const T & last () const
 
void moveAfter (const T &t, const T &aft)
 
void moveToStart (const T &t)
 
VectorAccessoperator= (const VectorAccess &v2)
 
T & operator[] (IT)
 
const T & operator[] (IT) const
 
pop_back ()
 
bool push_back (const T &t)
 
void remove (IT i)
 
void remove (IT i1, IT i2)
 
void replace (const T &val, const T &newval)
 
bool setCapacity (IT sz, bool withmargin)
 
bool setSize (IT sz, T val)
 
IT size () const
 
void swap (VectorAccess &oth)
 
void swapElems (IT i, IT j)
 
bool validIdx (IT i) const
 
impl_typevec ()
 
const impl_typevec () const
 

Protected Attributes

impl_type v_
 

Detailed Description

template<class T, class IT>
class VectorAccess< T, IT >

Simple vector-based container simplifying index-based work.

This class is an implementation detail of the 'sets.h' and 'sortedlist.h' classes. Thus, this class is not meant to be used anywhere else in OpendTect! Use TypeSet, ObjectSet or SortedList instead. If you need to have the std::vector to pass to an external C++ object, use the TypeSet::vec() or SortedList::vec().

NOTE: because this class is based directly upon the STL vector, we have a problem for the bool type. In STL, they have made the vector<bool> implemented in terms of the bit_vector. That really sucks because we cannot return a reference to T! This is why there is a 'BoolTypeSet'.

<>

Member Typedef Documentation

◆ const_iterator

template<class T , class IT >
typedef impl_type::const_iterator VectorAccess< T, IT >::const_iterator

◆ idx_type

template<class T , class IT >
typedef size_type VectorAccess< T, IT >::idx_type

◆ impl_type

template<class T , class IT >
typedef std::vector<T> VectorAccess< T, IT >::impl_type

◆ iterator

template<class T , class IT >
typedef impl_type::iterator VectorAccess< T, IT >::iterator

◆ object_type

template<class T , class IT >
typedef T VectorAccess< T, IT >::object_type

◆ size_type

template<class T , class IT >
typedef IT VectorAccess< T, IT >::size_type

Constructor & Destructor Documentation

◆ VectorAccess() [1/4]

template<class T , class IT >
VectorAccess< T, IT >::VectorAccess ( )
inline

◆ VectorAccess() [2/4]

template<class T , class IT >
VectorAccess< T, IT >::VectorAccess ( IT  n)
inline

◆ VectorAccess() [3/4]

template<class T , class IT >
VectorAccess< T, IT >::VectorAccess ( IT  n,
const T &  t 
)
inline

◆ VectorAccess() [4/4]

template<class T , class IT >
VectorAccess< T, IT >::VectorAccess ( const VectorAccess< T, IT > &  v2)
inline

Member Function Documentation

◆ begin() [1/2]

template<class T , class IT >
iterator VectorAccess< T, IT >::begin ( )
inline

◆ begin() [2/2]

template<class T , class IT >
const_iterator VectorAccess< T, IT >::begin ( ) const
inline

◆ cbegin()

template<class T , class IT >
const_iterator VectorAccess< T, IT >::cbegin ( ) const
inline

◆ cend()

template<class T , class IT >
const_iterator VectorAccess< T, IT >::cend ( ) const
inline

◆ count()

template<class T , class IT >
IT VectorAccess< T, IT >::count ( const T &  t) const
inline

◆ end() [1/2]

template<class T , class IT >
iterator VectorAccess< T, IT >::end ( )
inline

◆ end() [2/2]

template<class T , class IT >
const_iterator VectorAccess< T, IT >::end ( ) const
inline

◆ erase() [1/2]

template<class T , class IT >
void VectorAccess< T, IT >::erase ( )
inline

◆ erase() [2/2]

template<class T , class IT >
void VectorAccess< T, IT >::erase ( const T &  t)
inline

◆ fillWith()

template<class T , class IT >
void VectorAccess< T, IT >::fillWith ( const T &  val)
inline

◆ first() [1/2]

template<class T , class IT >
T& VectorAccess< T, IT >::first ( )
inline

◆ first() [2/2]

template<class T , class IT >
const T& VectorAccess< T, IT >::first ( ) const
inline

◆ getCapacity()

template<class T , class IT >
IT VectorAccess< T, IT >::getCapacity ( ) const
inline
Returns
max size without reallocation.

◆ getIdx() [1/2]

template<class T , class IT >
idx_type VectorAccess< T, IT >::getIdx ( const_iterator  it) const
inline

◆ getIdx() [2/2]

template<class T , class IT >
idx_type VectorAccess< T, IT >::getIdx ( iterator  it) const
inline

◆ indexOf()

template<class T , class IT >
IT VectorAccess< T, IT >::indexOf ( const T &  t,
bool  forward,
IT  start = -1 
) const
inline

◆ insert()

template<class T , class IT >
void VectorAccess< T, IT >::insert ( IT  pos,
const T &  val 
)
inline

◆ isPresent()

template<class T , class IT >
bool VectorAccess< T, IT >::isPresent ( const T &  t) const
inline

◆ last() [1/2]

template<class T , class IT >
T& VectorAccess< T, IT >::last ( )
inline

◆ last() [2/2]

template<class T , class IT >
const T& VectorAccess< T, IT >::last ( ) const
inline

◆ moveAfter()

template<class T , class IT >
void VectorAccess< T, IT >::moveAfter ( const T &  t,
const T &  aft 
)
inline

◆ moveToStart()

template<class T , class IT >
void VectorAccess< T, IT >::moveToStart ( const T &  t)
inline

◆ operator=()

template<class T , class IT >
VectorAccess& VectorAccess< T, IT >::operator= ( const VectorAccess< T, IT > &  v2)
inline

◆ operator[]() [1/2]

template<class T , class IT >
T & VectorAccess< T, IT >::operator[] ( IT  vidx)
inline

◆ operator[]() [2/2]

template<class T , class IT >
const T & VectorAccess< T, IT >::operator[] ( IT  vidx) const
inline

◆ pop_back()

template<class T , class IT >
T VectorAccess< T, IT >::pop_back
inline

◆ push_back()

template<class T , class IT >
bool VectorAccess< T, IT >::push_back ( const T &  t)
inline

◆ remove() [1/2]

template<class T , class IT >
void VectorAccess< T, IT >::remove ( IT  i)
inline

◆ remove() [2/2]

template<class T , class IT >
void VectorAccess< T, IT >::remove ( IT  i1,
IT  i2 
)
inline

◆ replace()

template<class T , class IT >
void VectorAccess< T, IT >::replace ( const T &  val,
const T &  newval 
)
inline

◆ setCapacity()

template<class T , class IT >
bool VectorAccess< T, IT >::setCapacity ( IT  sz,
bool  withmargin 
)
inline

Allocates mem for sz, does not change size.

◆ setSize()

template<class T , class IT >
bool VectorAccess< T, IT >::setSize ( IT  sz,
val 
)
inline

◆ size()

template<class T , class IT >
IT VectorAccess< T, IT >::size ( ) const
inline

◆ swap()

template<class T , class IT >
void VectorAccess< T, IT >::swap ( VectorAccess< T, IT > &  oth)
inline

◆ swapElems()

template<class T , class IT >
void VectorAccess< T, IT >::swapElems ( IT  i,
IT  j 
)
inline

◆ validIdx()

template<class T , class IT >
bool VectorAccess< T, IT >::validIdx ( IT  i) const
inline

◆ vec() [1/2]

template<class T , class IT >
impl_type& VectorAccess< T, IT >::vec ( )
inline

◆ vec() [2/2]

template<class T , class IT >
const impl_type& VectorAccess< T, IT >::vec ( ) const
inline

Member Data Documentation

◆ v_

template<class T , class IT >
impl_type VectorAccess< T, IT >::v_
protected

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