OMKObjectHandle.h

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 #ifndef ObjectHandleHEADER
00019 #define ObjectHandleHEADER
00020 
00021 
00022 
00023 
00024 #include <OMKFlowable.h>
00025 
00026 namespace OMK
00027 { 
00028 class Event ;
00029 class EventIdentifier ;
00030 class EventListener ;
00031 class Name;
00032 class OutputNT ;
00033 class SimulatedObject ; 
00034 typedef enum {
00035    SynchronisationMessage, 
00036    InitialValuesMessage, 
00037    Registration, 
00038    CancelRegistration, 
00039    GET_ALL_PARAM,
00040    GET_PARAM, 
00041    EventReceived, 
00042    RegisterForSignal, 
00043    CancelRegistrationForSignal
00044 } RequestType;
00045 
00050 class OMK_API ObjectHandle : public Flowable
00051 {
00052 public:
00054    ObjectHandle (SimulatedObject & objet);
00055 
00058    virtual ~ObjectHandle();
00059       
00063    virtual void notifyChangeInControlParameter(OutputNT *) ;
00064 
00065 
00069    virtual bool controlParametersChanged(bool keepChanged = false ) ;
00070 
00074    virtual void receiveEvent (const Event & event) = 0 ;
00075 
00076 
00080    virtual void receiveEvent (Event * event) = 0 ;
00081 
00082 
00086    virtual void registerEventListenerForEvent ( EventListener & eventListener, 
00087                                                 const EventIdentifier & eventId ) ;
00088 
00094    virtual void unregisterEventListener( EventListener & eventListener ) ;
00095 
00100    virtual void sendEventsForSignal( Event & event , const EventIdentifier & sigId ) = 0 ;
00101 
00102 
00107    virtual bool receiveRegistrationForSignal ( const EventIdentifier & sigId, 
00108                                                const Name & registrant, 
00109                                                const EventIdentifier & eventId ) = 0 ;
00110 
00111 
00115    virtual bool cancelRegistrationForSignal ( const EventIdentifier & sigId, 
00116                                                const Name & registrant ) = 0 ;
00117 
00118 
00120    const SimulatedObject & getSimulatedObject () const ;
00121 
00122 
00124    SimulatedObject & getSimulatedObject ()  ;
00125 
00126 protected:
00127    friend class KernelAttribute ;
00128 
00130    virtual void attributeRead() ;
00131 
00133    virtual bool getAttributeRead ( bool keepChanged = false ) ;
00134 
00135 protected:
00137    SimulatedObject & _myObject;  
00138 
00140    bool _attributeRead ;
00141 
00143    bool _aControlParameterHasChanged;
00144 
00146    bool _migrationCase ;
00149 }; // ObjectHandle
00150 } //namespace OMK
00151 
00152 #endif
00153 

logo OpenMask

Documentation generated on Mon Jun 9 11:45:57 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007