OMK::DistributedController Class Reference

A controller who has a notion of distribution A distributed controller only controls part of the simulation. More...

#include <OMKDistributedController.h>

Inheritance diagram for OMK::DistributedController:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DistributedController (ObjectDescriptor &initialObjects, const Date &initialDate)
 constructor
virtual ~DistributedController ()
 destructor
virtual SimulatedObjectgetPointerToSimulatedObjectNamed (const Name &objectName)
 get a pointer to a simulation object.
virtual void dispatchEvent (Event *event)
 dispatch an event received from an other controller to the corresponding referenceObjectHandle
virtual bool processEvent (Event *event)
 redefine event processing to broadcast system events to other controllers
virtual void purgeMemoryFromOldEvents (const Date &dateOfOldestKept)
 redefine to purge the list of remembered broadcasted signals, and object descriptors
virtual void broadcastEventsForSignal (Event &event, const EventIdentifier &sigId)
 redefine so that signals broadcasted are remembered.
virtual bool receiveRegistrationForSignal (const EventIdentifier &sigId, const Name &registrant, const EventIdentifier &eventId)
 register an object for a signal
virtual bool receiveCancellationForSignal (const EventIdentifier &sigId, const Name &registrant)
 cancel the registration of an object for a signal
virtual const ObjectDescriptorgetObjectDescriptorOfObject (const Name &objectName)
 get the object descriptor of a given simulated object.
virtual std::vector< NamegetMirrorList ()
virtual std::vector< NamegetIsolatedMirrorList ()
virtual std::vector< NamegetNonIsolatedMirrorList ()
virtual bool isAMirror (const Name &name)
virtual bool testIfTroubleOccured ()
virtual void createNewSite (const Date &)

Public Attributes

std::vector< Name_publicMirrorObjectsVector
 CHADI.
Name exProcessName

Protected Types

typedef __gnu_cxx::hash_map<
Name, MirrorObjectHandle *,
Name::hash_compare_Name
MirrorObjectsContainerType
 End CHADI.

Protected Member Functions

virtual MirrorObjectHandlenewOMKMirrorObjectHandle (SimulatedObject &obj)=0
 create an mirror object handle adapted to distribution mode
virtual DuplicatedObjectHandlenewOMKDuplicatedObjectHandle (SimulatedObject &obj)=0
 create a duplicated object handle adapted to distribution mode
virtual LocalObjectHandlenewOMKLocalObjectHandle (SimulatedObject &obj)=0
 CHADI.
virtual void deleteObject (ObjectDescriptor *objectDescriptor)
 remember the object descriptor in case it is needed because it describes a mirror
virtual void createControlledObjects (const ObjectDescriptor *subTree)
 redefine createControlledObjects so as to create only object assigned to this controller
virtual void createObject (const ObjectDescriptor &newObjectDescription, const Name &fathersName)
 redefine to make sure a process is given to the created object.
virtual void processNewObjectDeclaration (ObjectDescriptor &declaration, const Date &declarationDate)
 redefine to create only declarations pertinant to the current node
virtual MirrorObjectHandlecreateMirrorObject (ObjectDescriptor *objectDescription)
 createMirrorObject effective creation of a simulated object wich will act as a mirror for other simulated objects controlled by the local controller
virtual DuplicatedObjectHandlecreateDuplicatedObject (ObjectDescriptor *objectDescription)
 create a duplicated object
virtual void createLocalObject (const ObjectDescriptor &newLObjectDescription, const Name &fathersLName)
 create a local object
virtual int getMirrorsNbre ()
virtual void processStartEventOf (ReferenceObjectHandle *objectHandle)
 initialisation des referentiels .

Protected Attributes

MirrorObjectsContainerType _mirrorObjectsMap
 data structure containing references to the MirrorObjectHandlers
NameToPointerMap< DuplicatedObjectHandle_duplicatedObjectsMap
 data structure containing references to the DuplicatedObjectHandlers
NameToPointerMap< LocalObjectHandle_localObjectsMap
 CHADI.
NameToPointerMap< ReferenceObjectHandletableDesNonInitialises
 la table des référentiels non-initilisés
NameToPointerMap< ReferenceObjectHandletableDesInitialises
 la table des référentiels initilisés
Name _processName
 name of the process this controller is controlling
std::list< std::pair< EventIdentifier,
std::pair< Event *, Date > > > 
_broadcastedSignals
 the list storing the recently broadcasted signals
std::list< std::pair< Date,
ObjectDescriptor * > > 
_deletedObjectDescriptors
 the list storing the deleted object descriptors

Classes

class  CancellationData
class  RegistrationData

Detailed Description

A controller who has a notion of distribution A distributed controller only controls part of the simulation.

Author:
David Margery
Version:
0.8 0.7 -> 0.8 delegated much of what was linked to distribution from the general controller to the distributed controller

Definition at line 37 of file OMKDistributedController.h.


Member Typedef Documentation

typedef __gnu_cxx::hash_map<Name,MirrorObjectHandle *,Name::hash_compare_Name > OMK::DistributedController::MirrorObjectsContainerType [protected]

End CHADI.

Definition at line 156 of file OMKDistributedController.h.


Constructor & Destructor Documentation

DistributedController::DistributedController ( ObjectDescriptor initialObjects,
const Date initialDate 
)

constructor

Definition at line 42 of file OMKDistributedController.cpp.

00043   : Controller(initialObjects, initialDate),
00044     _processName (initialObjects.getProcess())
00045 {
00046 }

DistributedController::~DistributedController (  )  [virtual]

destructor

Definition at line 50 of file OMKDistributedController.cpp.

References OMK::Controller::_date, OMK::Controller::_stepPeriod, and purgeMemoryFromOldEvents().

00051 {
00052   purgeMemoryFromOldEvents ( _date + _stepPeriod ) ;
00053 }


Member Function Documentation

SimulatedObject * DistributedController::getPointerToSimulatedObjectNamed ( const Name objectName  )  [virtual]

get a pointer to a simulation object.

Redefined from Controller, because if the object hasn't been locally created, a mirror of this object will be created

Parameters:
objectName the name of the object for wich a pointer is needed
Returns:
a pointer to the corresponding object, non-const because thah pointer can be used to send events to the object

Reimplemented from OMK::Controller.

Definition at line 77 of file OMKDistributedController.cpp.

