OMK::ReferenceObjectHandle Class Reference

Defining an reference object handle. More...

#include <OMKReferenceObjectHandle.h>

Inheritance diagram for OMK::ReferenceObjectHandle:

Inheritance graph
[legend]
Collaboration diagram for OMK::ReferenceObjectHandle:

Collaboration graph
[legend]
List of all members.

Public Types

enum  SimulatedObjectComputingState {
  initial,
  running,
  suspended,
  stopped,
  destroyed
}
 the different computing states a reference simulated object can be in More...

Public Member Functions

 ReferenceObjectHandle (SimulatedObject &object, Controller &controller, SignalDispatcher *signalDispatcher=0)
 Constructor using a allready initialised signal dispatcher.
virtual ~ReferenceObjectHandle ()
 Destructor.
virtual void init ()
 initialise the object
virtual void initAfterMorphose ()
 CHADI.
virtual void setMigrationCaseToTrue ()
virtual void setMorphosisPhaseTrue ()
virtual void compute ()
 activate our object
virtual void processEvents ()
 process all events received by the simulated object
virtual void receiveEvent (const Event &event)
 receive an event the locally stored event is a clone of the event parameter of the member function
virtual void receiveEvent (Event *event)
 receive an event responsability of deleting the evnt passed as parameter is transfered to the object handle
virtual void registerEventListenerForEvent (EventListener &eventListener, const EventIdentifier &eventId)
 registration of an event listener for the simulation objet
virtual void unregisterEventListener (EventListener &eventListener)
 Unregistration of an event listener for the simulation object.
virtual void sendEventsForSignal (Event &event, const EventIdentifier &sigId)
 send events to simulated objects registered for sigId
virtual bool receiveRegistrationForSignal (const EventIdentifier &sigId, const Name &registrant, const EventIdentifier &eventId)
 receive the registration for signal sigId by registrant.
virtual bool cancelRegistrationForSignal (const EventIdentifier &sigId, const Name &registrant)
 cancel the registration made by registrant for sigId
virtual void insertInStream (std::ostream &=std::cout) const
 insert synchronisation management data for mirrorObjectHandles in output stream
virtual void extract (std::istream &=std::cin)
 extract synchronisation management data from mirrorObjectHandle from input stream
virtual const SimulatedObjectComputingStategetComputingState () const
 get the computing state of the object

Protected Types

typedef __gnu_cxx::hash_map<
const EventIdentifier, std::list<
EventListener * > *, Name::hash_compare_Name
virtualEventTableType
 the type of the hash map storing the event listeners

Protected Member Functions

virtual std::list< Event * > & getCurrentEventList ()
 returns the current readable event list
virtual void switchEventList ()
 switch the readable and writable event lists

Protected Attributes

SimulatedObjectComputingState _computingState
 the current computing state of the encpasulated object
Controller_controller
 the controller using the object handle
Date _dateOfLastEventManagement
 date of last event management for the encapsulated object
Date _dateOfLastActivation
 date of last activation for the encapsulated object
std::list< Event * > ** _eventList
 the double buffered event list for the object
unsigned int _currentWritableEventList
 index in the event list of the list where to write to
bool _isInObjectNeedingActivationList [2]
 _isInObjectNeedingActivationList[i]=true <=> ObjectDescriptor is in _objectsNeedingActivationList[i] of it's controller
virtualEventTableType _virtualEventTable
 table of event listeners
SignalDispatcher_signalDispatcher
 the signal handler to wich signal handling is delegated

Friends

class OMK::Controller
 enable a controller to change the computing state of an object, and _isInObjectNeedingActivationList array
class OMK::Scheduler
 enables a scheduler to change the computing state of an object
Comparasion of 2 reference object handles
order between two referenceObjectHandles is execution order in a simulation step

bool operator< (const ReferenceObjectHandle &, const ReferenceObjectHandle &)
 <
bool operator<= (const ReferenceObjectHandle &, const ReferenceObjectHandle &)
 <=
bool operator> (const ReferenceObjectHandle &, const ReferenceObjectHandle &)
 >
bool operator>= (const ReferenceObjectHandle &, const ReferenceObjectHandle &)
 >=

Detailed Description

Defining an reference object handle.

Author:
David Margery (1.0 by Siames)
Version:
2.0 1.0 -> 2.0 : added event and signal handling capacity to the referenceObjecthandle, moved any reference to pvm to the PvmReferenceObjectHandle.

