24 template <
class IDT,
class T>
34 size_type
size()
const {
return vals_.size(); }
35 void set( IDT id, T val );
38 bool get( IDT id, T& val )
const;
44 const IDT&
id( size_type idx )
const {
return ids_[idx]; }
45 const T&
val( size_type idx )
const {
return vals_[idx]; }
48 void erase() { vals_.erase(); ids_.erase(); }
58 template <
class IDT,
class T>
inline 64 template <
class IDT,
class T>
inline 74 vals_.insert( newpos, theval );
77 vals_[newpos] = theval;
81 template <
class IDT,
class T>
inline 94 template <
class IDT,
class T>
inline 99 if ( pos==-1 )
return false;
101 vals_.removeSingle( pos );
125 void set(id_type,T*);
128 const T*
get(id_type)
const;
135 id_type
id( size_type pos )
const {
return ids_[pos]; }
137 bool remove(id_type
id);
138 void removePos(size_type);
150 template <
class T>
inline 160 vals_.insertAt( val, newpos );
163 vals_.replace( newpos, val );
167 template <
class T>
inline 171 return pos < 0 ? 0 :
vals_[pos];
175 template <
class T>
inline 179 return pos < 0 ? 0 :
vals_[pos];
183 template <
class T>
inline 187 if ( pos==-1 )
return false;
189 vals_.removeSingle( pos );
196 template <
class T>
inline 199 vals_.removeSingle( pos );
204 template <
class T>
inline size_type size() const
Definition: sortedtable.h:124
size_type size() const
Definition: sortedtable.h:34
ObjectSet< T > vals_
Definition: sortedtable.h:143
const T * getByPos(size_type pos) const
Definition: sortedtable.h:131
int size_type
Definition: sortedtable.h:118
void erase()
Definition: sortedtable.h:205
void removePos(size_type)
Definition: sortedtable.h:197
TypeSet< T > vals_
Definition: sortedtable.h:52
A SortedTable keeps track of ids and their corresponding values. Each id can only be present once...
Definition: sortedtable.h:25
void removeSingle(size_type)
Definition: sortedlist.h:218
Set of pointers to objects.
Definition: commontypes.h:32
size_type indexOf(const T &) const
Definition: sortedlist.h:120
SortedList< size_type > ids_
Definition: sortedtable.h:144
Set of (small) copyable elements.
Definition: commontypes.h:30
void set(IDT id, T val)
Definition: sortedtable.h:65
const T * get(id_type) const
Definition: sortedtable.h:168
int id_type
Definition: sortedtable.h:119
SortedList< IDT > ids_
Definition: sortedtable.h:53
T * getByPos(size_type pos)
Definition: sortedtable.h:132
T object_type
Definition: sortedtable.h:30
SortedTable()
Definition: sortedtable.h:59
A SortedPointers keeps track of ids and their corresponding pointer. Each id can only be present once...
Definition: sortedtable.h:114
id_type id(size_type pos) const
Definition: sortedtable.h:135
int size_type
Definition: sortedtable.h:29
void set(id_type, T *)
Definition: sortedtable.h:151
void erase()
Definition: sortedtable.h:48
bool get(IDT id, T &val) const
Definition: sortedtable.h:82
void erase()
Definition: sortedlist.h:61
bool remove(IDT id)
Definition: sortedtable.h:95
const IDT & id(size_type idx) const
Definition: sortedtable.h:44
#define mClass(module)
Definition: commondefs.h:164
~SortedPointers()
Definition: sortedtable.h:122
SortedPointers()
Definition: sortedtable.h:121
const T & val(size_type idx) const
Definition: sortedtable.h:45
bool remove(id_type id)
Definition: sortedtable.h:184