References OMK::Controller::_date, _duplicatedObjectsMap, _localObjectsMap, _mirrorObjectsMap, OMK::Controller::_referenceObjectsMap, OMK::Controller::_simulationTree, OMK::Controller::computeAdequateFrequency(), OMK::Controller::computeScheduling(), OMK::Controller::createDescribedObject(), createDuplicatedObject(), createMirrorObject(), OMK::ObjectDescriptor::DUPLICATED_OBJECT, OMK::ObjectDescriptor::findDescendantNamed(), OMK::SimulatedObject::fireValuedSignal(), OMK::ObjectDescriptor::getDistribution(), OMK::ObjectDescriptor::getFrequency(), OMK::SimulatedObject::getName(), OMK::SimulatedObject::getObjectDescriptor(), OMK::SimulatedObject::getObjectHandle(), OMK::ObjectDescriptor::getProcess(), OMK::ObjectDescriptor::LOCAL_OBJECT, OMK::SystemEventIdentifier::MaskObjectCreated, OMK::Controller::scheduleControlledObjects(), OMK::Controller::scheduleObject(), and OMK::Controller::sendInitialEventsTo().

Referenced by processNewObjectDeclaration().

00077                                                                                            {
00078    //std::cout << "***** process " << getObjectDescriptor ().getProcess () << " : demande de " << nom << std::endl ;
00079   //in case of dynamic creation of objects
00080   CurrentActiveObject context ( NULL ) ;   
00081   
00082   SimulatedObject * resultat = NULL ;
00083   // On verifie que l'objet est un referentiel
00084   //cerr<<"DistributedController::getPointerToSimulatedObjectNamed("<<nom<<")"<<endl;
00085   if (nom == getName() ) 
00086     {
00087       resultat = this ;
00088     }
00089   else if (_referenceObjectsMap.find (nom) != _referenceObjectsMap.end ()) 
00090     {
00091       // On recupere le referentiel
00092       resultat = & _referenceObjectsMap.getObjectOfIndex (nom)->getSimulatedObject() ;
00093     } 
00094   else 
00095     {
00096       MirrorObjectsContainerType::iterator i = _mirrorObjectsMap.find (nom) ;
00097       if ( i != _mirrorObjectsMap.end ()) 
00098         {
00099           // On recupere le miroir
00100           resultat = & ( i->second->getSimulatedObject() ) ;
00101         } 
00102       else if (_duplicatedObjectsMap.find (nom) != _duplicatedObjectsMap.end()) 
00103         {
00104           //this shouldn't happen, as duplicate objects are also in the referenceObjectMap
00105           cout<<"DistributedController::getPointerToSimulatedObjectNamed : found in _duplicatedObjectsMap: problem"<<endl;
00106           resultat = &_duplicatedObjectsMap.getObjectOfIndex (nom)->getSimulatedObject() ;
00107         }
00108       
00109       else if (_localObjectsMap.find (nom) != _localObjectsMap.end()) 
00110         {
00111           //this shouldn't happen, as Local objects are also in the referenceObjectMap
00112            //cout<<"DistributedController::getPointerToSimulatedObjectNamed : found in _LocalObjectsMap: problem: "<<nom<<endl;
00113           // TDTD : I think local objects are NOT in the referenceObjectMap...
00114           // BEGIN TDTD : pour voir si ça évite d'avoir un miroir : je renvoie NULL, mais ça ne change rien... !!!
00115           resultat = &_localObjectsMap.getObjectOfIndex (nom)->getSimulatedObject() ;
00116           //resultat = NULL ;
00117           // END TDTD
00118         }
00119       
00120       else {
00121         
00122         ObjectDescriptor * objectDescription = _simulationTree.findDescendantNamed (nom) ;
00123         if ( objectDescription != NULL ) 
00124           {
00125             SimulatedObject * obj = createDescribedObject ( objectDescription ) ;
00126             bool isDuplicatedOject = objectDescription->getDistribution() == ObjectDescriptor::DUPLICATED_OBJECT ;
00127             bool isLocalOject = objectDescription->getDistribution() == ObjectDescriptor::LOCAL_OBJECT ;
00128             if( !isDuplicatedOject && !isLocalOject ) 
00129               {
00130                 createMirrorObject ( objectDescription ) ;
00131               }
00132             else if ( isLocalOject )  
00133               {
00134                  // BEGIN TDTD : enlever les locaux des autres processus
00135                  // ici il y a une amélioration notable, mais ce n'est pas encore cela...
00136                  //std::cout << "##### process " << getObjectDescriptor ().getProcess () << " : demande de " << nom << " qui est sur process " << objLoc->getObjectDescriptor ().getProcess () << std::endl ;
00137                  if (obj->getObjectDescriptor ().getProcess () == getObjectDescriptor ().getProcess ()) {
00138                     //std::cout << "~~~~~ process " << getObjectDescriptor ().getProcess () << " : demande de " << nom << " qui est sur process " << objLoc->getObjectDescriptor ().getProcess () << std::endl ;
00139                     _localObjectsMap.addObjectWithIndex (obj->getName(),(LocalObjectHandle *)getObjectHandle() );
00140                  } else {
00141                     obj = NULL ;
00142                  }
00143                  //_localObjectsMap.addObjectWithIndex (obj->getName(),(LocalObjectHandle *)getObjectHandle() );
00144                  // END TDTD
00145               }
00146             else if ( isDuplicatedOject )
00147               {
00148                 DuplicatedObjectHandle * newObjectHandle = createDuplicatedObject ( objectDescription );   
00149                 if ( objectDescription->getFrequency() != computeAdequateFrequency (objectDescription->getFrequency()) )
00150                   
00151                   {
00152                     //the whole scheduling data structure needs recalculating
00153                     computeScheduling ( false ) ;
00154                     //the new object will therefore be scheduled with all the others
00155                     scheduleControlledObjects() ;
00156                   }
00157                 else 
00158                   {
00159                     scheduleObject ( newObjectHandle ) ;
00160                   }
00161                 sendInitialEventsTo ( *newObjectHandle, _date ) ; 
00162                 fireValuedSignal(SystemEventIdentifier::MaskObjectCreated,nom ) ;
00163                 
00164                 //here, nothing is done for creation process coherence. It might be usefull to initialise the object for duplicated objects
00165               }
00166             resultat = obj ;
00167           }
00168       }
00169     }
00170   return resultat ;
00171 }

void DistributedController::dispatchEvent ( Event event  )  [virtual]

dispatch an event received from an other controller to the corresponding referenceObjectHandle

Definition at line 281 of file OMKDistributedController.cpp.

References OMK::Controller::_referenceObjectsMap, OMASSERTM, and OMK::Event::receiver.

00281                                                        {
00282 #ifdef _DEBUGEVT
00283   cerr<<"DistributedController::dispatchEvent pour "<<event->receiver<<endl;
00284 #endif
00285   NameToPointerMap<ReferenceObjectHandle>::iterator i = _referenceObjectsMap.find(event->receiver);
00286   OMASSERTM(i!=_referenceObjectsMap.end(), "");
00287   (*i).second->receiveEvent( event );
00288 #ifdef _DEBUGEVT
00289   cerr<<"DistributedController::dispatchEvent fin"<<endl;
00290 #endif
00291 } 