Definition at line 37 of file OMKReferenceObjectHandle.h.


Member Typedef Documentation

typedef __gnu_cxx::hash_map< const EventIdentifier, std::list < EventListener *> *, Name::hash_compare_Name > OMK::ReferenceObjectHandle::virtualEventTableType [protected]

the type of the hash map storing the event listeners

Definition at line 192 of file OMKReferenceObjectHandle.h.


Member Enumeration Documentation

enum OMK::ReferenceObjectHandle::SimulatedObjectComputingState

the different computing states a reference simulated object can be in

Enumerator:
initial 
running 
suspended 
stopped 
destroyed 

Definition at line 143 of file OMKReferenceObjectHandle.h.


Constructor & Destructor Documentation

ReferenceObjectHandle::ReferenceObjectHandle ( SimulatedObject object,
Controller controller,
SignalDispatcher signalDispatcher = 0 
)

Constructor using a allready initialised signal dispatcher.

Parameters:
object the encapsulated object
controller the encapuslating controller
signalDispatcher the signal dispatcher to use : responsability of destruction is handled to that object. If null create a dispatcher (SignalDispatcher by default).

Definition at line 33 of file OMKReferenceObjectHandle.cpp.

References _computingState, _currentWritableEventList, _dateOfLastActivation, _dateOfLastEventManagement, _eventList, _isInObjectNeedingActivationList, OMK::ObjectHandle::_myObject, _signalDispatcher, OMK::SimulatedObject::getEventListeners(), initial, and OMK::Controller::initialSimulationDate.

00036 : ObjectHandle ( objet ),
00037   _controller ( ctrl ),
00038   _signalDispatcher ( signalDispatcher ? signalDispatcher : new SignalDispatcher (ctrl) )
00039 {
00040    assert ( _signalDispatcher != NULL ) ;
00041 
00042    for( int i = 0 ; i<2 ; i++ ) 
00043    {
00044            _isInObjectNeedingActivationList[i]= false ;
00045    }
00046    _computingState = initial ;
00047    _dateOfLastEventManagement = Controller::initialSimulationDate - 1 ;
00048    _dateOfLastActivation = Controller::initialSimulationDate - 1 ;
00049 
00050    _eventList = new std::list <Event *> * [ 2 ] ;
00051    _eventList [ 0 ] = new std::list <Event *>() ;
00052    _eventList [ 1 ] = new std::list <Event *>() ;
00053    _currentWritableEventList = 0 ;
00054    
00055    // register the event listeners already added to the object
00056    const  list <EventListener *> & listOfEventListeners = _myObject.getEventListeners () ;
00057    for( list< EventListener * >::const_iterator eventListenersIterator = listOfEventListeners.begin() ;
00058         eventListenersIterator != listOfEventListeners.end() ;
00059         ++eventListenersIterator )
00060    {
00061            (*eventListenersIterator)->registerEvents() ;
00062    }
00063 }

ReferenceObjectHandle::~ReferenceObjectHandle (  )  [virtual]

Destructor.

Definition at line 67 of file OMKReferenceObjectHandle.cpp.

References _eventList, _signalDispatcher, and _virtualEventTable.

00068 {
00069    //cerr<<"ReferenceObjectHandle:"<<this<<":~ReferenceObjectHandle () "<<endl;
00070 
00071   delete _eventList[0] ;
00072   delete _eventList[1] ;
00073   delete [] _eventList ;
00074   for (virtualEventTableType::iterator i = _virtualEventTable.begin();
00075        i != _virtualEventTable.end();
00076        ++i )
00077      {
00078         delete (*i).second ;
00079      }
00080   assert (_signalDispatcher != NULL) ;
00081   delete _signalDispatcher ;
00082 }


Member Function Documentation

void ReferenceObjectHandle::init (  )  [virtual]

initialise the object

Definition at line 84 of file OMKReferenceObjectHandle.cpp.

References OMK::ObjectHandle::_myObject, OMK::debugMsg(), OMK::SimulatedObject::init(), OMK_DEBUG_OMK_EXEC, and OMTRACEID.

