OpendTect  6.6
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ObjectSet< T > Class Template Reference

Set of pointers to objects. More...

Inherits OD::Set.

Inherited by ManagedObjectSetBase< T >.

Public Types

typedef impl_type::const_iterator const_iterator
 
typedef const value_typeconst_reference
 
typedef size_type difference_type
 
typedef size_type idx_type
 
typedef impl_type::iterator iterator
 
typedef T object_type
 
typedef value_typereference
 
typedef int size_type
 
typedef T * value_type
 

Public Member Functions

 ObjectSet ()
 
 ObjectSet (const ObjectSet &)
 
 ObjectSet (T *)
 
 ObjectSet (T *, T *)
 
 ObjectSet (T *, T *, T *)
 
virtual ~ObjectSet ()
 
ObjectSetadd (T *t)
 
bool addIfNew (T *)
 
void allowNull (bool yn=true)
 
virtual void append (const ObjectSet &)
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
virtual ObjectSetclone () const
 
virtual void copy (const ObjectSet &)
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
virtual void erase ()
 
T * first ()
 
const T * first () const
 
virtual T * get (const T *) const
 check & unconst More...
 
virtual T * get (idx_type)
 
virtual const T * get (idx_type) const
 
idx_type getIdx (const_iterator it) const
 
idx_type getIdx (iterator it) const
 
virtual idx_type indexOf (const T *) const
 
virtual void insertAfter (T *newptr, idx_type)
 
virtual void insertAt (T *newptr, idx_type)
 
virtual bool isManaged () const
 
virtual bool isPresent (const T *) const
 
T * last ()
 
const T * last () const
 
size_type max_size () const
 
virtual int64_t nrItems () const
 
bool nullAllowed () const
 
bool operator!= (const ObjectSet &oth) const
 
ObjectSetoperator+= (T *t)
 
virtual ObjectSetoperator-= (T *)
 
ObjectSetoperator= (const ObjectSet &)
 
bool operator== (const ObjectSet &) const
 
const T * operator[] (const T *t) const
 
T * operator[] (idx_type i)
 
const T * operator[] (idx_type i) const
 
void plainErase ()
 
virtual T * pop ()
 
void push (T *t)
 
virtual void removeRange (idx_type from, idx_type to)
 
virtual T * removeSingle (idx_type, bool keep_order=true)
 
virtual T * replace (idx_type, T *)
 
virtual void reverse ()
 
void setNullAllowed (bool yn=true)
 
size_type size () const
 
void swap (idx_type, idx_type)
 
void swap (ObjectSet &oth)
 
virtual void swapItems (int64_t i1, int64_t i2)
 
void useIndexes (const idx_type *)
 
virtual bool validIdx (int64_t) const
 
- Public Member Functions inherited from OD::Set
virtual ~Set ()
 
bool isEmpty () const
 
void setEmpty ()
 

Protected Types

typedef VectorAccess< T *, size_typeimpl_type
 

Protected Member Functions

virtual ObjectSetdoAdd (T *)
 

Protected Attributes

bool allow0_ = false
 
impl_type vec_
 

Additional Inherited Members

- Static Public Member Functions inherited from OD::Set
static int maxIdx32 ()
 
static int64_t maxIdx64 ()
 

Detailed Description

template<class T>
class ObjectSet< T >

Set of pointers to objects.

The ObjectSet does not manage the objects, it is just a collection of pointers to the objects. If you want management, use ManagedObjectSet.

Note: you can use indexOf(ptr) to see whether the object is in the set. If you know that the object is in the set, and you need the index of it, then you can use getIdx(ptr) to obtain its index.

<>

Member Typedef Documentation

◆ const_iterator

template<class T >
typedef impl_type::const_iterator ObjectSet< T >::const_iterator

◆ const_reference

template<class T >
typedef const value_type& ObjectSet< T >::const_reference

◆ difference_type

template<class T >
typedef size_type ObjectSet< T >::difference_type

◆ idx_type

template<class T >
typedef size_type ObjectSet< T >::idx_type

◆ impl_type

template<class T >
typedef VectorAccess<T*,size_type> ObjectSet< T >::impl_type
protected

◆ iterator