bool DistributedController::processEvent ( Event event  )  [virtual]

redefine event processing to broadcast system events to other controllers

CHADI

CHADI WARNING

END CHADI WARNING

CHADI WARNING

END CHADI WARNING

End CHADI

Reimplemented from OMK::Controller.

Definition at line 400 of file OMKDistributedController.cpp.

References _broadcastedSignals, OMK::Controller::_controledObjectsSignalsDispatcher, OMK::DistributedController::RegistrationData::_eventId, _mirrorObjectsMap, _processName, OMK::Controller::_referenceObjectsMap, OMK::DistributedController::CancellationData::_registrant, OMK::DistributedController::RegistrationData::_registrant, OMK::Controller::_scheduler, OMK::DistributedController::RegistrationData::_sig, OMK::DistributedController::CancellationData::_sigId, OMK::Controller::_simulationTree, OMK::SignalDispatcher::cancelRegistrationForSignal(), OMK::MirrorObjectHandle::cancelRegistrationToReferenceObject(), OMK::Controller::changeObjectsFather(), OMK::Controller::createReferenceObjectHandle(), OMK::Event::date, deleteObject(), OMK::Controller::deleteObjectHandle(), OMK::Event::eventId, exProcessName, OMK::ObjectDescriptor::findDescendantNamed(), OMK::SimulatedObject::fireValuedSignal(), OMK::SimulatedObject::getName(), OMK::SimulatedObject::getObjectDescriptor(), getObjectDescriptorOfObject(), OMK::ObjectDescriptor::getProcess(), OMK::Controller::getSimulatedDate(), OMK::ObjectHandle::getSimulatedObject(), OMK::SimulatedObject::immigrate(), OMK::MirrorObjectHandle::linkToNewReferential(), OMK::SystemEventIdentifier::MaskCancelRegistrationForSignal, OMK::SystemEventIdentifier::MaskLinkToNewReferential, OMK::SystemEventIdentifier::MaskMetamorphoseMirToRef, OMK::SystemEventIdentifier::MaskNewLocalObject, OMK::SystemEventIdentifier::MaskObjectCreated, OMK::SystemEventIdentifier::MaskObjectDestroyed, OMK::SystemEventIdentifier::MaskRegisterForSignal, newOMKMirrorObjectHandle(), OMASSERTM, OMK::Controller::processEvent(), processNewObjectDeclaration(), OMK::Controller::processStartEventAfterMorphose(), OMK::Event::receiver, OMK::SignalDispatcher::registerForSignal(), OMK::Scheduler::removeFromScheduable(), OMK::Controller::scheduleObject(), OMK::Event::sender, OMK::SimulatedObject::sendEvent(), OMK::ReferenceObjectHandle::setMigrationCaseToTrue(), OMK::ReferenceObjectHandle::setMorphosisPhaseTrue(), OMK::MirrorObjectHandle::setMorphosisPhaseTrue(), OMK::ObjectDescriptor::setProcess(), tableDesInitialises, OMK::Scheduler::unschedule(), and OMK::ValuedEvent< UserType >::value.