00085 {
00086    CurrentActiveObject changeContext ( &_myObject ) ;
00087    OMTRACEID( OMK_DEBUG_OMK_EXEC, "init for " << debugMsg( &_myObject ) ) ;
00088    _myObject.init () ;
00089    OMTRACEID( OMK_DEBUG_OMK_EXEC, "init for " << debugMsg( &_myObject ) << " done" ) ;
00090    // do not treat init as an activation to enable init and compute in the same simulation step
00091 }

void ReferenceObjectHandle::initAfterMorphose (  )  [virtual]

CHADI.

Definition at line 94 of file OMKReferenceObjectHandle.cpp.

References OMK::ObjectHandle::_myObject, and OMK::SimulatedObject::init().

00095 {
00096    CurrentActiveObject changeContext ( &_myObject ) ;
00097    _myObject.init () ;
00098 }

void ReferenceObjectHandle::setMigrationCaseToTrue (  )  [virtual]

Definition at line 100 of file OMKReferenceObjectHandle.cpp.

References OMK::ObjectHandle::_migrationCase.

Referenced by OMK::DistributedController::processEvent().

00101 {
00102   _migrationCase = true ;
00103 }

void ReferenceObjectHandle::setMorphosisPhaseTrue (  )  [virtual]

Reimplemented in OMK::PvmReferenceObjectHandle.

Definition at line 105 of file OMKReferenceObjectHandle.cpp.

References OMASSERTM.

Referenced by OMK::DistributedController::processEvent().

00106 {
00107    OMASSERTM( false, "this code must not be called" ) ;
00108 }

void ReferenceObjectHandle::compute (  )  [virtual]

activate our object

Definition at line 112 of file OMKReferenceObjectHandle.cpp.

References _controller, _dateOfLastActivation, OMK::ObjectHandle::_myObject, OMK::SimulatedObject::compute(), OMK::debugMsg(), OMK::Controller::getSimulatedDate(), OMK_DEBUG_OMK_EXEC, OMTRACEID, and processEvents().

Referenced by OMK::Controller::runControllersStep().

00113 {
00114    OMTRACEID( OMK_DEBUG_OMK_EXEC, "ReferenceObjectHandle::compute() last activated at "<<_dateOfLastActivation<<", now is "
00115        <<_controller.getSimulatedDate() ) ;
00116 
00117    if ( _controller.getSimulatedDate() > _dateOfLastActivation ) 
00118    {
00119      
00120      _dateOfLastActivation = _controller.getSimulatedDate() ;
00121   
00122      CurrentActiveObject changeContext ( &_myObject ) ;
00123      OMTRACEID( OMK_DEBUG_OMK_EXEC, "ReferenceObjectHandle::compute : processing events of " << debugMsg( &_myObject ) ) ;
00124      processEvents () ;
00125      OMTRACEID( OMK_DEBUG_OMK_EXEC, "ReferenceObjectHandle::compute : events of " << debugMsg( &_myObject ) << " processed, now compute" ) ;
00126      _myObject.compute () ;
00127      OMTRACEID( OMK_DEBUG_OMK_EXEC, "ReferenceObjectHandle::compute : computation finished for " << debugMsg( &_myObject ) ) ;
00128    }
00129    else
00130    {
00131            OMTRACEID( OMK_DEBUG_OMK_EXEC, "ReferenceObjectHandle::compute : controller allready activated at "<<_controller.getSimulatedDate() ) ;
00132    }
00133 }

void ReferenceObjectHandle::processEvents (  )  [virtual]

process all events received by the simulated object

Definition at line 135 of file OMKReferenceObjectHandle.cpp.

References _controller, _dateOfLastEventManagement, OMK::ObjectHandle::_myObject, _virtualEventTable, OMK::debugMsg(), OMK::SimulatedObject::eventsProcessed(), getCurrentEventList(), OMK::Controller::getSimulatedDate(), OMK::ObjectHandle::getSimulatedObject(), OMK_DEBUG_OMK_EXEC, OMTRACEID, OMK::Controller::postponeEventProcessing(), OMK::SimulatedObject::prepareEventProcessing(), OMK::SimulatedObject::processEvent(), and switchEventList().

Referenced by compute(), OMK::Controller::processEventsOfSuspendedObjects(), OMK::Controller::reactToControlledObjectsSystemEvents(), OMK::PvmController::run(), and OMK::Controller::runControllersStep().

