|
Nemo
2.2.0
|
Implementation of the ParamUpdaterBase interface. More...
#include <param.h>
Inheritance diagram for ParamUpdater< SC >:
Collaboration diagram for ParamUpdater< SC >:Public Member Functions | |
| ParamUpdater (bool(SC::*updateFuncPtr)(void)) | |
| ParamUpdater (const ParamUpdater< SC > &PU) | |
| virtual | ~ParamUpdater () |
| virtual void | init () |
| Sets the pointer to the SimComponent. | |
| virtual bool | update (unsigned int generation) |
| Calls the SimComponent's updating function using its pointer. | |
| void | setFuncPtr (bool(SC::*updateFuncPtr)(void)) |
| Sets the pointer to the updating function. | |
| virtual SC * | getComponent () |
| Accessor to the SimCimponent. | |
Private Attributes | |
| bool(SC::* | _myUpdaterFunction )(void) |
| SC * | _myComponent |
Implementation of the ParamUpdaterBase interface.
Stores the pointers to the SimComponent and its updating function. The template argument allows to pass SimComponent class type necessary to call the updating function. The updating procedure is as follow: the parameters are first updated with their generational values (if the generation matches) and the component's is then updated using its updating function. The updating process is implemented in the UpdaterServices class. Several parameters may want to use the same updating function and thus this class allows to run that function only once, after updating all the parameters that use it.
| ParamUpdater< SC >::ParamUpdater | ( | bool(SC::*)(void) | updateFuncPtr | ) | [inline] |
Definition at line 330 of file param.h.
{
_myUpdaterFunction = updateFuncPtr;
}
| ParamUpdater< SC >::ParamUpdater | ( | const ParamUpdater< SC > & | PU | ) | [inline] |
Definition at line 335 of file param.h.
References ParamUpdater< SC >::_myComponent, ParamUpdater< SC >::_myUpdaterFunction, and ParamUpdaterBase::_params.
{
_params.assign(PU._params.begin(), PU._params.end());
_myUpdaterFunction = PU._myUpdaterFunction;
_myComponent = PU._myComponent;
}
| virtual ParamUpdater< SC >::~ParamUpdater | ( | ) | [inline, virtual] |
| virtual SC* ParamUpdater< SC >::getComponent | ( | ) | [inline, virtual] |
Accessor to the SimCimponent.
Implements ParamUpdaterBase.
Definition at line 367 of file param.h.
{return _myComponent;}
| virtual void ParamUpdater< SC >::init | ( | ) | [inline, virtual] |
Sets the pointer to the SimComponent.
It is deduced from the parameters' owner.
Implements ParamUpdaterBase.
Definition at line 349 of file param.h.
{
_myComponent = dynamic_cast<SC*> ( (*_params.begin())->getOwner() );
for(PIT pit = ++_params.begin(); pit != _params.end(); pit++)
assert(_myComponent == (*pit)->getOwner());
}
| void ParamUpdater< SC >::setFuncPtr | ( | bool(SC::*)(void) | updateFuncPtr | ) | [inline] |
Sets the pointer to the updating function.
Definition at line 362 of file param.h.
{
_myUpdaterFunction = updateFuncPtr;
}
| virtual bool ParamUpdater< SC >::update | ( | unsigned int | generation | ) | [inline, virtual] |
Calls the SimComponent's updating function using its pointer.
Implements ParamUpdaterBase.
Definition at line 357 of file param.h.
{
return ((( dynamic_cast<SC*> (_myComponent))->*_myUpdaterFunction) ());
}
SC* ParamUpdater< SC >::_myComponent [private] |
Definition at line 326 of file param.h.
Referenced by ParamUpdater< SC >::ParamUpdater().
bool(SC::* ParamUpdater< SC >::_myUpdaterFunction)(void) [private] |
Definition at line 325 of file param.h.
Referenced by ParamUpdater< SC >::ParamUpdater().
1.7.5.1 -- Nemo is hosted by