00400                                                          {
00401    // TDTD pour la mesure du temps de migration
00402    //static struct timeval start_timer, end_timer ;
00403    //static bool beginMigrationNotYetRegistred = true ;
00404    // fin TDTD
00405    bool result=false ;
00406    if ( event->eventId == SystemEventIdentifier::MaskRegisterForSignal ) {
00407       ValuedEvent<RegistrationData> * realEvent = dynamic_cast<ValuedEvent<RegistrationData> *>( event ) ;
00408       OMASSERTM (realEvent != NULL, "" ) ;
00409       
00410       
00411       _controledObjectsSignalsDispatcher.registerForSignal(realEvent->value._sig , 
00412                                                            realEvent->value._registrant , 
00413                                                            realEvent->value._eventId) ;
00414       
00415       result = true ;
00416       
00417       //find out if an allready broadcasted signal should sent to the registrant
00418       for ( list<pair<EventIdentifier, pair <Event *, Date> > >::iterator i = _broadcastedSignals.begin() ;
00419             i != _broadcastedSignals.end() ;
00420             ++i ) {
00421          if ( i->first == realEvent->value._sig ) {
00422             if ( i->second.second >= realEvent->date ) {
00423                Event * sentEvent = i->second.first->clone() ;
00424                sentEvent->eventId = realEvent->value._eventId ;
00425                sentEvent->receiver = realEvent->value._registrant ;
00426                sendEvent ( sentEvent ) ;
00427             }
00428          }
00429       }
00430    } else if ( event->eventId == SystemEventIdentifier::MaskCancelRegistrationForSignal ) {
00431       ValuedEvent<CancellationData> * realEvent = dynamic_cast<ValuedEvent<CancellationData> *>( event ) ;
00432 
00433       OMASSERTM (realEvent != NULL, "" ) ;
00434 
00435       _controledObjectsSignalsDispatcher.cancelRegistrationForSignal (realEvent->value._sigId , 
00436                                                                       realEvent->value._registrant) ;
00437       result = true ;
00438    } else if (event->eventId == SystemEventIdentifier::MaskObjectDestroyed) {
00439       ValuedEvent<Name> * realEvent = dynamic_cast<ValuedEvent<Name> *>( event ) ;
00440 
00441       OMASSERTM ( realEvent != NULL, "" ) ;
00442 
00443       ObjectDescriptor * objectDescriptor = _simulationTree.findDescendantNamed ( realEvent->value ) ;
00444 
00445       if (objectDescriptor != NULL ) {
00446          deleteObject( objectDescriptor ) ;
00447       }
00448       result = Controller::processEvent ( event ) ;
00449    }
00451    else if ( event->eventId == SystemEventIdentifier::MaskNewLocalObject ) 
00452    {
00453       CreateObjectEvent * creationEvent = dynamic_cast< CreateObjectEvent* > ( event ) ;
00454          
00455       OMASSERTM (creationEvent != NULL, "" ) ;
00456       result = true ; // TDTD ajout ...
00457       // add the described object in the simulation tree : this is a declaration
00458       ObjectDescriptor * objectDescriptor = 
00459         _simulationTree.findDescendantNamed( creationEvent->value.getValue().first.getName() );
00460       if ( objectDescriptor == NULL ) {
00461          if ( (creationEvent->value.getValue().first.getProcess())==
00462               (getObjectDescriptor().getProcess()) ) {
00463             ObjectDescriptor * newObjectDescriptor = 
00464                new ObjectDescriptor(creationEvent->value.getValue().first) ;
00465               
00466             ObjectDescriptor * fathersDescription = 
00467                _simulationTree.findDescendantNamed ( creationEvent->value.getValue().second ) ;
00468               
00469             if (fathersDescription == NULL) {
00470                fathersDescription = & _simulationTree ;
00472                   //              ostringstream warningMessage ;
00473                   //              warningMessage<<"Attached new object named "
00474                   //                            <<newObjectDescriptor->getName()<<" to "<<getName()
00475                   //                            <<" because object "<<creationEvent->value.getValue().second
00476                   //                            <<"is unknown"<<endl;
00477                   //              warning ( warningMessage.str() , SomeWarnings ) ;
00479             }
00480             changeObjectsFather (newObjectDescriptor, fathersDescription) ;
00481               
00482             //create the described object
00483             processNewObjectDeclaration ( *newObjectDescriptor, event->date ) ;
00484               
00485             // notify other objects that an object has been created
00486             fireValuedSignal( SystemEventIdentifier::MaskObjectCreated,
00487                               creationEvent->value.getValue().first.getName() ) ;
00488          }
00489       } else {
00491           //      ostringstream warningMessage ;
00492           //      warningMessage<<"WARNING: an object of name "
00493           //                    <<creationEvent->value.getValue().first.getName()<<" already exists"<<endl;
00494           //      warning ( warningMessage.str() , SomeWarnings ) ;
00496       }
00497    } else if ( event->eventId == SystemEventIdentifier::MaskMetamorphoseMirToRef ) {
00498       //------- gestion de la migration (chadi)
00499 //       if (beginMigrationNotYetRegistred) { // TDTD pour la mesure du temps de migration
00500 //       gettimeofday(&start_timer, NULL);
00501 //       //std::cerr << "temps de début pris à la date " << getSimulatedDate () << std::endl ;
00502 //       beginMigrationNotYetRegistred = false ;
00503 //       }
00504       MigrationObjectEvent * morphoseEvent = dynamic_cast< MigrationObjectEvent* > ( event ) ;
00505        
00506       OMASSERTM (morphoseEvent != NULL, "" ) ;
00507       result = true ; // TDTD ajout ...
00508        
00509       Name objectToMigrate = morphoseEvent->value.getValue().first ;
00510       Name destinationProcess = morphoseEvent->value.getValue().second ;
00511       exProcessName = getObjectDescriptorOfObject(objectToMigrate).getProcess();
00512       
00513       if (! (getObjectDescriptorOfObject(objectToMigrate).getProcess () == destinationProcess)) {
00514          //si egale ca veut dire ke le ref est deja 
00515          //sur le site destination, donc rien a faire ...
00516          //appeler emigrate() pour sauvegarder les valeurs internes de l'objet
00517          // getPointerToSimulatedObjectNamed(objectToMigrate)->emigrate() ;
00518          
00519          if (destinationProcess == _processName) {
00520             // ca veut dire ke g localise le site detenant le miroir elu pr etre ref
00521             MirrorObjectsContainerType::iterator i = 
00522                _mirrorObjectsMap.find (objectToMigrate) ;
00523             if (i != _mirrorObjectsMap.end ()) {                   
00524                MirrorObjectHandle * mirObjHandle =  i->second ;
00525                SimulatedObject * objectPtr = &(i->second->getSimulatedObject ()) ;
00526                mirObjHandle->cancelRegistrationToReferenceObject () ;
00527                mirObjHandle->setMorphosisPhaseTrue () ;
00528                
00529                deleteObjectHandle (mirObjHandle) ;
00530                
00531                ReferenceObjectHandle * refObjHandle = createReferenceObjectHandle (*objectPtr) ;
00532                _referenceObjectsMap.addObjectWithIndex (objectToMigrate, refObjHandle) ;
00533                _mirrorObjectsMap.erase (i) ;
00534                
00535                processStartEventAfterMorphose (refObjHandle) ;
00536                tableDesInitialises.addObjectWithIndex (refObjHandle->getSimulatedObject ().getName (), 
00537                                                        refObjHandle) ;
00538                scheduleObject (refObjHandle) ;
00539                
00540                ObjectDescriptor * descriptorOfObjectToMigrate = 
00541                   const_cast<ObjectDescriptor *> (&getObjectDescriptorOfObject (objectToMigrate)) ;
00542                descriptorOfObjectToMigrate->setProcess (destinationProcess) ;
00543                
00544                //maintenant il faut envoyer un event pour alerter les miroirs:
00545                //a la reception de cet event les miroirs doivent se deshabonner de 
00546                //l'ex ref et s'abonner au nouveau
00547                
00548         MigrationObjectEvent linkToNewRefEvent( 
00549           SystemEventIdentifier::MaskLinkToNewReferential,
00550           getSimulatedDate (),
00551           getName (),
00552           getName (),
00553           MigrationObjectType( MigrationObjectPrm( objectToMigrate, destinationProcess ) ) ) ;
00554                
00555                sendEvent (linkToNewRefEvent) ;
00556             }
00557          } else { //dans ce cas que les autres miroirs se desabonnent de leur ex-ref
00558             MirrorObjectsContainerType::iterator i = _mirrorObjectsMap.find (objectToMigrate) ;
00559             if (i != _mirrorObjectsMap.end ())  {
00560                ObjectDescriptor * descriptorOfObjectToMigrate = 
00561                   const_cast<ObjectDescriptor *>
00562                   (&getObjectDescriptorOfObject (objectToMigrate)) ;
00563                descriptorOfObjectToMigrate->setProcess (destinationProcess) ;
00564                
00565                MirrorObjectHandle * moh =  (i->second) ;
00566                moh->cancelRegistrationToReferenceObject () ;
00567                moh->setMorphosisPhaseTrue () ;
00568             }
00569             // TDTD j'enlève les commentaires pour faire fonctionner la migration, en modifiant un peu...
00570             if (_referenceObjectsMap.find (objectToMigrate) != _referenceObjectsMap.end ()) {
00571                SimulatedObject * objectPtr =
00572                   &_referenceObjectsMap.getObjectOfIndex (objectToMigrate)->getSimulatedObject() ; 
00573                objectPtr->emigrate () ;
00574                ReferenceObjectHandle * refer =  
00575                   dynamic_cast<ReferenceObjectHandle* >
00576                   (_referenceObjectsMap.getObjectOfIndex(objectToMigrate));
00577                refer->setMorphosisPhaseTrue () ;
00578             }
00579          }
00580       }
00581    }
00582    else if (event->eventId == SystemEventIdentifier::MaskLinkToNewReferential)
00583    {
00584       MigrationObjectEvent * changeRefEvent = dynamic_cast< MigrationObjectEvent* >( event ) ;
00585 
00586       OMASSERTM (changeRefEvent != NULL, "" ) ;
00587       result = true ; // TDTD ajout ...
00588       Name objectToMigrate = changeRefEvent->value.getValue().first ;
00589       Name destinationProcess = changeRefEvent->value.getValue().second ;
00590       
00591       if (_processName != destinationProcess) 
00592       {
00593                if (_processName!=exProcessName) 
00594          {
00595                   //donc c'est un site ki a un miroir, alors brancher ce miroir
00596                   //sur son nouveau Ref
00597                   MirrorObjectsContainerType::iterator i = _mirrorObjectsMap.find (objectToMigrate) ;
00598                   MirrorObjectHandle * moh = (i->second) ;
00599                   moh->linkToNewReferential(destinationProcess) ;
00600                } 
00601          else 
00602          {
00603                   //donc c le site ki a l'ex-ref il faut le transformer
00604                   //en miroir et le brancher sur le nouveau ref
00605                   MirrorObjectHandle * miroir = NULL ;
00606                   ReferenceObjectHandle * refe = _referenceObjectsMap.getObjectOfIndex (objectToMigrate) ;
00607                   SimulatedObject * objectPtr =  
00608                      &_referenceObjectsMap.getObjectOfIndex (objectToMigrate)
00609                      ->getSimulatedObject () ;      
00610                   ObjectDescriptor * descriptorOfObjectToMigrate = 
00611                      const_cast<ObjectDescriptor *>
00612                      (& _referenceObjectsMap.getObjectOfIndex (objectToMigrate)
00613                       ->getSimulatedObject ().getObjectDescriptor ()) ;
00614                   descriptorOfObjectToMigrate->setProcess (destinationProcess) ;
00615                   refe->setMigrationCaseToTrue () ;
00616                   _scheduler->unschedule (refe) ;
00617                   _scheduler->removeFromScheduable (refe) ;
00618                   _referenceObjectsMap.erase (objectToMigrate) ;
00619                   deleteObjectHandle (refe) ;
00620                   miroir = newOMKMirrorObjectHandle (*objectPtr) ;
00621                   _mirrorObjectsMap.insert 
00622                      (MirrorObjectsContainerType::value_type (objectPtr->getName (), miroir)) ;
00623                   miroir->linkToNewReferential (destinationProcess) ;
00624                }
00625                //gettimeofday (&end_timer, NULL) ;
00626       }
00627    } else if (event->eventId == "MaskSaveInternalValue") {
00628       result = true ; // TDTD ajout ...
00629       if (_referenceObjectsMap.find (event->sender) != _referenceObjectsMap.end ()) {
00630          SimulatedObject * objectPtr =  
00631             &_referenceObjectsMap.getObjectOfIndex (event->sender)->getSimulatedObject () ; 
00632          objectPtr->immigrate (event) ;
00633       } else if (_mirrorObjectsMap.find (event->sender) != _mirrorObjectsMap.end ()) {
00634          MirrorObjectsContainerType::iterator i = _mirrorObjectsMap.find (event->sender) ;
00635          SimulatedObject * objectPtr = &(i->second->getSimulatedObject ()) ;
00636          objectPtr->immigrate (event) ;
00637       }
00638       //gettimeofday (&end_timer, NULL) ;
00640    // TDTD ajout pour mesurer le temps
00641 //    } else if (event->eventId == "PrintMigrationDuration") {
00642 //       result = true ;
00643 //       double time_in_ms = (end_timer.tv_sec - start_timer.tv_sec) * 1000.0 +
00644 //       (end_timer.tv_usec - start_timer.tv_usec) / 1000.0 ;
00645 //       std::cout << "migration duration on process " << _processName << " = " << time_in_ms << std::endl ;
00646 //       beginMigrationNotYetRegistred = true ;
00647    } else {
00648       result = Controller::processEvent ( event ) ;
00649    }
00650    return result ;
00651 }

