OpendTect  6.6
objectset.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Bert / many others
8  Date: Apr 1995 / Feb 2009
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "odset.h"
15 #include "vectoraccess.h"
16 #ifdef __debug__
17 # include "debug.h"
18 #endif
19 
20 
33 template <class T>
34 mClass(Basic) ObjectSet : public OD::Set
35 {
36 public:
37 
38  typedef int size_type;
40  typedef T object_type;
41 
42  inline ObjectSet();
43  inline explicit ObjectSet(T*);
44  inline explicit ObjectSet(T*,T*);
45  inline explicit ObjectSet(T*,T*,T*);
46  inline ObjectSet(const ObjectSet&);
47  inline virtual ~ObjectSet() {}
48  inline ObjectSet& operator=(const ObjectSet&);
49  virtual bool isManaged() const { return false; }
50  virtual ObjectSet* clone() const
51  { return new ObjectSet(*this); }
52 
53  inline bool nullAllowed() const { return allow0_; }
54  inline void setNullAllowed(bool yn=true);
55  inline size_type size() const { return vec_.size(); }
56  inline virtual od_int64 nrItems() const { return size(); }
57 
58  inline virtual bool validIdx(od_int64) const;
59  inline virtual bool isPresent(const T*) const;
60  inline virtual idx_type indexOf(const T*) const;
61  inline virtual T* get(idx_type);
62  inline virtual const T* get(idx_type) const;
63  inline virtual T* get(const T*) const;
64  inline T* first();
65  inline const T* first() const;
66  inline T* last();
67  inline const T* last() const;
68 
69  inline ObjectSet& add( T* t ) { return doAdd(t); }
70  inline void push( T* t ) { doAdd( t ); }
71  inline bool addIfNew(T*);
72  inline virtual T* replace(idx_type,T*);
73  inline virtual void insertAt(T* newptr,idx_type);
74  inline virtual void insertAfter(T* newptr,idx_type);
75  inline void swap(idx_type,idx_type);
76  inline void useIndexes(const idx_type*);
77 
78  inline virtual void copy(const ObjectSet&);
79  inline virtual void append(const ObjectSet&);
80  inline virtual void swapItems( od_int64 i1, od_int64 i2 )
81  { swap( (idx_type)i1, (idx_type)i2 ); }
82  inline virtual void reverse();
83 
84 
85  inline virtual void erase() { plainErase(); }
86  inline virtual T* pop();
87  virtual inline T* removeSingle(idx_type,bool keep_order=true);
89  virtual void removeRange(idx_type from,idx_type to);
90 
91  inline ObjectSet& operator +=( T* t ) { return doAdd( t ); }
92  inline T* operator[]( idx_type i ) {return get(i);}
93  inline const T* operator[]( idx_type i ) const {return get(i);}
94  inline const T* operator[]( const T* t ) const {return get(t);}
95  virtual ObjectSet& operator -=(T*);
96 
97 protected:
98 
101  bool allow0_ = false;
102 
103  inline virtual ObjectSet& doAdd(T*);
104 
105 public:
106 
107  inline void plainErase() { vec_.erase(); }
109  inline void allowNull( bool yn=true )
110  { setNullAllowed(yn); }
111 
112  // Compat with std containers
113  typedef T* value_type;
115  typedef const value_type& const_reference;
116  typedef typename impl_type::iterator iterator;
119 
120  iterator begin() { return vec_.begin(); }
121  const_iterator begin() const { return vec_.cbegin(); }
122  const_iterator cbegin() const { return vec_.cbegin(); }
123  iterator end() { return vec_.end(); }
124  const_iterator end() const { return vec_.cend(); }
125  const_iterator cend() const { return vec_.cend(); }
126  inline size_type max_size() const { return maxIdx32(); }
127  inline bool empty() const { return isEmpty(); }
128  inline bool operator==(const ObjectSet&) const;
129  inline bool operator!=( const ObjectSet& oth ) const
130  { return !(oth == *this); }
131  inline void swap( ObjectSet& oth )
132  { vec_.swap(oth.vec_); }
133 
134  // Usability
135  idx_type getIdx( iterator it ) const { return vec_.getIdx(it); }
136  idx_type getIdx( const_iterator it ) const { return vec_.getIdx(it); }
137 
138 };
139 
140 
141 #define mObjectSetApplyToAll( os, op ) \
142  mODSetApplyToAll( ObjectSet<int>::size_type, os, op )
143 
144 #define mObjectSetApplyToAllFunc( fn, op, extra ) \
145 template <class T> \
146 inline void fn( ObjectSet<T>& os ) \
147 { \
148  mObjectSetApplyToAll( os, op ); \
149  extra; \
150 }
151 
152 
154 template <class T>
155 inline void deepErase( ObjectSet<T>& os )
156 {
157  for ( auto obj : os )
158  delete obj;
159  os.plainErase();
160 }
161 
163 template <class T>
164 inline void deepEraseArr( ObjectSet<T>& os )
165 {
166  for ( auto obj : os )
167  delete [] obj;
168  os.plainErase();
169 }
170 
172 template <class T,class S>
173 inline void deepAppend( ObjectSet<T>& to, const ObjectSet<S>& from )
174 {
175  const int sz = from.size();
176  for ( int idx=0; idx<sz; idx++ )
177  to.add( from[idx] ? new T( *from[idx] ) : 0 );
178 }
179 
181 template <class T,class S>
182 inline void deepAppendClone( ObjectSet<T>& to, const ObjectSet<S>& from )
183 {
184  const int sz = from.size();
185  for ( int idx=0; idx<sz; idx++ )
186  to.add( from[idx] ? from[idx]->clone() : 0 );
187 }
188 
190 template <class T,class S>
191 inline void deepCopy( ObjectSet<T>& to, const ObjectSet<S>& from )
192 {
193  if ( &to == &from )
194  return;
195  deepErase( to );
196  to.setNullAllowed( from.nullAllowed() );
197  deepAppend( to, from );
198 }
199 
201 template <class T,class S>
202 inline void deepCopyClone( ObjectSet<T>& to, const ObjectSet<S>& from )
203 {
204  if ( &to == &from ) return;
205  deepErase( to );
206  to.setNullAllowed( from.nullAllowed() );
207  deepAppendClone( to, from );
208 }
209 
211 template <class T,class S>
212 inline typename ObjectSet<T>::idx_type indexOf( const ObjectSet<T>& os,
213  const S& val )
214 {
215  for ( typename ObjectSet<T>::idx_type idx=os.size()-1; idx>=0; idx-- )
216  {
217  const T* obj = os[idx];
218  if ( obj && *obj == val )
219  return idx;
220  }
221  return -1;
222 }
223 
225 template <class T,class S>
226 inline const T* find( const ObjectSet<T>& os, const S& val )
227 {
228  const typename ObjectSet<T>::idx_type idx = indexOf( os, val );
229  return idx == -1 ? 0 : os[idx];
230 }
231 
233 template <class T,class S>
234 inline T* find( ObjectSet<T>& os, const S& val )
235 {
236  const typename ObjectSet<T>::idx_type idx = indexOf( os, val );
237  return idx == -1 ? 0 : os[idx];
238 }
239 
241 template <class T>
243 {
244  const typename ObjectSet<T>::size_type sz = os.size();
245  for ( typename ObjectSet<T>::size_type d=sz/2; d>0; d=d/2 )
246  {
247  for ( typename ObjectSet<T>::idx_type i=d; i<sz; i++ )
248  {
249  for ( typename ObjectSet<T>::idx_type j=i-d; j>=0; j-=d )
250  {
251  T* o1 = os[j]; T* o2 = os[j+d];
252  if ( !o2 || o1 == o2 || (o1 && !(*o1 > *o2) ) )
253  break;
254  os.swap( j, j+d );
255  }
256  }
257  }
258 }
259 
261 template <class T>
262 inline void sort( ObjectSet<T>& os )
263 {
264  if ( os.nullAllowed() )
266  else
267  {
268  const typename ObjectSet<T>::size_type sz = os.size();
269  for ( typename ObjectSet<T>::size_type d=sz/2; d>0; d=d/2 )
270  {
271  for ( typename ObjectSet<T>::idx_type i=d; i<sz; i++ )
272  {
273  for ( typename ObjectSet<T>::idx_type j=i-d;
274  j>=0 && *os[j]>*os[j+d]; j-=d )
275  {
276  os.swap( j, j+d );
277  }
278  }
279  }
280  }
281 }
282 
284 template <class T>
285 inline bool equalObjects( const ObjectSet<T>& os1, const ObjectSet<T>& os2 )
286 {
287  typedef typename ObjectSet<T>::size_type IType;
288  const IType sz = os1.size();
289  if ( os2.size() != sz )
290  return false;
291 
292  for ( IType idx=0; idx<sz; idx++ )
293  if ( os1[idx] != os2[idx] )
294  return false;
295 
296  return true;
297 }
298 
300 template <class T>
301 inline bool equalContents( const ObjectSet<T>& os1, const ObjectSet<T>& os2 )
302 {
303  typedef typename ObjectSet<T>::size_type IType;
304  const IType sz = os1.size();
305  if ( os2.size() != sz )
306  return false;
307 
308  for ( IType idx=0; idx<sz; idx++ )
309  {
310  const T* o1 = os1[idx]; const T* o2 = os2[idx];
311  if ( !o1 && !o2 )
312  continue;
313  if ( !o1 || !o2 || (!(*o1 == *o2)) )
314  return false;
315  }
316  return true;
317 }
318 
319 
320 // Member function implementations
321 template <class T> inline
323 {}
324 
325 template <class T> inline
326 ObjectSet<T>::ObjectSet( T* t ) : allow0_(!t)
327 {
328  add( t );
329 }
330 
331 template <class T> inline
332 ObjectSet<T>::ObjectSet( T* t0, T* t1 ) : allow0_(!t0 || !t1)
333 {
334  add( t0 ).add( t1 );
335 }
336 
337 template <class T> inline
338 ObjectSet<T>::ObjectSet( T* t0, T* t1, T* t2 ) : allow0_(!t0 || !t1 || !t2)
339 {
340  add( t0 ).add( t1 ).add( t2 );
341 }
342 
343 template <class T> inline
345 { *this = t; }
346 
347 template <class T> inline
349 {
350  allow0_ = oth.allow0_;
351  copy( oth );
352  return *this;
353 }
354 
355 template <class T> inline
356 bool ObjectSet<T>::operator ==( const ObjectSet<T>& oth ) const
357 {
358  if ( this == &oth )
359  return true;
360  const size_type sz = size();
361  if ( sz != oth.size() )
362  return false;
363 
364  for ( idx_type vidx=sz-1; vidx!=-1; vidx-- )
365  if ( get(vidx) != oth.get(vidx) )
366  return false;
367  return true;
368 }
369 
370 template <class T> inline
372 {
373  if ( allow0_ != yn )
374  {
375  allow0_ = yn;
376  if ( !allow0_ )
377  {
378  for ( idx_type vidx=size()-1; vidx!=-1; vidx-- )
379  {
380  T* obj = (*this)[vidx];
381  if ( !obj )
382  removeSingle( vidx );
383  }
384  }
385  }
386 }
387 
388 template <class T> inline
390 { return vidx>=0 && vidx<size(); }
391 
392 template <class T> inline
394 {
395 #ifdef __debug__
396  if ( !validIdx(vidx) )
397  DBG::forceCrash(true);
398 #endif
399  return vec_[vidx];
400 }
401 
402 template <class T> inline
403 const T* ObjectSet<T>::get( idx_type vidx ) const
404 {
405 #ifdef __debug__
406  if ( !validIdx(vidx) )
407  DBG::forceCrash(true);
408 #endif
409  return vec_[vidx];
410 }
411 
412 template <class T> inline
413 T* ObjectSet<T>::get( const T* t ) const
414 {
415  const idx_type vidx = indexOf( t );
416  return vidx < 0 ? 0 : const_cast<T*>(t);
417 }
418 
419 template <class T> inline
420 typename ObjectSet<T>::idx_type ObjectSet<T>::indexOf( const T* ptr ) const
421 {
422  return vec_.indexOf( (T*)ptr, true );
423 }
424 
425 template <class T> inline
426 bool ObjectSet<T>::isPresent( const T* ptr ) const
427 {
428  return vec_.isPresent( (T*)ptr );
429 }
430 
431 template <class T> inline
433 {
434  if ( ptr || allow0_ )
435  vec_.push_back( ptr );
436  return *this;
437 }
438 
439 template <class T> inline
441 {
442  if ( ptr || allow0_ )
443  vec_.erase( ptr );
444  return *this;
445 }
446 
447 template <class T> inline
449 {
450  if ( !validIdx(idx1) || !validIdx(idx2) )
451  {
452 #ifdef __debug__
453  DBG::forceCrash(true);
454 #endif
455  return;
456  }
457  vec_.swapElems( idx1, idx2 );
458 }
459 
460 
461 template <class T> inline
463 {
464  const size_type sz = size();
465  if ( idxs && sz > 1 )
466  {
467  ObjectSet<T> tmp( *this );
468  for ( size_type idx=0; idx<sz; idx++ )
469  ObjectSet<T>::replace( idx, tmp.get(idxs[idx]) );
470  }
471 }
472 
473 template <class T> inline
475 {
476  const size_type sz = size();
477  const size_type hsz = sz/2;
478  for ( idx_type vidx=0; vidx<hsz; vidx++ )
479  swap( vidx, sz-1-vidx );
480 }
481 
482 template <class T> inline
483 T* ObjectSet<T>::replace( idx_type vidx, T* newptr )
484 {
485  if ( !validIdx(vidx) )
486 #ifdef __debug__
487  DBG::forceCrash(true);
488 #else
489  return 0;
490 #endif
491  T* ptr = static_cast<T*>( vec_[vidx] );
492  vec_[vidx] = newptr;
493  return ptr;
494 }
495 
496 template <class T> inline
497 void ObjectSet<T>::insertAt( T* newptr, idx_type vidx )
498 {
499  vec_.insert( vidx, newptr );
500 }
501 
502 template <class T> inline
503 void ObjectSet<T>::insertAfter( T* newptr, idx_type vidx )
504 {
505  add( newptr );
506  if ( vidx < 0 )
507  vec_.moveToStart( newptr );
508  else
509  vec_.moveAfter( newptr, vec_[vidx] );
510 }
511 
512 template <class T> inline
514 {
515  if ( &os != this )
516  {
517  erase();
518  allow0_ = os.allow0_;
519  append( os );
520  }
521 }
522 
523 template <class T> inline
525 {
526  const size_type sz = os.size();
527  vec_.setCapacity( size()+sz, true );
528  for ( idx_type vidx=0; vidx<sz; vidx++ )
529  add( const_cast<T*>( os[vidx] ) );
530 }
531 
532 template <class T> inline
534 { return static_cast<T*>( vec_.pop_back() ); }
535 
536 template <class T> inline
538 {
539  if ( isPresent(ptr) )
540  return false;
541 
542  add( ptr );
543  return true;
544 }
545 
546 template <class T> inline
547 T* ObjectSet<T>::removeSingle( idx_type vidx, bool kporder )
548 {
549  T* res = static_cast<T*>(vec_[vidx]);
550  if ( kporder )
551  vec_.remove( vidx );
552  else
553  {
554  const idx_type lastidx = size()-1;
555  if ( vidx!=lastidx )
556  vec_[vidx] = vec_[lastidx];
557  vec_.remove( lastidx );
558  }
559  return res;
560 }
561 
562 template <class T> inline
564 { vec_.remove( i1, i2 ); }
565 template <class T> inline T* ObjectSet<T>::first()
566 { return isEmpty() ? 0 : get( 0 ); }
567 template <class T> inline const T* ObjectSet<T>::first() const
568 { return isEmpty() ? 0 : get( 0 ); }
569 template <class T> inline T* ObjectSet<T>::last()
570 { return isEmpty() ? 0 : get( size()-1 ); }
571 template <class T> inline const T* ObjectSet<T>::last() const
572 { return isEmpty() ? 0 : get( size()-1 ); }
573 
574  //--- compat with std containers
575 
576 template <class T>
577 mGlobal(Basic) inline void swap( ObjectSet<T>& os1, ObjectSet<T>& os2 )
578 {
579  os1.swap( os2 );
580 }
581 
582  //--- useful for iterating over any OD::Set
583 template <class T>
584 mGlobal(Basic) inline T& getRef( ObjectSet<T>& objset, int i )
585 { return *objset.get( i ); }
586 template <class T>
587 mGlobal(Basic) inline const T& getRef( const ObjectSet<T>& objset, int i )
588 { return *objset.get( i ); }
ObjectSet::vec_
impl_type vec_
Definition: objectset.h:100
VectorAccess::cbegin
const_iterator cbegin() const
Definition: vectoraccess.h:50
ObjectSet::isManaged
virtual bool isManaged() const
Definition: objectset.h:49
VectorAccess::getIdx
idx_type getIdx(iterator it) const
Definition: vectoraccess.h:54
ObjectSet::operator==
bool operator==(const ObjectSet &) const
Definition: objectset.h:356
ObjectSet::begin
iterator begin()
Definition: objectset.h:120
ObjectSet::push
void push(T *t)
Definition: objectset.h:70
ObjectSet::ObjectSet
ObjectSet(T *, T *)
Definition: objectset.h:332
ObjectSet::removeRange
virtual void removeRange(idx_type from, idx_type to)
Definition: objectset.h:563
Conv::to
T to(const F &fr)
Definition: convert.h:34
indexOf
ObjectSet< T >::idx_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:212
mGlobal
#define mGlobal(module)
Definition: commondefs.h:180
sort
void sort(ObjectSet< T > &os)
Sort ObjectSet. Must have operator > defined for elements.
Definition: objectset.h:262
ObjectSet
Set of pointers to objects.
Definition: commontypes.h:31
ObjectSet::setNullAllowed
void setNullAllowed(bool yn=true)
Definition: objectset.h:371
ObjectSet::add
ObjectSet & add(T *t)
Definition: objectset.h:69
ObjectSet::operator[]
T * operator[](idx_type i)
Definition: objectset.h:92
ObjectSet::operator[]
const T * operator[](idx_type i) const
Definition: objectset.h:93
od_int64
#define od_int64
Definition: plftypes.h:35
VectorAccess< Projection *, size_type >::iterator
impl_type::iterator iterator
Definition: vectoraccess.h:45
ObjectSet::removeSingle
virtual T * removeSingle(idx_type, bool keep_order=true)
Definition: objectset.h:547
VectorAccess< T *, size_type >
ObjectSet::getIdx
idx_type getIdx(const_iterator it) const
Definition: objectset.h:136
ObjectSet::empty
bool empty() const
Definition: objectset.h:127
odset.h
ObjectSet::first
T * first()
Definition: objectset.h:565
ObjectSet::reverse
virtual void reverse()
Definition: objectset.h:474
ObjectSet::swap
void swap(ObjectSet &oth)
Definition: objectset.h:131
ObjectSet::reference
value_type & reference
Definition: objectset.h:114
ObjectSet::cend
const_iterator cend() const
Definition: objectset.h:125
getRef
T & getRef(ObjectSet< T > &objset, int i)
Definition: objectset.h:584
ObjectSet::insertAfter
virtual void insertAfter(T *newptr, idx_type)
Definition: objectset.h:503
ObjectSet::last
const T * last() const
Definition: objectset.h:571
ObjectSet::validIdx
virtual bool validIdx(int64_t) const
Definition: objectset.h:389
ObjectSet::getIdx
idx_type getIdx(iterator it) const
Definition: objectset.h:135
ObjectSet::end
iterator end()
Definition: objectset.h:123
ObjectSet::end
const_iterator end() const
Definition: objectset.h:124
deepAppend
void deepAppend(ObjectSet< T > &to, const ObjectSet< S > &from)
append copies of one set's objects to another ObjectSet.
Definition: objectset.h:173
ObjectSet::size
size_type size() const
Definition: objectset.h:55
ObjectSet::nullAllowed
bool nullAllowed() const
Definition: objectset.h:53
deepEraseArr
void deepEraseArr(ObjectSet< T > &os)
empty the ObjectSet deleting all array objects pointed to.
Definition: objectset.h:164
ObjectSet::allowNull
void allowNull(bool yn=true)
Definition: objectset.h:109
ObjectSet::impl_type
VectorAccess< T *, size_type > impl_type
Definition: objectset.h:99
isEmpty
bool isEmpty(const NLAModel *mdl)
ObjectSet::ObjectSet
ObjectSet(T *)
Definition: objectset.h:326
VectorAccess::cend
const_iterator cend() const
Definition: vectoraccess.h:53
deepCopyClone
void deepCopyClone(ObjectSet< T > &to, const ObjectSet< S > &from)
fill an ObjectSet with clones of the objects in the other set.
Definition: objectset.h:202
ObjectSet::pop
virtual T * pop()
Definition: objectset.h:533
ObjectSet::value_type
T * value_type
Definition: objectset.h:113
ObjectSet::isPresent
virtual bool isPresent(const T *) const
Definition: objectset.h:426
deepCopy
void deepCopy(ObjectSet< T > &to, const ObjectSet< S > &from)
fill an ObjectSet with copies of the objects in the other set.
Definition: objectset.h:191
ObjectSet::doAdd
virtual ObjectSet & doAdd(T *)
Definition: objectset.h:432
ObjectSet::operator[]
const T * operator[](const T *t) const
Definition: objectset.h:94
ObjectSet::~ObjectSet
virtual ~ObjectSet()
Definition: objectset.h:47
swap
void swap(ObjectSet< T > &os1, ObjectSet< T > &os2)
Definition: objectset.h:577
find
const T * find(const ObjectSet< T > &os, const S &val)
Get const object in set.
Definition: objectset.h:226
ObjectSet::copy
virtual void copy(const ObjectSet &)
Definition: objectset.h:513
ObjectSet::last
T * last()
Definition: objectset.h:569
mClass
#define mClass(module)
Definition: commondefs.h:181
VectorAccess< Projection *, size_type >::const_iterator
impl_type::const_iterator const_iterator
Definition: vectoraccess.h:46
VectorAccess::swap
void swap(VectorAccess &oth)
Definition: vectoraccess.h:120
ObjectSet::idx_type
size_type idx_type
Definition: objectset.h:39
ObjectSet::operator=
ObjectSet & operator=(const ObjectSet &)
Definition: objectset.h:348
ObjectSet::useIndexes
void useIndexes(const idx_type *)
Definition: objectset.h:462
ObjectSet::get
virtual T * get(const T *) const
check & unconst
Definition: objectset.h:413
ObjectSet::first
const T * first() const
Definition: objectset.h:567
ObjectSet::max_size
size_type max_size() const
Definition: objectset.h:126
vectoraccess.h
ObjectSet::nrItems
virtual int64_t nrItems() const
Definition: objectset.h:56
VectorAccess::end
iterator end()
Definition: vectoraccess.h:51
VectorAccess::begin
iterator begin()
Definition: vectoraccess.h:48
ObjectSet::swap
void swap(idx_type, idx_type)
Definition: objectset.h:448
ObjectSet::append
virtual void append(const ObjectSet &)
Definition: objectset.h:524
copy
void copy(OD::ValVec< T, IT > &to, const OD::ValVec< S, IT > &from)
Definition: typeset.h:255
ObjectSet::object_type
T object_type
Definition: objectset.h:40
deepErase
void deepErase(ObjectSet< T > &os)
empty the ObjectSet deleting all objects pointed to.
Definition: objectset.h:155
ObjectSet::operator-=
virtual ObjectSet & operator-=(T *)
Definition: objectset.h:440
ObjectSet::erase
virtual void erase()
Definition: objectset.h:85
ObjectSet::addIfNew
bool addIfNew(T *)
Definition: objectset.h:537
ObjectSet::size_type
int size_type
Definition: objectset.h:38
ObjectSet::ObjectSet
ObjectSet()
Definition: objectset.h:322
ObjectSet::plainErase
void plainErase()
Definition: objectset.h:107
deepAppendClone
void deepAppendClone(ObjectSet< T > &to, const ObjectSet< S > &from)
append clones of one set's objects to another ObjectSet.
Definition: objectset.h:182
ObjectSet::indexOf
virtual idx_type indexOf(const T *) const
Definition: objectset.h:420
ObjectSet::difference_type
size_type difference_type
Definition: objectset.h:118
ObjectSet::ObjectSet
ObjectSet(T *, T *, T *)
Definition: objectset.h:338
ObjectSet::const_iterator
impl_type::const_iterator const_iterator
Definition: objectset.h:117
_ObjectSet_sortWithNull
void _ObjectSet_sortWithNull(ObjectSet< T > &os)
Sort ObjectSet when nulls are allowed no need to call.
Definition: objectset.h:242
ObjectSet::begin
const_iterator begin() const
Definition: objectset.h:121
VectorAccess::erase
void erase()
Definition: vectoraccess.h:92
equalObjects
bool equalObjects(const ObjectSet< T > &os1, const ObjectSet< T > &os2)
See if all objects are equal.
Definition: objectset.h:285
ObjectSet::operator!=
bool operator!=(const ObjectSet &oth) const
Definition: objectset.h:129
ObjectSet::insertAt
virtual void insertAt(T *newptr, idx_type)
Definition: objectset.h:497
append
bool append(OD::ValVec< T, IT > &to, const OD::ValVec< S, J > &from)
append allowing a different type to be merged into set
Definition: typeset.h:239
ObjectSet::ObjectSet
ObjectSet(const ObjectSet &)
Definition: objectset.h:344
ObjectSet::allow0_
bool allow0_
Definition: objectset.h:101
ObjectSet::iterator
impl_type::iterator iterator
Definition: objectset.h:116
ObjectSet::cbegin
const_iterator cbegin() const
Definition: objectset.h:122
equalContents
bool equalContents(const ObjectSet< T > &os1, const ObjectSet< T > &os2)
See if all objects pointed to are equal.
Definition: objectset.h:301
DBG::forceCrash
void forceCrash(bool withdump)
ObjectSet::get
virtual T * get(idx_type)
Definition: objectset.h:393
ObjectSet::const_reference
const value_type & const_reference
Definition: objectset.h:115
ObjectSet::swapItems
virtual void swapItems(int64_t i1, int64_t i2)
Definition: objectset.h:80
ObjectSet::clone
virtual ObjectSet * clone() const
Definition: objectset.h:50
debug.h
ObjectSet::replace
virtual T * replace(idx_type, T *)
Definition: objectset.h:483
ObjectSet::get
virtual const T * get(idx_type) const
Definition: objectset.h:403
OD::Set
Base class for all sets used in OpendTect.
Definition: odset.h:33

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