
#include <Component/ModelParam.H>
Collaboration diagram for ModelParamAuxImpl:

Definition at line 61 of file ModelParam.H.
Public Member Functions | |
| ModelParamAuxImpl (OptionedModelParam *self, const ModelOptionDef *def, ParamClient *client, const ParamFlag flags, const std::type_info &valtype) | |
| Construct from a ModelOptionDef*. | |
| ModelParamAuxImpl (ModelParamBase *self, const std::string &nam, ParamClient *client) | |
| Construct with a string name only. | |
| ~ModelParamAuxImpl () | |
| Destructor. | |
| std::string | getName () const |
| get the ModelParamAuxImpl's name | |
| const ModelOptionDef * | getOptionDef () const |
| get the associated option def | |
| void | printout (std::ostream &s, const std::string &prefix) const |
| Print out our name and contents, mostly for debugging. | |
| void | writeTo (ParamMap &pmap) const |
| Write parameter value to ParamMap. | |
| void | readFrom (const ParamMap &pmap, const bool noerr) |
| Get parameter value from ParamMap. | |
| ParamClient::ChangeStatus | sendChangedMessage (bool didchange) |
| Call paramChanged() on our client. | |
| pthread_mutex_t * | readLock () const |
| Get a mutex for locking the parameter value for reading. | |
| pthread_mutex_t * | writeLock () const |
| Get a mutex for locking the parameter value for writing. | |
Static Public Member Functions | |
| static const char * | defaultValueOf (const ModelOptionDef *def) |
| Convenience function to retrieve def->defval. | |
|
||||||||||||||||||||||||
|
Construct from a ModelOptionDef*. This model param will get its name from the ModelOptionDef*.
Definition at line 79 of file ModelParam.C. References ModelOptionType::argtype, ASSERT, rutz::demangled_name(), initMutex(), LFATAL, ModelOptionDef::name, ParamClient::registerOptionedParam(), and ModelOptionDef::type. |
|
||||||||||||||||
|
Construct with a string name only. This model param will NOT be associated with any ModelOptionDef -- to get that, use the other constructor that takes a ModelOptionDef* instead of a name.
Definition at line 120 of file ModelParam.C. References ASSERT, initMutex(), and ParamClient::registerParam(). |
|
|
Destructor.
Definition at line 145 of file ModelParam.C. References ASSERT, PLERROR, and ParamClient::unregisterParam(). |
|
|
Convenience function to retrieve def->defval. The reason we have this here is so that we don't have to include ModelOptionDef.H from this widely-used header file. Definition at line 235 of file ModelParam.C. References ModelOptionDef::defval. |
|
|
get the ModelParamAuxImpl's name
Definition at line 163 of file ModelParam.C. References ASSERT. Referenced by OModelParam< Point2D< int > >::getName(), and NModelParam< uint >::getName(). |
|
|
get the associated option def
Definition at line 171 of file ModelParam.C. References ASSERT. Referenced by OModelParam< Point2D< int > >::getOptionDef(). |
|
||||||||||||
|
Print out our name and contents, mostly for debugging.
Definition at line 181 of file ModelParam.C. References ASSERT, and ModelParamBase::getValString(). Referenced by OModelParam< Point2D< int > >::printout(), and NModelParam< uint >::printout(). |
|
||||||||||||
|
Get parameter value from ParamMap.
Definition at line 197 of file ModelParam.C. References ASSERT, ParamMap::CHANGED, ModelParamBase::getValString(), LERROR, ParamMap::MISSING, ParamMap::queryStringParam(), and ModelParamBase::setValString(). Referenced by OModelParam< Point2D< int > >::readFrom(), and NModelParam< uint >::readFrom(). |
|
|
Get a mutex for locking the parameter value for reading. We only return an actual mutex if we were passed ALLOW_ONLINE_CHANGES in our constructor (i.e., ModelParamBase::allowsOnlineChanges() returns true); that's because we assume that if online parameter changes are disabled, then there is no need for between-thread synchronization of our parameter value. The returned mutex, if non-null, will be a recursive mutex so that we can allow reentrant calls to getVal() from within a setVal() in the same thread, while still blocking getVal() calls from other threads during a setVal() call. Definition at line 138 of file ModelParam.H. Referenced by OModelParam< Point2D< int > >::getVal(), NModelParam< uint >::getVal(), OModelParam< Point2D< int > >::setVal(), and NModelParam< uint >::setVal(). |
|
|
Call paramChanged() on our client.
Definition at line 213 of file ModelParam.C. References LFATAL, ParamClient::paramChanged(), and status. Referenced by OModelParam< Point2D< int > >::setVal(), and NModelParam< uint >::setVal(). |
|
|
Get a mutex for locking the parameter value for writing. We only return an actual mutex if we were passed ALLOW_ONLINE_CHANGES in our constructor (i.e., ModelParamBase::allowsOnlineChanges() returns true); that's because we assume that if online parameter changes are disabled, then there is no need for between-thread synchronization of our parameter value. The returned mutex, if non-null, will be an error-checking mutex so that we can detect attempts to acquire the lock more than once from within the same thread. These attempts would represent reentrant setVal() calls, such as when setVal() triggers a paramChanged() call that in turn triggers another setVal() of the same parameter (which is forbidden by design). Definition at line 156 of file ModelParam.H. Referenced by OModelParam< Point2D< int > >::setVal(), and NModelParam< uint >::setVal(). |
|
|
Write parameter value to ParamMap.
Definition at line 189 of file ModelParam.C. References ASSERT, ModelParamBase::getValString(), and ParamMap::putStringParam(). Referenced by OModelParam< Point2D< int > >::writeTo(), and NModelParam< uint >::writeTo(). |
1.4.4