void DistributedController::purgeMemoryFromOldEvents ( const Date dateOfOldestKept  )  [virtual]

redefine to purge the list of remembered broadcasted signals, and object descriptors

Reimplemented from OMK::Controller.

Definition at line 679 of file OMKDistributedController.cpp.

References _broadcastedSignals, _deletedObjectDescriptors, _processName, and OMK::Controller::purgeMemoryFromOldEvents().

Referenced by ~DistributedController().

00680 {
00681   // purge object descriptors first
00682   bool disposableElements = !_deletedObjectDescriptors.empty() ;
00683   pair <Date, ObjectDescriptor *> examinedObjectDescriptor ;
00684   while ( disposableElements )
00685     {
00686       examinedObjectDescriptor = _deletedObjectDescriptors.front() ;
00687       if ( examinedObjectDescriptor.first < dateOfOldestKept )
00688         {
00689 #ifdef _DEBUGEXEC
00690           cerr<<"DistributedController::purgeMemoryFromOldEvents: deleting "
00691               <<examinedObjectDescriptor.second->getName()<<endl;
00692 #endif
00693           //only delete if it will not be deleted by the ancestor class : no object (nor object handle) was created
00694           if (  examinedObjectDescriptor.second->getProcess() != _processName )
00695             {
00696                      
00697               //if ( ) delete examinedObjectDescriptor.second ;
00698             }
00699           _deletedObjectDescriptors.pop_front() ;
00700           disposableElements = !_deletedObjectDescriptors.empty() ;
00701         }
00702       else 
00703         {
00704           disposableElements = false ;
00705         }
00706     }
00707    
00708 
00709 
00710 
00711   Controller::purgeMemoryFromOldEvents ( dateOfOldestKept ) ;
00712   //purge the list of old broadcasted signals. 2 * _stepPeriod is arbitrary. The effective distributed controller should redefine this according to it's latency
00713   pair<EventIdentifier, pair <Event *, Date> > examinedPair ;
00714   disposableElements = !_broadcastedSignals.empty() ;
00715   while ( disposableElements )
00716     {
00717       examinedPair = _broadcastedSignals.front() ;
00718       if ( examinedPair.second.second < dateOfOldestKept )
00719         {
00720           delete examinedPair.second.first ;
00721           _broadcastedSignals.pop_front() ;
00722           disposableElements = !_broadcastedSignals.empty() ;
00723         }
00724       else 
00725         {
00726           disposableElements = false ;
00727         }
00728     }
00729    
00730 }

void DistributedController::broadcastEventsForSignal ( Event event,
const EventIdentifier sigId 
) [virtual]

redefine so that signals broadcasted are remembered.

They need to be remembered, because registration to a signal is delayed for the sake of distribution

Reimplemented from OMK::Controller.

Definition at line 732 of file OMKDistributedController.cpp.

References _broadcastedSignals, OMK::Controller::_date, OMK::Controller::broadcastEventsForSignal(), and OMK::Event::clone().

00733 {
00734   Controller::broadcastEventsForSignal ( event, sigId ) ;
00735 
00736   //remember the broadcasted signal to be able to send it to objects whose registration is still under way
00737   _broadcastedSignals.push_back ( make_pair ( sigId, make_pair (event.clone(), _date) ) ) ;
00738 
00739 }

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

