53 template <
class O,
class V>
62 void setParam(O* obj,
const V& val);
63 bool setParamIfValueIs(O* obj,
const V& curval,
const V& newval );
67 const V& getParam(
const O* obj)
const;
68 bool hasParam(
const O* obj)
const;
69 void removeParam(O* obj);
70 void removeAndDeleteParam(O* obj);
71 void deleteAndZeroPtrParam(O* obj);
83 template <
class O,
class V>
88 if ( objects_.size() )
90 std::cerr <<
"(PE) HiddenParam | Deleting a HiddenParam prematurely\n";
96 template <
class O,
class V>
100 const int idx = objects_.indexOf( obj );
112 template <
class O,
class V>
117 const int idx = objects_.indexOf( obj );
125 if ( params_[idx]==curval )
127 params_[idx] = newval;
135 template <
class O,
class V>
139 const int idx = objects_.indexOf( obj );
140 if ( !objects_.validIdx(idx) )
150 template <
class O,
class V>
154 return objects_.isPresent( obj );
158 template <
class O,
class V>
162 const int idx = objects_.indexOf( obj );
166 params_.removeSingle( idx );
167 objects_.removeSingle( idx );
171 template <
class O,
class V>
175 const int idx = objects_.indexOf( obj );
183 params_.removeSingle( idx );
184 objects_.removeSingle( idx );
188 template <
class O,
class V>
192 const int idx = objects_.indexOf( obj );
~HiddenParam()
Definition: hiddenparam.h:84
Locks the lock, shutting out access from other threads if needed.
Definition: threadlock.h:85
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class...
Definition: threadlock.h:53
Workaround manager when you cannot add class members to a class due to binary compability issues...
Definition: hiddenparam.h:54
TypeSet< V > params_
Definition: hiddenparam.h:76
void removeParam(O *obj)
Definition: hiddenparam.h:159
const V & getParam(const O *obj) const
Definition: hiddenparam.h:136
V undef_
Definition: hiddenparam.h:78
void removeAndDeleteParam(O *obj)
Definition: hiddenparam.h:172
Threads::Lock lock_
Definition: hiddenparam.h:77
ObjectSet< O > objects_
Definition: hiddenparam.h:75
void deleteAndZeroPtrParam(O *obj)
Definition: hiddenparam.h:189
bool hasParam(const O *obj) const
Definition: hiddenparam.h:151
#define mClass(module)
Definition: commondefs.h:164
void setParam(O *obj, const V &val)
Definition: hiddenparam.h:97
#define pErrMsg(msg)
Definition: errmsg.h:60
HiddenParam(const V &undefval)
Definition: hiddenparam.h:57
bool setParamIfValueIs(O *obj, const V &curval, const V &newval)
Definition: hiddenparam.h:113