00136 {
00137    bool eventsProcessed = false ;
00138    OMTRACEID( OMK_DEBUG_OMK_EXEC, "ReferenceObjectHandle::processEvents () of " << debugMsg( &getSimulatedObject() ) << " last activated at " 
00139        << _dateOfLastEventManagement << ", now is " <<_controller.getSimulatedDate() ) ;
00140 
00141    if (_controller.getSimulatedDate() > _dateOfLastEventManagement ) 
00142       {
00143          switchEventList() ;
00144          list< Event * > & myEventList = getCurrentEventList() ;
00145          eventsProcessed = ! myEventList.empty() ;
00146          if ( eventsProcessed ) _myObject.prepareEventProcessing ( myEventList ) ; /*Mathias Lorente's suggestion*/
00147          list< Event * >::iterator i = myEventList.begin() ;
00148          list< Event * >::iterator toErase ;
00149          // if ( eventsProcessed ) _myObject.prepareEventProcessing ( myEventList ) ;
00150          while ( i != myEventList.end() ) 
00151             {
00152          OMTRACEID( OMK_DEBUG_OMK_EXEC, "ReferenceObjectHandle::processEvents (): processing" << *(*i) ) ;
00153                virtualEventTableType::iterator listeners = _virtualEventTable.find ( (*i)->eventId ) ;
00154                bool finished = false ;
00155                if ( listeners != _virtualEventTable.end() ) 
00156                   {
00157                      list <EventListener * >::iterator aListener = listeners->second->begin() ;
00158                      while ( aListener != listeners->second->end() && ! finished )
00159                         {
00160                            (*aListener)->prepareEventProcessing ( myEventList , i ) ;
00161                            finished = (*aListener)->processEvent ( *i ) ;
00162                            ++aListener ;
00163                         }
00164                   }
00165                if ( ! finished ) 
00166                   {
00167                      if ( _myObject.processEvent ( *i ) ) {
00168                         delete (*i) ;
00169                      }
00170                   }
00171                else 
00172                   {
00173                      delete (*i) ;
00174                   }
00175                toErase = i ;
00176                i++ ;
00177                myEventList.erase ( toErase ) ;
00178             }
00179          if ( eventsProcessed ) _myObject.eventsProcessed ( myEventList ) ;
00180          _dateOfLastEventManagement = _controller.getSimulatedDate() ;      
00181       }  
00182    else 
00183       {
00184          //processEvents has already been called, and is called again 
00185    OMTRACEID( OMK_DEBUG_OMK_EXEC, "ReferenceObjectHandle::processEvents event processing postponed for " << debugMsg( &getSimulatedObject() ) ) ;
00186          _controller.postponeEventProcessing ( this ) ;
00187       }
00188 }

void ReferenceObjectHandle::receiveEvent ( const Event event  )  [virtual]

receive an event the locally stored event is a clone of the event parameter of the member function

Implements OMK::ObjectHandle.

Reimplemented in OMK::DuplicatedObjectHandle, and OMK::LocalObjectHandle.

Definition at line 232 of file OMKReferenceObjectHandle.cpp.

References OMK::Event::clone().

Referenced by OMK::PvmLocalObjectHandle::broadcastEvent(), OMK::PvmDuplicatedObjectHandle::broadcastEvent(), OMK::Controller::computeScheduling(), OMK::PvmReferenceObjectHandle::unpack(), OMK::PvmLocalObjectHandle::unpack(), and OMK::PvmDuplicatedObjectHandle::unpack().

00233 {
00234 #ifdef _DEBUGEVT
00235    cerr<<"ReferenceObjectHandle::receiveEvent (const Event &"<<event<<")"<<endl;
00236 #endif
00237    receiveEvent ( event.clone() ) ;
00238 }

void ReferenceObjectHandle::receiveEvent ( Event event  )  [virtual]

receive an event responsability of deleting the evnt passed as parameter is transfered to the object handle

Implements OMK::ObjectHandle.

Reimplemented in OMK::DuplicatedObjectHandle, and OMK::LocalObjectHandle.

Definition at line 240 of file OMKReferenceObjectHandle.cpp.