template<class T >
typedef impl_type::iterator ObjectSet< T >::iterator

◆ object_type

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

◆ reference

template<class T >
typedef value_type& ObjectSet< T >::reference

◆ size_type

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

◆ value_type

template<class T >
typedef T* ObjectSet< T >::value_type

Constructor & Destructor Documentation

◆ ObjectSet() [1/5]

template<class T >
ObjectSet< T >::ObjectSet
inline

◆ ObjectSet() [2/5]

template<class T >
ObjectSet< T >::ObjectSet ( T *  t)
inlineexplicit

◆ ObjectSet() [3/5]

template<class T >
ObjectSet< T >::ObjectSet ( T *  t0,
T *  t1 
)
inlineexplicit

◆ ObjectSet() [4/5]

template<class T >
ObjectSet< T >::ObjectSet ( T *  t0,
T *  t1,
T *  t2 
)
inlineexplicit

◆ ObjectSet() [5/5]

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

◆ ~ObjectSet()

template<class T >
virtual ObjectSet< T >::~ObjectSet ( )
inlinevirtual

Member Function Documentation

◆ add()

template<class T >
ObjectSet& ObjectSet< T >::add ( T *  t)
inline

◆ addIfNew()

template<class T >
bool ObjectSet< T >::addIfNew ( T *  ptr)
inline

◆ allowNull()

template<class T >
void ObjectSet< T >::allowNull ( bool  yn = true)
inline

◆ append()

template<class T >
void ObjectSet< T >::append ( const ObjectSet< T > &  os)
inlinevirtual

◆ begin() [1/2]

template<class T >
iterator ObjectSet< T >::begin ( )
inline

◆ begin() [2/2]

template<class T >
const_iterator ObjectSet< T >::begin ( ) const
inline

◆ cbegin()

template<class T >
const_iterator ObjectSet< T >::cbegin ( ) const
inline

◆ cend()

template<class T >
const_iterator ObjectSet< T >::cend ( ) const
inline

◆ clone()

template<class T >
virtual ObjectSet* ObjectSet< T >::clone ( ) const
inlinevirtual

◆ copy()

template<class T >
void ObjectSet< T >::copy ( const ObjectSet< T > &  os)
inlinevirtual

◆ doAdd()

template<class T >
ObjectSet< T > & ObjectSet< T >::doAdd ( T *  ptr)
inlineprotectedvirtual

Reimplemented in RefObjectSet< T >.

◆ empty()

template<class T >
bool ObjectSet< T >::empty ( ) const
inline

◆ end() [1/2]

template<class T >
iterator ObjectSet< T >::end ( )
inline

◆ end() [2/2]

template<class T >
const_iterator ObjectSet< T >::end ( ) const
inline

◆ erase()

template<class T >
virtual void ObjectSet< T >::erase ( )
inlinevirtual

Implements OD::Set.

Reimplemented in ManagedObjectSetBase< T >.

◆ first() [1/2]

template<class T >
T * ObjectSet< T >::first
inline

◆ first() [2/2]

template<class T >
const T * ObjectSet< T >::first
inline

◆ get() [1/3]

template<class T >
T * ObjectSet< T >::get ( const T *  t) const
inlinevirtual

check & unconst

◆ get() [2/3]

template<class T >
T * ObjectSet< T >::get ( idx_type  vidx)
inlinevirtual

◆ get() [3/3]

template<class T >
const T * ObjectSet< T >::get ( idx_type  vidx) const
inlinevirtual

◆ getIdx() [1/2]

template<class T >
idx_type ObjectSet< T >::getIdx ( const_iterator  it) const
inline

◆ getIdx() [2/2]

template<class T >
idx_type ObjectSet< T >::getIdx ( iterator  it) const
inline

◆ indexOf()

template<class T >
ObjectSet< T >::idx_type ObjectSet< T >::indexOf ( const T *  ptr) const
inlinevirtual

◆ insertAfter()

template<class T >
void ObjectSet< T >::insertAfter ( T *  newptr,
idx_type  vidx 
)
inlinevirtual

◆ insertAt()

template<class T >
void ObjectSet< T >::insertAt ( T *  newptr,
idx_type  vidx 
)
inlinevirtual