register an object for a signal

Parameters:
sigId the signal to react to
registrant the simulated object registering to signal sigId
eventId the eventId to send to registrant when sigId is emitted

Reimplemented from OMK::Controller.

Definition at line 741 of file OMKDistributedController.cpp.

References OMK::Controller::_date, OMK::SimulatedObject::getName(), OMK::SystemEventIdentifier::MaskRegisterForSignal, and OMK::SimulatedObject::sendEvent().

00744 {
00745   //   cerr << "DistributedController::receiveRegistrationForSignal " << sig << " | " << registrant << " | " << eventId << endl ;
00746   ValuedEvent<RegistrationData> * event ;
00747   event= new ValuedEvent<RegistrationData> (SystemEventIdentifier::MaskRegisterForSignal, _date, getName(), getName() ,RegistrationData (sig, registrant, eventId) ) ;
00748   sendEvent (event) ;
00749   return true ;
00750 }

bool DistributedController::receiveCancellationForSignal ( const EventIdentifier sigId,
const Name registrant 
) [virtual]

cancel the registration of an object for a signal

Parameters:
sigId the signal for wich there is a cancellation
registrant the object cancelling registration

Reimplemented from OMK::Controller.

Definition at line 753 of file OMKDistributedController.cpp.

References OMK::Controller::_date, OMK::SimulatedObject::getName(), OMK::SystemEventIdentifier::MaskCancelRegistrationForSignal, and OMK::SimulatedObject::sendEvent().

00753                                                                                                                    {
00754   ValuedEvent<CancellationData> * event ;
00755   event= new ValuedEvent<CancellationData> (SystemEventIdentifier::MaskCancelRegistrationForSignal, _date, getName(), getName() ,CancellationData (sigId, registrant) ) ;
00756   sendEvent (event) ;
00757   return true ;
00758 }

const ObjectDescriptor & DistributedController::getObjectDescriptorOfObject ( const Name objectName  )  [virtual]

get the object descriptor of a given simulated object.

redefine to look into _deletedObjectDescriptors

Parameters:
objectName the name of the given object
Returns:
the ObjectDescriptor corresponding to that object throw a UserException if a descriptor corresponding to name doesn't exist

Reimplemented from OMK::Controller.

Definition at line 225 of file OMKDistributedController.cpp.

References _deletedObjectDescriptors, OMK::Controller::_simulationTree, and OMK::ObjectDescriptor::findDescendantNamed().

Referenced by processEvent().

00226 {
00227   //no call to ancestor, because performer will catch the exception thrown in case of problems
00228   if (_simulationTree.findDescendantNamed(objectName) != NULL )
00229     {
00230       return *(_simulationTree.findDescendantNamed(objectName));
00231     }
00232   else 
00233     {
00234       //the object might have just been deleted : look for it in _deletedObjectDescriptors
00235       list <pair <Date, ObjectDescriptor *> >::iterator i = _deletedObjectDescriptors.begin() ;
00236       while ( i != _deletedObjectDescriptors.end() )
00237         {
00238           if (i->second->getName() == objectName )
00239             {
00240               return *i->second ;
00241             }
00242           ++i ;
00243         }
00244       UserException e("UnknownObject :") ; 
00245       e<<objectName ;
00246       throw e ;
00247     }
00248 }

vector< Name > DistributedController::getMirrorList (  )  [virtual]

Reimplemented from OMK::Controller.

Definition at line 211 of file OMKDistributedController.cpp.

References _mirrorObjectsMap, and _publicMirrorObjectsVector.

00212 {
00213   _publicMirrorObjectsVector.clear() ;
00214   for ( MirrorObjectsContainerType::iterator i = _mirrorObjectsMap.begin();
00215         i!= _mirrorObjectsMap.end(); 
00216         i++ )
00217     {
00218       _publicMirrorObjectsVector.push_back( i->first) ;
00219     }
00220 
00221   return  _publicMirrorObjectsVector;
00222 }

virtual std::vector<Name> OMK::DistributedController::getIsolatedMirrorList (  )  [inline, virtual]

Reimplemented from OMK::Controller.

Reimplemented in OMK::PvmController.

Definition at line 99 of file OMKDistributedController.h.

00099 { return std::vector<Name>() ;} ;

virtual std::vector<Name> OMK::DistributedController::getNonIsolatedMirrorList (  )  [inline, virtual]

Reimplemented from OMK::Controller.

Reimplemented in OMK::PvmController.

Definition at line 100 of file OMKDistributedController.h.

00100 { return std::vector<Name>() ;} ;

bool DistributedController::isAMirror ( const Name name  )  [virtual]

Reimplemented from OMK::Controller.

Definition at line 203 of file OMKDistributedController.cpp.

References _mirrorObjectsMap.

00204 {
00205   if (_mirrorObjectsMap.find (name) !=  _mirrorObjectsMap.end ()) 
00206     return true;
00207   return false;
00208   
00209 }

virtual bool OMK::DistributedController::testIfTroubleOccured (  )  [inline, virtual]

Reimplemented from OMK::Controller.

Reimplemented in OMK::PvmController.

Definition at line 103 of file OMKDistributedController.h.

00103 { return true ; };

virtual void OMK::DistributedController::createNewSite ( const Date  )  [inline, virtual]

Reimplemented from OMK::Controller.

Reimplemented in OMK::PvmController.

Definition at line 104 of file OMKDistributedController.h.

00104 {} ;

virtual MirrorObjectHandle* OMK::DistributedController::newOMKMirrorObjectHandle ( SimulatedObject obj  )  [protected, pure virtual]

create an mirror object handle adapted to distribution mode

Parameters:
obj : the object to encapsulate in an objetc handle : a mirror object handle encapsulating the object

Implemented in OMK::PvmController.

Referenced by createMirrorObject(), and processEvent().

virtual DuplicatedObjectHandle* OMK::DistributedController::newOMKDuplicatedObjectHandle ( SimulatedObject obj  )  [protected, pure virtual]

create a duplicated object handle adapted to distribution mode

Parameters:
obj : the object to encapsulate in an objetc handle : a duplicated object handle encapsulating the object

Implemented in OMK::PvmController.

Referenced by createDuplicatedObject().

virtual LocalObjectHandle* OMK::DistributedController::newOMKLocalObjectHandle ( SimulatedObject obj  )  [protected, pure virtual]

CHADI.

Implemented in OMK::PvmController.

void DistributedController::deleteObject ( ObjectDescriptor objectDescriptor  )  [protected, virtual]

remember the object descriptor in case it is needed because it describes a mirror

Reimplemented from OMK::Controller.

Definition at line 655 of file OMKDistributedController.cpp.

