#include <param.h>


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 |
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.
Definition at line 323 of file param.h.
| ParamUpdater< SC >::ParamUpdater | ( | bool(SC::*)(void) | updateFuncPtr | ) | [inline] |
| ParamUpdater< SC >::ParamUpdater | ( | const ParamUpdater< SC > & | PU | ) | [inline] |
Definition at line 335 of file param.h.
00336 { 00337 _params.assign(PU._params.begin(), PU._params.end()); 00338 _myUpdaterFunction = PU._myUpdaterFunction; 00339 _myComponent = PU._myComponent; 00340 }
| 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.
00367 {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.
00350 { 00351 _myComponent = dynamic_cast<SC*> ( (*_params.begin())->getOwner() ); 00352 00353 for(PIT pit = ++_params.begin(); pit != _params.end(); pit++) 00354 assert(_myComponent == (*pit)->getOwner()); 00355 }
| void ParamUpdater< SC >::setFuncPtr | ( | bool(SC::*)(void) | updateFuncPtr | ) | [inline] |
Sets the pointer to the updating function.
Definition at line 362 of file param.h.
00363 { 00364 _myUpdaterFunction = updateFuncPtr; 00365 }
| 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.
00358 { 00359 return ((( dynamic_cast<SC*> (_myComponent))->*_myUpdaterFunction) ()); 00360 }
SC* ParamUpdater< SC >::_myComponent [private] |
Definition at line 326 of file param.h.
Referenced by ParamUpdater< SC >::getComponent(), ParamUpdater< SC >::init(), ParamUpdater< SC >::ParamUpdater(), and ParamUpdater< SC >::update().
bool(SC::* ParamUpdater< SC >::_myUpdaterFunction)(void) [private] |
Referenced by ParamUpdater< SC >::ParamUpdater().
1.5.8 -- Nemo is hosted by