Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

testObject.cxx

Go to the documentation of this file.
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 #include "PsSimulatedObject.h"
00019 
00020 #include "PsController.h"
00021 #include "PsInput.h"
00022 #include "PsInputAlias.h"
00023 #include "PsSensitiveInput.h"
00024 #include "PsSensitiveInputAlias.h"
00025 #include "PsSensitiveNotifyingInput.h"
00026 #include "PsSensitiveNotifyingInputAlias.h"
00027 #include "PsOutput.h"
00028 #include "PsOutputAlias.h"
00029 #include "PsControlParameter.h"
00030 #include "PsSimpleSimulatedObjectCreator.h"
00031 
00032 
00053 class PsTestObject : public PsSimulatedObject {
00054 public:
00055    PsTestObject ( PsController & ctrl, const PsObjectDescriptor & descriptor ) ;
00056    ~PsTestObject () ;
00057    virtual void compute ( ) ;
00058 };
00059 
00060 PsTestObject::PsTestObject( PsController & ctrl, const PsObjectDescriptor & descriptor ) :
00061    PsSimulatedObject( ctrl , descriptor )
00062 {
00063    list<const PsObjectDescriptor *> * alist = listSonsOfType<PsSimulatedObject> ( ) ;
00064    delete alist ;
00065    alist = listBrothersOfType<PsSimulatedObject> ( ) ;
00066    delete alist ;
00067    alist = listDescendantsOfType<PsSimulatedObject> ( ) ;
00068    delete alist ;
00069    
00070    addInput<PsFloat> ("anInput", false, 2) ;
00071    addSensitiveInput<PsFloat> ("aSensitiveInput", false,  2) ;
00072    addSensitiveNotifyingInput<PsFloat> ("aSensitiveNotifyingInput", false, 2) ;
00073    addOutput<PsFloat>("anOutput");
00074    addControlParameter<PsFloat> ("aControlParameter") ;
00075 
00076    addInputAlias<PsFloat> ("anAlias","anObject","anObjectInput" ) ;
00077    addSensitiveInputAlias<PsFloat> ("aSensitiveAlias","anObject","anObjectInput" ) ;
00078    addSensitiveNotifyingInputAlias<PsFloat>("aSensitiveNotifyingAlias","anObject","anObjectInput" ) ;
00079 
00080    addOutputAlias<PsFloat> ("anOutputALias","anObject","AnObjectOutput" ) ;
00081 
00082    generateAndAddInstanceCreatorFor<PsTestObject> ("testObject");
00083 }
00084 
00085 PsTestObject::~PsTestObject() {
00086 
00087 }
00088 
00089 
00090 void PsTestObject::compute() {
00091    //PsValuedEvent<PsInt> * t = event_cast<PsInt>(new PsValuedEvent<PsInt>("tot",getSimulatedDate(),"Me","them",2) ) ;
00092    //delete t ; 
00093    fireValuedSignal( "HasAValue" ,getName() ) ;
00094    sendValuedEvent("anObject","anEventId", PsInt(3) );
00095    sendValuedEvent(this,"anEventId", PsInt(3) );
00096 }
00097 

logo OpenMask

Documentation generated on Mon Nov 25 15:25:02 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001