References OMK::Controller::_date, _deletedObjectDescriptors, and OMK::Controller::deleteObject().

Referenced by processEvent().

00656 {
00657   _deletedObjectDescriptors.push_back ( make_pair ( _date,objectDescriptor ) ) ;
00658   Controller::deleteObject ( objectDescriptor ) ;
00659 }

void DistributedController::createControlledObjects ( const ObjectDescriptor subTree  )  [protected, virtual]

redefine createControlledObjects so as to create only object assigned to this controller

Reimplemented from OMK::Controller.

Definition at line 339 of file OMKDistributedController.cpp.

References _processName, OMK::Controller::createReferenceObject(), and OMK::ObjectDescriptor::getSons().

00340 {
00341   //go through the simulation tree to find all objects that have to be created
00342   ObjectDescriptor::SonsContainerType::const_iterator i = subTree->getSons()->begin() ;
00343   while ( i != subTree->getSons()->end() )
00344     {
00345       if ( (*i)->getProcess() == _processName ) 
00346         {
00347 #ifdef _DEBUGEXEC
00348           cerr<<"Creating "<< (*i)->getName() << endl ;
00349 #endif
00350           //create the object
00351           createReferenceObject ( (*i) ) ;
00352         }        
00353       else 
00354         {
00355 #ifdef _DEBUGEXEC
00356           cerr<<"Not Creating "<< (*i)->getName() 
00357               <<" of process "<< (*i)->getProcess()
00358               <<endl ;
00359 #endif
00360         }
00361       //create the subTree of that object
00362       createControlledObjects ( *i ) ;
00363       ++i ;
00364     }
00365 }

void DistributedController::createObject ( const ObjectDescriptor newObjectDescription,
const Name fathersName 
) [protected, virtual]

redefine to make sure a process is given to the created object.

If no process is specified, the current process will be inserted

Reimplemented from OMK::Controller.

Definition at line 663 of file OMKDistributedController.cpp.

References _processName, OMK::Controller::createObject(), and OMK::ObjectDescriptor::getProcess().

00665 {
00666   Name noProcess ;
00667   if ( newObjectDescription.getProcess() == noProcess )
00668     {
00669       ObjectDescriptor modifiableObjectDescription ( newObjectDescription ) ;
00670       modifiableObjectDescription.setProcess ( _processName ) ;
00671       Controller::createObject( modifiableObjectDescription, fathersName ) ;
00672     }
00673   else
00674     {
00675       Controller::createObject( newObjectDescription, fathersName ) ;
00676     }
00677 }

void DistributedController::processNewObjectDeclaration ( ObjectDescriptor declaration,
const Date declarationDate 
) [protected, virtual]

redefine to create only declarations pertinant to the current node

Reimplemented from OMK::Controller.

Definition at line 369 of file OMKDistributedController.cpp.

References OMK::Controller::_pendingEventsList, _processName, OMK::ObjectDescriptor::getName(), getPointerToSimulatedObjectNamed(), OMK::ObjectDescriptor::getProcess(), OMASSERTM, OMK::Controller::processNewObjectDeclaration(), and OMK::SimulatedObject::sendEvent().

Referenced by processEvent().

00370 {
00371   //cerr<<"DistributedController::processNewObjectDeclaration "<<_processName<<" "<<declaration.getProcess()<<endl;
00372   if ( _processName == declaration.getProcess() ) 
00373     {
00374       Controller::processNewObjectDeclaration ( declaration, declarationDate ) ;
00375     }
00376   else
00377     {
00378       map<Name, list <Event *> >::iterator pendingEvents = _pendingEventsList.find( declaration.getName() ) ;
00379       if ( pendingEvents != _pendingEventsList.end() )
00380         {
00381 #ifdef _DEBUGEXEC
00382           cerr<<"Found pending events for "<<declaration.getName()<<endl;
00383 #endif
00384           for ( list <Event *>::iterator pendingEventsListIterator = pendingEvents->second.begin() ;
00385                 pendingEventsListIterator != pendingEvents->second.end() ;
00386                 ++pendingEventsListIterator)
00387             {
00388 #ifdef _DEBUGEXEC
00389               cerr<<"sent "<<**pendingEventsListIterator<< "to "<<declaration.getName()<<endl;
00390 #endif
00391               OMASSERTM ( getPointerToSimulatedObjectNamed(declaration.getName()) != NULL, "" ) ;
00392               getPointerToSimulatedObjectNamed(declaration.getName())->sendEvent(*pendingEventsListIterator) ; 
00393             }
00394           _pendingEventsList.erase ( pendingEvents ) ;
00395         }
00396     }
00397 }

MirrorObjectHandle * DistributedController::createMirrorObject ( ObjectDescriptor objectDescription  )  [protected, virtual]

createMirrorObject effective creation of a simulated object wich will act as a mirror for other simulated objects controlled by the local controller

Reimplemented in OMK::PvmController.

Definition at line 295 of file OMKDistributedController.cpp.

References _mirrorObjectsMap, OMK::Controller::createDescribedObject(), OMK::ObjectDescriptor::getName(), and newOMKMirrorObjectHandle().

Referenced by OMK::PvmController::createMirrorObject(), and getPointerToSimulatedObjectNamed().

00296 {
00297   MirrorObjectHandle * result = NULL ;
00298   SimulatedObject * obj = createDescribedObject( objectDescription ) ;
00299   if ( obj == NULL )
00300     {
00301       cerr<<"Controller::createMirrorObject: unable to create "<<*objectDescription<<endl;
00302     }
00303   else
00304     {
00305       result = newOMKMirrorObjectHandle(*obj) ;
00306                  
00307       _mirrorObjectsMap.insert ( MirrorObjectsContainerType::value_type(objectDescription->getName (), result ) ) ;
00308     }
00309   return result ;   
00310 }

DuplicatedObjectHandle * DistributedController::createDuplicatedObject ( ObjectDescriptor objectDescription  )  [protected, virtual]

create a duplicated object

Definition at line 56 of file OMKDistributedController.cpp.

References _duplicatedObjectsMap, OMK::Controller::_referenceObjectsMap, OMK::Controller::createDescribedObject(), OMK::ObjectDescriptor::getName(), and newOMKDuplicatedObjectHandle().

Referenced by getPointerToSimulatedObjectNamed().

00057 {
00058   DuplicatedObjectHandle * result = NULL ;
00059 
00060   SimulatedObject * createdObject = createDescribedObject(objectDescription) ;
00061 
00062   if (createdObject == NULL) 
00063     {
00064       cerr<<"DistributedController::createDuplicatedObject: unable to create "<<*objectDescription<<endl;
00065     }
00066   else
00067     {
00068       result = newOMKDuplicatedObjectHandle(*createdObject) ;
00069          
00070       _referenceObjectsMap.addObjectWithIndex (objectDescription->getName(), result);
00071       _duplicatedObjectsMap.addObjectWithIndex (objectDescription->getName(),result);
00072     }
00073   return result ;
00074 }

