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

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

Public Types

typedef I size_type
 
typedef T object_type
 

Public Member Functions

 VectorAccess ()
 
 VectorAccess (I n)
 
 VectorAccess (I n, const T &t)
 
 VectorAccess (const VectorAccess &v2)
 
std::vector< T > & vec ()
 
const std::vector< T > & vec () const
 
T & operator[] (I idx)
 
const T & operator[] (I idx) const
 
T & first ()
 
const T & first () const
 
T & last ()
 
const T & last () const
 
size () const
 
bool setCapacity (I sz, bool withmargin)
 
getCapacity () const
 
bool setSize (I sz, T val)
 
bool validIdx (I idx) const
 
indexOf (const T &, bool forward, I start=-1) const
 
count (const T &) const
 
bool isPresent (const T &) const
 
VectorAccessoperator= (const VectorAccess &v2)
 
bool push_back (const T &t)
 
pop_back ()
 
void insert (I pos, const T &val)
 
void erase ()
 
void erase (const T &t)
 
void remove (I idx)
 
void remove (I i1, I i2)
 
void swap (I i, I j)
 
void fillWith (const T &val)
 
void replace (const T &val, const T &newval)
 
void moveAfter (const T &t, const T &aft)
 
void moveToStart (const T &t)
 

Protected Attributes

std::vector< T > v_
 

Detailed Description

template<class T, class I>
class VectorAccess< T, I >

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

template<class T, class I>
typedef T VectorAccess< T, I >::object_type
template<class T, class I>
typedef I VectorAccess< T, I >::size_type

Constructor & Destructor Documentation

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

Member Function Documentation

template<class T, class I >
I VectorAccess< T, I >::count ( const T &  t) const
inline
template<class T, class I>
void VectorAccess< T, I >::erase ( )
inline
template<class T, class I>
void VectorAccess< T, I >::erase ( const T &  t)
inline
template<class T, class I>
void VectorAccess< T, I >::fillWith ( const T &  val)
inline
template<class T, class I>
T& VectorAccess< T, I >::first ( )
inline
template<class T, class I>
const T& VectorAccess< T, I >::first ( ) const
inline
template<class T, class I>
I VectorAccess< T, I >::getCapacity ( ) const
inline
Returns
max size without reallocation.
template<class T, class I>
I VectorAccess< T, I >::indexOf ( const T &  t,
bool  forward,
start = -1 
) const
inline
template<class T, class I>
void VectorAccess< T, I >::insert ( pos,
const T &  val 
)
inline
template<class T, class I >
bool VectorAccess< T, I >::isPresent ( const T &  t) const
inline
template<class T, class I>
T& VectorAccess< T, I >::last ( )
inline
template<class T, class I>
const T& VectorAccess< T, I >::last ( ) const
inline
template<class T, class I>
void VectorAccess< T, I >::moveAfter ( const T &  t,
const T &  aft 
)
inline
template<class T, class I>
void VectorAccess< T, I >::moveToStart ( const T &  t)
inline
template<class T, class I>
VectorAccess& VectorAccess< T, I >::operator= ( const VectorAccess< T, I > &  v2)
inline
template<class T , class I>
T & VectorAccess< T, I >::operator[] ( idx)
inline
template<class T , class I>
const T & VectorAccess< T, I >::operator[] ( idx) const
inline
template<class T , class I >
T VectorAccess< T, I >::pop_back ( )
inline
template<class T, class I >
bool VectorAccess< T, I >::push_back ( const T &  t)
inline
template<class T, class I>
void VectorAccess< T, I >::remove ( idx)
inline
template<class T, class I>
void VectorAccess< T, I >::remove ( i1,
i2 
)
inline
template<class T, class I>
void VectorAccess< T, I >::replace ( const T &  val,
const T &  newval 
)
inline
template<class T , class I>
bool VectorAccess< T, I >::setCapacity ( sz,
bool  withmargin 
)
inline

Allocates mem for sz, does not change size.

template<class T, class I>
bool VectorAccess< T, I >::setSize ( sz,
val 
)
inline
template<class T, class I>
I VectorAccess< T, I >::size ( ) const
inline
template<class T, class I>
void VectorAccess< T, I >::swap ( i,
j 
)
inline
template<class T, class I>
bool VectorAccess< T, I >::validIdx ( idx) const
inline
template<class T, class I>
std::vector<T>& VectorAccess< T, I >::vec ( )
inline
template<class T, class I>
const std::vector<T>& VectorAccess< T, I >::vec ( ) const
inline

Member Data Documentation

template<class T, class I>
std::vector<T> VectorAccess< T, I >::v_
protected

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