Reimplemented in RefObjectSet< T >.

◆ isManaged()

template<class T >
virtual bool ObjectSet< T >::isManaged ( ) const
inlinevirtual

Reimplemented in ManagedObjectSetBase< T >.

◆ isPresent()

template<class T >
bool ObjectSet< T >::isPresent ( const T *  ptr) const
inlinevirtual

◆ last() [1/2]

template<class T >
T * ObjectSet< T >::last
inline

◆ last() [2/2]

template<class T >
const T * ObjectSet< T >::last
inline

◆ max_size()

template<class T >
size_type ObjectSet< T >::max_size ( ) const
inline

◆ nrItems()

template<class T >
virtual int64_t ObjectSet< T >::nrItems ( ) const
inlinevirtual

Implements OD::Set.

◆ nullAllowed()

template<class T >
bool ObjectSet< T >::nullAllowed ( ) const
inline

◆ operator!=()

template<class T >
bool ObjectSet< T >::operator!= ( const ObjectSet< T > &  oth) const
inline

◆ operator+=()

template<class T >
ObjectSet& ObjectSet< T >::operator+= ( T *  t)
inline

◆ operator-=()

template<class T >
ObjectSet< T > & ObjectSet< T >::operator-= ( T *  ptr)
inlinevirtual

Reimplemented in ManagedObjectSetBase< T >.

◆ operator=()

template<class T >
ObjectSet< T > & ObjectSet< T >::operator= ( const ObjectSet< T > &  oth)
inline

◆ operator==()

template<class T >
bool ObjectSet< T >::operator== ( const ObjectSet< T > &  oth) const
inline

◆ operator[]() [1/3]

template<class T >
const T* ObjectSet< T >::operator[] ( const T *  t) const
inline

◆ operator[]() [2/3]

template<class T >
T* ObjectSet< T >::operator[] ( idx_type  i)
inline

◆ operator[]() [3/3]

template<class T >
const T* ObjectSet< T >::operator[] ( idx_type  i) const
inline

◆ plainErase()

template<class T >
void ObjectSet< T >::plainErase ( )
inline

Not virtual. Don't use casually.

◆ pop()

template<class T >
T * ObjectSet< T >::pop
inlinevirtual

◆ push()

template<class T >
void ObjectSet< T >::push ( T *  t)
inline

◆ removeRange()

template<class T >
void ObjectSet< T >::removeRange ( idx_type  from,
idx_type  to 
)
inlinevirtual

Reimplemented in ManagedObjectSetBase< T >.

◆ removeSingle()

template<class T >
T * ObjectSet< T >::removeSingle ( idx_type  vidx,
bool  keep_order = true 
)
inlinevirtual
Returns
the removed pointer.

Reimplemented in ManagedObjectSetBase< T >.

◆ replace()

template<class T >
T * ObjectSet< T >::replace ( idx_type  vidx,
T *  newptr 
)
inlinevirtual

◆ reverse()

template<class T >
void ObjectSet< T >::reverse
inlinevirtual

Implements OD::Set.

◆ setNullAllowed()

template<class T >
void ObjectSet< T >::setNullAllowed ( bool  yn = true)
inline

◆ size()

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

◆ swap() [1/2]

template<class T >
void ObjectSet< T >::swap ( idx_type  idx1,
idx_type  idx2 
)
inline

◆ swap() [2/2]

template<class T >
void ObjectSet< T >::swap ( ObjectSet< T > &  oth)
inline

◆ swapItems()

template<class T >
virtual void ObjectSet< T >::swapItems ( int64_t  i1,
int64_t  i2 
)
inlinevirtual

Implements OD::Set.

◆ useIndexes()

template<class T >
void ObjectSet< T >::useIndexes ( const idx_type idxs)
inline

◆ validIdx()

template<class T >
bool ObjectSet< T >::validIdx ( int64_t  vidx) const
inlinevirtual

Implements OD::Set.

Member Data Documentation

◆ allow0_

template<class T >
bool ObjectSet< T >::allow0_ = false
protected

◆ vec_

template<class T >
impl_type ObjectSet< T >::vec_
protected

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