References _computingState, _controller, _currentWritableEventList, _eventList, OMK::ObjectHandle::_myObject, OMK::Controller::actOnSystemEvent(), OMK::Event::date, OMK::Event::eventId, OMK::SimulatedObject::getName(), OMK::Controller::hasEventsToProcess(), OMK::Event::insertInList(), OMK::Event::isSystem(), OMK_DEBUG_OMK_EVENT, OMTRACEID, OMK::SimulatedObject::processEventsASAP(), OMK::Event::receiver, stopped, and suspended.

00241 {
00242   OMTRACEID( OMK_DEBUG_OMK_EVENT, "ReferenceObjectHandle::receiveEvent(Event *)" << std::endl 
00243      << "  \"" << event->receiver << "\" received event \"" << event->eventId << "\" at " << event->date ) ;
00244    //DM : a copy is sent only at reception , because only at reception is the correct controller known
00245    if ( (event->isSystem ()) && (event->receiver == _myObject.getName()) ) 
00246       {
00247          _controller.actOnSystemEvent (event) ;
00248       }  
00249    // if the receiving object is suspended, or has fast event processing activated
00250    // signal the reception to the controller
00251    if ( _computingState == suspended || _myObject.processEventsASAP () ) 
00252       {
00253          _controller.hasEventsToProcess (this) ;
00254       }
00255    if (  _computingState != stopped || event->isSystem () ) {
00256       //*event is owned by the object who has the responsibility to free it
00257 #ifdef _OMK_MUTEX_
00258       _mutexForListEvt.protect() ;
00259 #endif
00260       Event::insertInList (_eventList[_currentWritableEventList], event) ;
00261 #ifdef _OMK_MUTEX_
00262       _mutexForListEvt.unprotect() ;
00263 #endif
00264    }
00265    else {
00266       delete event ;
00267    }
00268 }

void ReferenceObjectHandle::registerEventListenerForEvent ( EventListener eventListener,
const EventIdentifier eventId 
) [virtual]

registration of an event listener for the simulation objet

Reimplemented from OMK::ObjectHandle.

Definition at line 272 of file OMKReferenceObjectHandle.cpp.

References _virtualEventTable.

00274 {
00275   // Look for an entry in the map for this event id
00276   virtualEventTableType::iterator i = _virtualEventTable.find( eventId ) ;
00277   if (i != _virtualEventTable.end() ) 
00278   {
00279     // Yes, the event id is already registered, add the listener to the list managed for it
00280     // To avoid twice registration of the same event handler
00281     list < EventListener *>* listeners = (*i).second ;
00282     if( find( listeners->begin(), listeners->end(), & eventListener ) == listeners->end() )
00283     {
00284       listeners->push_back( &eventListener ) ;
00285     }
00286   } 
00287   else
00288   {
00289     // No, must create the entry and add the listener
00290     _virtualEventTable[ eventId ] = new list< EventListener *>( 1, &eventListener ) ;
00291   }
00292 }

void ReferenceObjectHandle::unregisterEventListener ( EventListener eventListener  )  [virtual]

Unregistration of an event listener for the simulation object.

Parameters:
eventListener The event listener to unreference.
This method is called, indirectly through the object, in the destructor of the event listener to clear the reference to the listener in the event processing of the object.

Reimplemented from OMK::ObjectHandle.

Definition at line 293 of file OMKReferenceObjectHandle.cpp.

References _virtualEventTable.

00294 {
00295   for( virtualEventTableType::iterator eventId = _virtualEventTable.begin() ;
00296        eventId != _virtualEventTable.end() ;
00297        eventId++ )
00298   {
00299     list < EventListener *>* listeners = (*eventId).second ;
00300     list < EventListener *>::iterator eventListenerPos = find( listeners->begin(), listeners->end(), & eventListener ) ;
00301     if( eventListenerPos != listeners->end() )
00302     {
00303       listeners->erase( eventListenerPos ) ;
00304     }
00305   }
00306 }

void ReferenceObjectHandle::sendEventsForSignal ( Event event,
const EventIdentifier sigId 
) [virtual]

send events to simulated objects registered for sigId

Parameters:
event the prototype of the event to send : only receiver and eventId is changed for each simulated object receiving the event
sigId the signal to take into account

Implements OMK::ObjectHandle.

Definition at line 328 of file OMKReferenceObjectHandle.cpp.

References _controller, _signalDispatcher, OMK::Controller::broadcastEventsForSignal(), and OMK::SignalDispatcher::sendEventsForSignal().