void DistributedController::createLocalObject ( const ObjectDescriptor newLObjectDescription,
const Name fathersLName 
) [protected, virtual]

create a local object

Reimplemented from OMK::Controller.

Definition at line 173 of file OMKDistributedController.cpp.

References _localObjectsMap, _processName, OMK::Controller::createLocalObject(), OMK::ObjectDescriptor::getName(), OMK::SimulatedObject::getObjectHandle(), and OMK::ObjectDescriptor::getProcess().

00174 {
00175 
00176   _localObjectsMap.addObjectWithIndex (newLObjectDescription.getName(),
00177                                        (LocalObjectHandle *)getObjectHandle()  );
00178   
00179   Name noProcess ;
00180   if ( newLObjectDescription.getProcess() == noProcess )
00181     {
00182       ObjectDescriptor modifiableObjectDescription ( newLObjectDescription ) ;
00183       modifiableObjectDescription.setProcess ( _processName ) ;
00184       Controller::createLocalObject( modifiableObjectDescription, fathersLName ) ;
00185     }
00186   else
00187     {
00188       Controller::createLocalObject( newLObjectDescription, fathersLName ) ;
00189     }
00190 }

int DistributedController::getMirrorsNbre (  )  [protected, virtual]

Reimplemented from OMK::Controller.

Definition at line 192 of file OMKDistributedController.cpp.

References _mirrorObjectsMap.

00192                                           {
00193   int j=0;
00194   for ( MirrorObjectsContainerType::iterator i = _mirrorObjectsMap.begin(); 
00195         i!= _mirrorObjectsMap.end(); 
00196         i++ )
00197     {
00198       j++;
00199     }
00200   return j;
00201 }

void DistributedController::processStartEventOf ( ReferenceObjectHandle objectHandle  )  [protected, virtual]

initialisation des referentiels .

.. a redefinir en distribue

Returns:
: TRUE si l'init a échouée

Reimplemented from OMK::Controller.

Definition at line 252 of file OMKDistributedController.cpp.

References OMK::SimulatedObject::getName(), OMK::ObjectHandle::getSimulatedObject(), OMK::ReferenceObjectHandle::initial, OMK::Controller::processStartEventOf(), OMK::Controller::setComputingState(), tableDesInitialises, and tableDesNonInitialises.

00253 {
00254   try 
00255     {
00256       Controller::processStartEventOf ( objectHandle ) ;
00257       tableDesInitialises.addObjectWithIndex ( objectHandle->getSimulatedObject ().getName (), 
00258                                                objectHandle) ;
00259 #ifdef _DEBUGDISTRIBUTEDINIT
00260       cerr<<"DistributedController::processStartEventOf init of "
00261           << objectHandle->getSimulatedObject ().getName ()
00262           <<" successfull"<<endl;
00263 #endif
00264     }
00265   catch (UnInitialisedAttributeException&) 
00266     {
00267 #ifdef _DEBUGDISTRIBUTEDINIT
00268       cerr<<"DistributedController::processStartEventOf init of "
00269           << objectHandle->getSimulatedObject ().getName ()
00270           <<" failed"<<endl;
00271 #endif
00272       setComputingState (objectHandle, ReferenceObjectHandle::initial ) ;
00273       tableDesNonInitialises.addObjectWithIndex ( objectHandle->getSimulatedObject ().getName () , 
00274                                                   objectHandle) ;
00275     }
00276 }


Member Data Documentation

std::vector<Name> OMK::DistributedController::_publicMirrorObjectsVector

CHADI.

Definition at line 96 of file OMKDistributedController.h.

Referenced by getMirrorList().

Name OMK::DistributedController::exProcessName

Definition at line 104 of file OMKDistributedController.h.

Referenced by processEvent().

MirrorObjectsContainerType OMK::DistributedController::_mirrorObjectsMap [protected]

data structure containing references to the MirrorObjectHandlers

Definition at line 161 of file OMKDistributedController.h.

Referenced by createMirrorObject(), OMK::PvmController::getIsolatedMirrorList(), getMirrorList(), getMirrorsNbre(), OMK::PvmController::getNonIsolatedMirrorList(), getPointerToSimulatedObjectNamed(), isAMirror(), OMK::PvmController::parseSynchronisationMessage(), processEvent(), and OMK::PvmController::removeObjectFromDataStructures().

NameToPointerMap<DuplicatedObjectHandle> OMK::DistributedController::_duplicatedObjectsMap [protected]

data structure containing references to the DuplicatedObjectHandlers

Definition at line 165 of file OMKDistributedController.h.

Referenced by createDuplicatedObject(), getPointerToSimulatedObjectNamed(), and OMK::PvmController::removeObjectFromDataStructures().

NameToPointerMap<LocalObjectHandle> OMK::DistributedController::_localObjectsMap [protected]

CHADI.

Definition at line 168 of file OMKDistributedController.h.

Referenced by createLocalObject(), and getPointerToSimulatedObjectNamed().

NameToPointerMap<ReferenceObjectHandle> OMK::DistributedController::tableDesNonInitialises [protected]

la table des référentiels non-initilisés

Definition at line 178 of file OMKDistributedController.h.

Referenced by OMK::PvmController::init(), and processStartEventOf().

NameToPointerMap<ReferenceObjectHandle> OMK::DistributedController::tableDesInitialises [protected]

la table des référentiels initilisés

Definition at line 181 of file OMKDistributedController.h.

Referenced by processEvent(), and processStartEventOf().

Name OMK::DistributedController::_processName [protected]

name of the process this controller is controlling

Definition at line 184 of file OMKDistributedController.h.

Referenced by createControlledObjects(), createLocalObject(), createObject(), processEvent(), processNewObjectDeclaration(), purgeMemoryFromOldEvents(), and OMK::PvmController::PvmController().

std::list<std::pair<EventIdentifier, std::pair <Event *, Date> > > OMK::DistributedController::_broadcastedSignals [protected]

the list storing the recently broadcasted signals

Definition at line 187 of file OMKDistributedController.h.

Referenced by broadcastEventsForSignal(), processEvent(), and purgeMemoryFromOldEvents().

std::list<std::pair <Date, ObjectDescriptor *> > OMK::DistributedController::_deletedObjectDescriptors [protected]

the list storing the deleted object descriptors

Definition at line 190 of file OMKDistributedController.h.

Referenced by deleteObject(), getObjectDescriptorOfObject(), and purgeMemoryFromOldEvents().


logo OpenMask

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

Generated with doxygen by Dimitri van Heesch ,   1997-2007