#include <PsSensitiveInput.h>
Inheritance diagram for PsSensitiveInput< Type >:


Public Methods | |
| PsSensitiveInput (const PsName &inputName, PsSimulatedObject &owner, bool makeConnectable, const int precisionLevel=PsPolatorNT::defaultPrecisionLevel) | |
| Constructor. | |
| virtual | ~PsSensitiveInput (void) |
| destructor | |
| virtual void | disconnect () |
| disconnect this input | |
| virtual bool | valueChanged (bool keepChanged=false) |
| test to see if value has changed WARNING : this method isn't const : it only return's true once. | |
| virtual void | signalChange () |
| called by the connected output when it's value has changed | |
Protected Methods | |
| virtual bool | internalConnect (PsOutputNT *output) |
| the real connecting member function | |
The template parameter must be of a derived type of PsType
Definition at line 35 of file PsSensitiveInput.h.
|
||||||||||||||||||||||||
|
Constructor.
Definition at line 87 of file PsSensitiveInput.h. References PsnSensitiveInputNT::_changed.
00091 : PsInput<Type>(nom, prop, makeConnectable, requestedPrecisionLevel) 00092 { 00093 _changed = true ; 00094 00095 } |
|
||||||||||
|
destructor
Definition at line 100 of file PsSensitiveInput.h. References PsSensitiveInput< Type >::disconnect().
00101 {
00102 #ifdef _DEBUGALIAS
00103 cerr<<"destruction"<<endl;
00104 #endif
00105 disconnect ();
00106 }
|
|
|||||||||
|
disconnect this input
Reimplemented from PsInput< Type >. Definition at line 151 of file PsSensitiveInput.h. References PsInput< Type >::_connectedOutput, and PsInput< Type >::disconnect(). Referenced by PsSensitiveInput< Type >::~PsSensitiveInput().
00151 {
00152 #ifdef _DEBUGALIAS
00153 cerr<<"disconnected output "<<_connectedOutput<<endl;
00154 #endif
00155 if (_connectedOutput!=NULL) {
00156 _connectedOutput->disconnectedMyself(this);
00157 }
00158 #ifdef _DEBUGALIAS
00159 cerr<<"output disconnected"<<endl;
00160 #endif
00161 PsInput<Type>::disconnect ();
00162 }
|
|
||||||||||
|
the real connecting member function
Definition at line 168 of file PsSensitiveInput.h. References PsOutputNT::connectedMyself(), and PsInput< Type >::realConnect().
00168 {
00169 if ( PsInput<Type>::realConnect( output ) )
00170 {
00171 output->connectedMyself (this) ;
00172 return true ;
00173 }
00174 else
00175 {
00176 return false ;
00177 }
00178 }
|
|
|||||||||
|
called by the connected output when it's value has changed
Implements PsnSensitiveInputNT. Reimplemented in PsSensitiveNotifyingInput< Type >. Definition at line 120 of file PsSensitiveInput.h. References PsnSensitiveInputNT::_changed, PsAbstractInput< Type >::_listOfAliases, list< PsInputAlias< Type > * >::begin(), list< PsInputAlias< Type > * >::end(), and PsnSensitiveInputNT::signalChange(). Referenced by PsSensitiveNotifyingInput< Type >::signalChange().
00121 {
00122 #ifdef _DEBUGALIAS
00123 cerr<<"PsSensitiveInput<Type>::signalChange()"<<endl;
00124 #endif
00125 _changed = true ;
00126 #ifdef _TYPENAMENOTIMPLICIT
00127 typename
00128 #endif
00129 list<PsInputAlias<Type> *>::iterator i;
00130 for (i = _listOfAliases.begin();
00131 i != _listOfAliases.end();
00132 i++)
00133 {
00134 #ifdef _DEBUGALIAS
00135 cerr<<"PsSensitiveInput<Type>::signalChange() : alias going to be notified of change "<<(*i)<<endl;
00136 #endif
00137 PsnSensitiveInputNT * sensitiveInput = dynamic_cast<PsnSensitiveInputNT *>(*i) ;
00138 if ( sensitiveInput != NULL )
00139 {
00140 sensitiveInput->signalChange();
00141 }
00142 #ifdef _DEBUGALIAS
00143 cerr<<"PsSensitiveInput<Type>::signalChange() : alias notified of change "<<endl;
00144 #endif
00145 }
00146 }
|
|
||||||||||
|
test to see if value has changed WARNING : this method isn't const : it only return's true once.
Implements PsnSensitiveInputNT. Definition at line 109 of file PsSensitiveInput.h. References PsnSensitiveInputNT::_changed.
00110 {
00111 if (_changed) {
00112 _changed = keepChanged ;
00113 return true;
00114 }
00115 else return false;
00116 }
|
| Documentation generated on Mon Nov 25 15:26:26 2002 |
Generated with doxygen 1.2.12 by Dimitri van Heesch , 1997-2001 |