00329 {
00330    //cerr<<"ReferenceObjectHandle::sendEventsForSignal "<<sigId<<endl;
00331    _signalDispatcher->sendEventsForSignal ( event, sigId ) ;
00332    _controller.broadcastEventsForSignal ( event , sigId ) ;
00333 }

bool ReferenceObjectHandle::receiveRegistrationForSignal ( const EventIdentifier sigId,
const Name registrant,
const EventIdentifier eventId 
) [virtual]

receive the registration for signal sigId by registrant.

Parameters:
eventId the eventId of the event sent to registrant when sigId is fired
Returns:
registration was successful

Implements OMK::ObjectHandle.

Definition at line 335 of file OMKReferenceObjectHandle.cpp.

References _signalDispatcher, and OMK::SignalDispatcher::registerForSignal().

Referenced by OMK::PvmReferenceObjectHandle::extract(), and OMK::PvmReferenceObjectHandle::unpack().

00338 {
00339    return _signalDispatcher->registerForSignal( sigId, registrant, eventId ) ;
00340 }

bool ReferenceObjectHandle::cancelRegistrationForSignal ( const EventIdentifier sigId,
const Name registrant 
) [virtual]

cancel the registration made by registrant for sigId

Returns:
cancellation was successful

Implements OMK::ObjectHandle.

Definition at line 344 of file OMKReferenceObjectHandle.cpp.

References _signalDispatcher, and OMK::SignalDispatcher::cancelRegistrationForSignal().

Referenced by OMK::PvmReferenceObjectHandle::unpack().

00346 {
00347    return _signalDispatcher->cancelRegistrationForSignal ( sigId, registrant ) ;
00348 }

void ReferenceObjectHandle::insertInStream ( std::ostream &  = std::cout  )  const [virtual]

insert synchronisation management data for mirrorObjectHandles in output stream

Implements OMK::Flowable.

Reimplemented in OMK::PvmReferenceObjectHandle.

Definition at line 218 of file OMKReferenceObjectHandle.cpp.

References OMK::Controller::error().

00218                                                                {
00219    Controller::error ("insertInStream of ReferenceObjectHandle used");
00220 }

void ReferenceObjectHandle::extract ( std::istream &  = std::cin  )  [virtual]

extract synchronisation management data from mirrorObjectHandle from input stream

Implements OMK::Flowable.

Reimplemented in OMK::PvmReferenceObjectHandle.

Definition at line 222 of file OMKReferenceObjectHandle.cpp.

00223 {
00224    
00225 }

const ReferenceObjectHandle::SimulatedObjectComputingState & ReferenceObjectHandle::getComputingState (  )  const [virtual]

get the computing state of the object

Definition at line 322 of file OMKReferenceObjectHandle.cpp.

References _computingState.

Referenced by OMK::Controller::processDeleteEventOf(), OMK::Controller::processStartEventAfterMorphose(), OMK::Controller::processStartEventOf(), and OMK::Controller::reactToControlledObjectsSystemEvents().

00323 {
00324    return _computingState ;
00325 }

list< Event * > & ReferenceObjectHandle::getCurrentEventList (  )  [protected, virtual]

returns the current readable event list

Definition at line 308 of file OMKReferenceObjectHandle.cpp.

References _currentWritableEventList, and _eventList.

Referenced by processEvents().

00308                                                             {
00309    return *(_eventList[ 1 - _currentWritableEventList ] ) ;
00310 }

void ReferenceObjectHandle::switchEventList (  )  [protected, virtual]

switch the readable and writable event lists

Definition at line 312 of file OMKReferenceObjectHandle.cpp.

References _currentWritableEventList.

Referenced by processEvents().

00312                                              {
00313 #ifdef _OMK_MUTEX_
00314    _mutexForListEvt.protect() ;
00315 #endif
00316    _currentWritableEventList = 1 - _currentWritableEventList ;
00317 #ifdef _OMK_MUTEX_
00318    _mutexForListEvt.unprotect() ;
00319 #endif
00320 }


Friends And Related Function Documentation

friend class OMK::Controller [friend]

enable a controller to change the computing state of an object, and _isInObjectNeedingActivationList array

Definition at line 150 of file OMKReferenceObjectHandle.h.

friend class OMK::Scheduler [friend]

enables a scheduler to change the computing state of an object

Definition at line 153 of file OMKReferenceObjectHandle.h.

