#include <PsGenericControlParameter.h>
Inheritance diagram for PsGenericControlParameter< Type, AncestorClass >:


Public Methods | |
| PsGenericControlParameter (const PsName &attributeName, PsSimulatedObject &owner, const int historyLength, PsPolatorNT *polator) | |
| Constructor. | |
| virtual | ~PsGenericControlParameter (void) |
| Destructor. | |
| virtual const Type & | get (int &distanceToExactValue, const int precisionLevel, const PsDate &deltaT, Type &calculatedResult) const |
| redefined to avoid unecessary warnings because of the partial overide of get | |
| virtual const Type & | get (void) const |
| get the last approved value of this control parameter | |
| virtual const Type & | getLastExactValue (void) const |
| get the last approved value of this control parameter | |
| virtual const PsDate & | getDateOfLastExactValue (void) const |
| get the date of the last approved value of this control parameter | |
| virtual void | set (const Type &val) |
| suggest a new value to this control parameter | |
| virtual void | extract (istream &=cin) |
| extract from an input stream | |
| virtual void | unpack (PsIncomingSynchronisationMessage &) |
| unpack from a message | |
| virtual void | pack (PsOutgoingSynchronisationMessage &) const |
| pack in a message | |
| virtual void | insertInStream (ostream &=cout) const |
| insert in an output stream | |
| virtual void | printDebuggingInformation (ostream &err) const |
| print any usefull debugging information | |
| virtual bool | connect (const PsName &objectName, const PsName &inputName) |
| connect the control parameter to a public input of another object | |
| virtual bool | connect (PsSimulatedObject &object, const PsName &inputName) |
| connect the control parameter to a public input of another object | |
| virtual bool | connect (PsSimulatedObject *pointerToObject, const PsName &inputName) |
| connect the control parameter to a public input of another object | |
Protected Methods | |
| virtual void | realSet (const Type &val) |
| really change the value in the history | |
Protected Attributes | |
| PsChangedControlParameterEventListener< Type > * | _associatedEventListener |
| the default event listener reacting to changes suggested on that control parameter | |
A control parameter is, with openMask 3.0 an output that accepts new value from all simulated objects. Therefore, control parameters are implemented has inehriting from outputs and the control parameter interface. As outputs can be redefined for better distribution, a generic control parameter inherits from it's second template parameter, wich should itself inherit from PsOutput<Type>, wher type is the first template parameter
Definition at line 35 of file PsGenericControlParameter.h.
|
||||||||||||||||||||||||
|
Constructor.
Definition at line 128 of file PsGenericControlParameter.h. References PsGenericControlParameter< Type, AncestorClass >::_associatedEventListener, and PsSimulatedObject::addEventListener().
00132 : 00133 PsAttribute (owner, controlParameterName), 00134 AncestorClass (controlParameterName, 00135 owner, 00136 historyLength, 00137 polator), 00138 PsControlParameter<Type> (owner, 00139 controlParameterName, 00140 PsString("ChangedControlParameter::")+controlParameterName.getCString() ) 00141 { 00142 _associatedEventListener = new PsChangedControlParameterEventListener<Type>(owner, *this ) ; 00143 owner.addEventListener( *_associatedEventListener ) ; |
|
||||||||||
|
Destructor.
Definition at line 148 of file PsGenericControlParameter.h. References PsGenericControlParameter< Type, AncestorClass >::_associatedEventListener.
00150 {
00151 delete _associatedEventListener ;
|
|
||||||||||||||||
|
connect the control parameter to a public input of another object
Implements PsControlParameter< Type >. Definition at line 273 of file PsGenericControlParameter.h.
00275 {
00276 return AncestorClass::connect (pointerToObject, inputName) ;
|
|
||||||||||||||||
|
connect the control parameter to a public input of another object
Implements PsControlParameter< Type >. Definition at line 266 of file PsGenericControlParameter.h.
00268 {
00269 return AncestorClass::connect (object, inputName) ;
|
|
||||||||||||||||
|
connect the control parameter to a public input of another object
Implements PsControlParameter< Type >. Definition at line 259 of file PsGenericControlParameter.h.
00261 {
00262 return AncestorClass::connect (objectName, inputName) ;
|
|
||||||||||
|
extract from an input stream
Implements PsAttribute. Definition at line 195 of file PsGenericControlParameter.h.
00197 {
00198 /*thread safety assessement :
00199 As thread safe as localInsert
00200 */
00201 AncestorClass::extract ( in ) ;
|
|
||||||||||
|
get the last approved value of this control parameter
Implements PsControlParameter< Type >. Definition at line 240 of file PsGenericControlParameter.h.
00242 {
00243 return AncestorClass::getLastExactValue ( ) ;
|
|
||||||||||||||||||||||||
|
redefined to avoid unecessary warnings because of the partial overide of get
Definition at line 231 of file PsGenericControlParameter.h. References PsDate.
00236 {
00237 return AncestorClass::get(distanceToExactValue,precisionLevel,deltaT,calculatedResult );
|
|
||||||||||
|
get the date of the last approved value of this control parameter
Implements PsControlParameter< Type >. Definition at line 247 of file PsGenericControlParameter.h. References PsDate.
00249 {
00250 return AncestorClass::getDateOfLastExactValue ( ) ;
|
|
||||||||||
|
get the last approved value of this control parameter
Implements PsControlParameter< Type >. Definition at line 253 of file PsGenericControlParameter.h.
00255 {
00256 return AncestorClass::getLastExactValue ( ) ;
|
|
||||||||||
|
insert in an output stream
Implements PsAttribute. Definition at line 186 of file PsGenericControlParameter.h.
00188 {
00189 /*thread safety assessement :
00190 As thread safe as localInsert
00191 */
00192 AncestorClass::insertInStream ( out ) ;
|
|
||||||||||
|
pack in a message
Reimplemented from PsFlowable. Definition at line 205 of file PsGenericControlParameter.h.
00207 {
00208 /*thread safety assessement :
00209 As thread safe as localInsert
00210 */
00211 AncestorClass::pack ( out ) ;
|
|
||||||||||
|
print any usefull debugging information
Implements PsAttribute. Definition at line 224 of file PsGenericControlParameter.h.
00226 {
00227 AncestorClass::printDebuggingInformation( err ) ;
00228 err <<" Output is a control parameter "<<endl;
|
|
||||||||||
|
really change the value in the history
Implements PsControlParameter< Type >. Definition at line 174 of file PsGenericControlParameter.h. References PsAttribute::_owner, PsSimulatedObject::getObjectHandle(), and PsnObjectHandle::notifyChangeInControlParameter(). Referenced by PsGenericControlParameter< Type, AncestorClass >::set().
00176 {
00177 if ( _owner.getObjectHandle() != NULL )
00178 {//during initialisation phase, objectHandle of the owner can be null
00179 _owner.getObjectHandle()->notifyChangeInControlParameter (this) ;
00180 }
00181 AncestorClass::set(val) ;
|
|
||||||||||
|
suggest a new value to this control parameter
Implements PsControlParameter< Type >. Definition at line 156 of file PsGenericControlParameter.h. References PsAttribute::_owner, PsControlParameter< Type >::getAssociatedEventId(), PsnCurrentActiveObject::getCurrentActiveObject(), PsGenericControlParameter< Type, AncestorClass >::realSet(), and PsSimulatedObject::sendValuedEvent().
00158 {
00159 PsSimulatedObject * caller = PsnCurrentActiveObject::getCurrentActiveObject() ;
00160 if ( (caller != NULL) &&
00161 (caller != &_owner) )
00162 {
00163 caller->sendValuedEvent(_owner,getAssociatedEventId(),val) ;
00164 }
00165 else //probably in initialisation phase : suppose the owner is calling set with the initial value
00166 // warning: this is a security hole, because the currentActiveObject can easily be changed
00167 {
00168 realSet (val) ;
00169 }
|
|
||||||||||
|
unpack from a message
Reimplemented from PsFlowable. Definition at line 214 of file PsGenericControlParameter.h.
00216 {
00217 /*thread safety assessement :
00218 As thread safe as localInsert
00219 */
00220 AncestorClass::unpack ( in ) ;
|
|
|||||
|
the default event listener reacting to changes suggested on that control parameter
Definition at line 120 of file PsGenericControlParameter.h. Referenced by PsGenericControlParameter< Type, AncestorClass >::PsGenericControlParameter(), and PsGenericControlParameter< Type, AncestorClass >::~PsGenericControlParameter(). |
| Documentation generated on Mon Nov 25 15:26:02 2002 |
Generated with doxygen 1.2.12 by Dimitri van Heesch , 1997-2001 |