OMKObjectHandle.cpp

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 <OMKObjectHandle.h>
00019 #include <OMKSimulatedObject.h>
00020 #include <OMKController.h>
00021 #include "OMKObjectDescriptor.h"
00022 
00023 using namespace OMK ;
00024 ObjectHandle::ObjectHandle (SimulatedObject  & objet) :
00025    _myObject (objet),
00026    _attributeRead ( false ),
00027    _aControlParameterHasChanged (false),
00028 /*CHADI*/
00029    _migrationCase ( false )
00030 /*End CHADI*/
00031 {
00032    _myObject.setObjectHandle(this) ;
00033    _myObject.getObjectDescriptor()._destroySimulatedObject = false ;
00034 }
00035 
00036 
00037 ObjectHandle::~ObjectHandle () 
00038 {
00039    // don't delete the controller when it deletes it's object handle
00040    if (& _myObject.getController() != &_myObject )
00041       {
00043         if (!_migrationCase)
00044           {
00045             delete &_myObject ;
00046           }
00048         //delete &_myObject ;
00049       }
00050 }
00051 
00052         
00053 const SimulatedObject & ObjectHandle::getSimulatedObject () const 
00054 {
00055    return _myObject ;
00056 }
00057 
00058 SimulatedObject & ObjectHandle::getSimulatedObject ()  
00059 {
00060    return _myObject ;
00061 }
00062 
00063 
00064 void ObjectHandle::notifyChangeInControlParameter(OutputNT * controlParameter) 
00065 {
00066    _aControlParameterHasChanged = true;
00067 }
00068 
00069 bool ObjectHandle::controlParametersChanged(bool keepChanged)  
00070 {
00071    bool result ;
00072    result = _aControlParameterHasChanged ;
00073    _aControlParameterHasChanged = keepChanged && _aControlParameterHasChanged ;
00074    return result;
00075 }
00076 
00077 void ObjectHandle::registerEventListenerForEvent ( EventListener & eventListener, 
00078                                                      const EventIdentifier & eventId ) 
00079 {
00080   // Do nothing, is only implemented in OMKReferenceObjectHandle
00081 }
00082 void ObjectHandle::unregisterEventListener( EventListener & eventListener ) 
00083 {
00084   // Do nothing, is only implemented in OMKReferenceObjectHandle
00085 }
00086 
00087 void ObjectHandle::attributeRead()
00088 {
00089    _attributeRead = true ;
00090 }
00091 
00092 bool ObjectHandle::getAttributeRead ( bool keepChanged  ) 
00093 {
00094    bool result = _attributeRead ;
00095    if ( _attributeRead ) _attributeRead = keepChanged ;
00096    return result ;
00097 }

logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007