bool operator< ( const ReferenceObjectHandle un,
const ReferenceObjectHandle deux 
) [friend]

<

Definition at line 192 of file OMKReferenceObjectHandle.cpp.

00194 {   
00195    return un._myObject. getObjectDescriptor ().getName()<deux._myObject. getObjectDescriptor ().getName();
00196 }

bool operator<= ( const ReferenceObjectHandle un,
const ReferenceObjectHandle deux 
) [friend]

<=

Definition at line 198 of file OMKReferenceObjectHandle.cpp.

00200 {
00201    return un._myObject.getObjectDescriptor ().getName()<=deux._myObject.getObjectDescriptor ().getName();
00202 }

bool operator> ( const ReferenceObjectHandle un,
const ReferenceObjectHandle deux 
) [friend]

>

Definition at line 204 of file OMKReferenceObjectHandle.cpp.

00206 {
00207    return !(un<=deux);
00208 }

bool operator>= ( const ReferenceObjectHandle un,
const ReferenceObjectHandle deux 
) [friend]

>=

Definition at line 210 of file OMKReferenceObjectHandle.cpp.

00212 {
00213    return !(un<deux);
00214 }


Member Data Documentation

SimulatedObjectComputingState OMK::ReferenceObjectHandle::_computingState [protected]

the current computing state of the encpasulated object

Definition at line 156 of file OMKReferenceObjectHandle.h.

Referenced by getComputingState(), receiveEvent(), ReferenceObjectHandle(), OMK::Scheduler::setComputingState(), and OMK::Controller::setComputingState().

Controller& OMK::ReferenceObjectHandle::_controller [protected]

the controller using the object handle

Definition at line 159 of file OMKReferenceObjectHandle.h.

Referenced by compute(), OMK::PvmReferenceObjectHandle::extract(), processEvents(), receiveEvent(), sendEventsForSignal(), and OMK::PvmReferenceObjectHandle::unpack().

Date OMK::ReferenceObjectHandle::_dateOfLastEventManagement [protected]

date of last event management for the encapsulated object

Definition at line 168 of file OMKReferenceObjectHandle.h.

Referenced by processEvents(), and ReferenceObjectHandle().

Date OMK::ReferenceObjectHandle::_dateOfLastActivation [protected]

date of last activation for the encapsulated object

Definition at line 171 of file OMKReferenceObjectHandle.h.

Referenced by compute(), OMK::PvmReferenceObjectHandle::makeSynchronisationMessage(), and ReferenceObjectHandle().

std::list<Event *>* * OMK::ReferenceObjectHandle::_eventList [protected]

the double buffered event list for the object

Definition at line 174 of file OMKReferenceObjectHandle.h.

Referenced by getCurrentEventList(), receiveEvent(), ReferenceObjectHandle(), and ~ReferenceObjectHandle().

unsigned int OMK::ReferenceObjectHandle::_currentWritableEventList [protected]

index in the event list of the list where to write to

Definition at line 177 of file OMKReferenceObjectHandle.h.

Referenced by getCurrentEventList(), receiveEvent(), ReferenceObjectHandle(), and switchEventList().

bool OMK::ReferenceObjectHandle::_isInObjectNeedingActivationList[2] [protected]

_isInObjectNeedingActivationList[i]=true <=> ObjectDescriptor is in _objectsNeedingActivationList[i] of it's controller

Definition at line 185 of file OMKReferenceObjectHandle.h.

Referenced by OMK::Controller::hasEventsToProcess(), OMK::Controller::noActivationNeededFor(), OMK::Controller::processEventsOfSuspendedObjects(), and ReferenceObjectHandle().

virtualEventTableType OMK::ReferenceObjectHandle::_virtualEventTable [protected]

table of event listeners

Definition at line 196 of file OMKReferenceObjectHandle.h.

Referenced by processEvents(), registerEventListenerForEvent(), unregisterEventListener(), and ~ReferenceObjectHandle().

SignalDispatcher* OMK::ReferenceObjectHandle::_signalDispatcher [protected]

the signal handler to wich signal handling is delegated

Definition at line 199 of file OMKReferenceObjectHandle.h.

Referenced by cancelRegistrationForSignal(), receiveRegistrationForSignal(), ReferenceObjectHandle(), sendEventsForSignal(), and ~ReferenceObjectHandle().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:02 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007