 |
OpendTect
6.6
|
Go to the documentation of this file.
23 template <
class IDT,
class T>
34 void set( IDT
id, T val );
37 bool get( IDT
id, T& val )
const;
47 void erase() { vals_.erase(); ids_.erase(); }
57 template <
class IDT,
class T>
inline
63 template <
class IDT,
class T>
inline
66 int newpos = ids_.indexOf( theid );
72 newpos = ids_.indexOf( theid );
73 vals_.insert( newpos, theval );
76 vals_[newpos] = theval;
80 template <
class IDT,
class T>
inline
83 int pos = ids_.indexOf( theid );
93 template <
class IDT,
class T>
inline
96 int pos = ids_.indexOf( theid );
98 if ( pos==-1 )
return false;
100 vals_.removeSingle( pos );
124 void set(id_type,T*);
127 const T* get(id_type)
const;
137 void removePos(size_type);
149 template <
class T>
inline
152 const size_type newpos = ids_.indexOf( iid );
158 newpos = ids_.indexOf( iid );
159 vals_.insertAt( val, newpos );
162 vals_.replace( newpos, val );
166 template <
class T>
inline
169 const size_type pos = ids_.indexOf( iid );
170 return pos < 0 ? 0 : vals_[pos];
174 template <
class T>
inline
177 const size_type pos = ids_.indexOf( iid );
178 return pos < 0 ? 0 : vals_[pos];
182 template <
class T>
inline
185 const size_type pos = ids_.indexOf( iid );
186 if ( pos==-1 )
return false;
188 vals_.removeSingle( pos );
189 ids_.removeSingle( pos );
195 template <
class T>
inline
198 vals_.removeSingle( pos );
199 ids_.removeSingle( pos );
203 template <
class T>
inline
void set(id_type, T *)
Definition: sortedtable.h:150
TypeSet< T > vals_
Definition: sortedtable.h:51
~SortedPointers()
Definition: sortedtable.h:121
int id_type
Definition: sortedtable.h:118
const T * get(id_type) const
Definition: sortedtable.h:167
Set of pointers to objects.
Definition: commontypes.h:31
SortedList< size_type > ids_
Definition: sortedtable.h:143
int size_type
Definition: sortedtable.h:117
const T & val(size_type idx) const
Definition: sortedtable.h:44
void set(IDT id, T val)
Definition: sortedtable.h:64
SortedPointers()
Definition: sortedtable.h:120
size_type size() const
Definition: sortedtable.h:123
bool remove(const char *)
SortedTable()
Definition: sortedtable.h:58
bool remove(id_type id)
Definition: sortedtable.h:183
#define mClass(module)
Definition: commondefs.h:181
A SortedPointers keeps track of ids and their corresponding pointer. Each id can only be present once...
Definition: sortedtable.h:114
SortedList< IDT > ids_
Definition: sortedtable.h:52
T * getByPos(size_type pos)
Definition: sortedtable.h:131
void set(T &_to, const F &fr)
template based type conversion
Definition: convert.h:27
int size_type
Definition: sortedtable.h:28
A SortedTable keeps track of ids and their corresponding values. Each id can only be present once.
Definition: sortedtable.h:25
T object_type
Definition: sortedtable.h:29
void erase()
Definition: sortedtable.h:47
const IDT & id(size_type idx) const
Definition: sortedtable.h:43
bool get(IDT id, T &val) const
Definition: sortedtable.h:81
size_type size() const
Definition: sortedtable.h:33
ObjectSet< T > vals_
Definition: sortedtable.h:142
const T * getByPos(size_type pos) const
Definition: sortedtable.h:130
void erase()
Definition: sortedtable.h:204
void removePos(size_type)
Definition: sortedtable.h:196
id_type id(size_type pos) const
Definition: sortedtable.h:134
Sets of (small) copyable elements.
Definition: commontypes.h:29
bool remove(IDT id)
Definition: sortedtable.h:94
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021