00001 /* 00002 * This file is part of openMask © INRIA, CNRS, Universite de Rennes 1 1993-2002, thereinafter the Software 00003 * 00004 * The Software has been developped within the Siames Project. 00005 * INRIA, the University of Rennes 1 and CNRS jointly hold intellectual property rights 00006 * 00007 * The Software has been registered with the Agence pour la Protection des 00008 * Programmes (APP) under registration number IDDN.FR.001.510008.00.S.P.2001.000.41200 00009 * 00010 * This file may be distributed under the terms of the Q Public License 00011 * version 1.0 as defined by Trolltech AS of Norway and appearing in the file 00012 * LICENSE.QPL included in the packaging of this file. 00013 * 00014 * Licensees holding valid specific licenses issued by INRIA, CNRS or Université de Rennes 1 00015 * for the software may use this file in accordance with that specific license 00016 * 00017 */ 00018 #ifndef PsSensitiveInputAliasHEADER 00019 #define PsSensitiveInputAliasHEADER 00020 00021 #include <PsnSensitiveInputNT.h> 00022 #include <PsInputAlias.h> 00023 00024 00025 //----------------------------------------------------------------- 00026 00033 template <typename Type> 00034 class PsSensitiveInputAlias : public PsnSensitiveInputNT, public PsInputAlias <Type> 00035 { 00036 public: 00037 00044 PsSensitiveInputAlias (const PsName & sensitiveInputAliasName, 00045 PsSimulatedObject & owner, 00046 PsAbstractInput<Type> * aliasedInput, 00047 const int requestedPrecisionLevel=PsPolatorNT::defaultPrecisionLevel) 00048 : PsInputAlias<Type>(sensitiveInputAliasName, 00049 owner, 00050 aliasedInput, 00051 requestedPrecisionLevel) 00052 { 00053 _changed = true; 00054 }; 00055 00057 virtual ~PsSensitiveInputAlias (void) 00058 { 00059 }; 00060 00063 virtual bool valueChanged( bool keepChanged = false ) { 00064 if (_changed) { 00065 _changed = keepChanged ; 00066 return true; 00067 } 00068 else return false; 00069 } 00070 00072 virtual void signalChange() 00073 { 00074 #ifdef _DEBUGALIAS 00075 cerr<<"PsSensitiveInputAlias<Type>::signalChange()"<<endl; 00076 #endif 00077 _changed = true ; 00078 #ifdef _TYPENAMENOTIMPLICIT 00079 typename 00080 #endif 00081 list<PsInputAlias<Type> *>::iterator i; 00082 for (i = _listOfAliases.begin(); 00083 i != _listOfAliases.end(); 00084 i++) 00085 { 00086 #ifdef _DEBUGALIAS 00087 cerr<<"PsSensitiveInputAlias<Type>::signalChange() : je vais prévenir un de mes alias"<<(*i)<<endl; 00088 #endif 00089 PsnSensitiveInputNT * sensitiveInput = dynamic_cast<PsnSensitiveInputNT *>(*i) ; 00090 if ( sensitiveInput != NULL ) 00091 { 00092 sensitiveInput->signalChange(); 00093 } 00094 #ifdef _DEBUGALIAS 00095 cerr<<"PsSensitiveInputAlias<Type>::signalChange() : j'ai prévenu un de mes alias"<<endl; 00096 #endif 00097 } 00098 } 00099 00100 protected: 00101 } ; 00102 00103 00104 #endif 00105
| Documentation generated on Mon Nov 25 15:25:02 2002 |
Generated with doxygen 1.2.12 by Dimitri van Heesch , 1997-2001 |