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

PsPvmController Class Reference

Class defining a local controller for a pvm session. More...

#include <PsPvmController.h>

Inheritance diagram for PsPvmController:

Inheritance graph
[legend]
Collaboration diagram for PsPvmController:

Collaboration graph
[legend]
List of all members.

Public Methods

 PsPvmController (PsObjectDescriptor &arbre, const PsDate &initialSimulationDate, int argc, char *argv[])
 Constructor The constructor initializes the distributed virtual machine.

virtual ~PsPvmController ()
 Destructor.

virtual void run ()
 redefine run so that it does nothing unless the controller belongs to a spawned process

virtual void advanceSimulatedDate ()
 redefine advanceSimulatedDate to include datation of synchronisation messages any try to send data between a call to computeNextSimualtionStep and advanceSimulatedDate will cause an assertion to fail

virtual void computeNextSimulationStep ()
 redefine computeNextSimulationStep to include the synchronisation primitives

virtual void finish ()
 redefine to avoid going into blocking mode when finishing the simulation

virtual const PsNamegetProcessName () const
 get the name of the process this controller is controlling

virtual PsnSvmgetDistributedVirtualMachine ()
 get access to the siames distributed virtual machine

virtual void makeSynchronisationMessage (PsNameToPointerMap< PsnReferenceObjectHandle > &referenceObjects)
 make the synchronisation message to be sent to all processes

virtual void parseSynchronisationMessage (PsnPvmIncomingMessage *message)
 parse the received synchronisation messages.

virtual void waitForAnswerToBlockingRequest (PsnPvmMessage::MessageTag tag)
 waitForAnswerToBlockingRequest.

virtual void sendInitialValuesToMirror (PsnPvmIncomingMessage &message)
 answer to a MirrorNeedsInitialValues message received by the distributed subsystem

virtual void init ()
 redefine for distributed initialisation


Protected Methods

virtual PsDate getPurgeDate ()
 redefine to take latency into account

virtual PsnMirrorObjectHandlecreateMirrorObject (PsObjectDescriptor *objectDescription)
 Create a miror object.

PsnDuplicatedObjectHandlenewPsnDuplicatedObjectHandle (PsSimulatedObject &object)
 create an object handle adapted to handling of duplicated objects

PsnMirrorObjectHandlenewPsnMirrorObjectHandle (PsSimulatedObject &obj)
 create an object handle for objects mirrored by this controller

virtual PsnReferenceObjectHandlenewPsnReferenceObjectHandle (PsSimulatedObject &object, PsController &controller, PsnSignalDispatcher *signalDispatcher)
 create a reference object handler appropriate for this controller

virtual int getOutputHistorySize (void)
 get the size of the history fifo needed when running a distributed simulation.

virtual PsnObjectHandleremoveObjectFromDataStructures (const PsName &nom)
 gestion de la destruction distribuée : destruction des structures locales


Protected Attributes

PsnSvm_distributedVirtualMachine
 the distributed virtual machine used by the controller

bool _finishing
 boolean indicating the controller is going into shutdown mode.


Detailed Description

Class defining a local controller for a pvm session.

the local controller is in charge of

Definition at line 46 of file PsPvmController.h.


Constructor & Destructor Documentation

PsPvmController::PsPvmController PsObjectDescriptor   arbre,
const PsDate   initialSimulationDate,
int    argc,
char *    argv[]
 

Constructor The constructor initializes the distributed virtual machine.

The created distributed virtual machine acts as a server if the process wasn't spawned. Other wise, the controller acts a a local controller synchronized throught the distributed virtual machine to the other controllers

virtual PsPvmController::~PsPvmController   [virtual]
 

Destructor.


Member Function Documentation

virtual void PsPvmController::advanceSimulatedDate   [virtual]
 

redefine advanceSimulatedDate to include datation of synchronisation messages any try to send data between a call to computeNextSimualtionStep and advanceSimulatedDate will cause an assertion to fail

Reimplemented from PsController.

virtual void PsPvmController::computeNextSimulationStep   [virtual]
 

redefine computeNextSimulationStep to include the synchronisation primitives

Reimplemented from PsController.

Reimplemented in PsMultiThreadedPvmController.

Referenced by PsMultiThreadedPvmController::computeNextSimulationStep().

virtual PsnMirrorObjectHandle* PsPvmController::createMirrorObject PsObjectDescriptor   objectDescription [protected, virtual]
 

Create a miror object.

Reimplemented from PsDistributedController.

virtual void PsPvmController::finish   [virtual]
 

redefine to avoid going into blocking mode when finishing the simulation

Reimplemented from PsController.

virtual PsnSvm* PsPvmController::getDistributedVirtualMachine   [virtual]
 

get access to the siames distributed virtual machine

virtual int PsPvmController::getOutputHistorySize void    [protected, virtual]
 

get the size of the history fifo needed when running a distributed simulation.

The result depends on the latency used

Reimplemented from PsController.

virtual const PsName& PsPvmController::getProcessName   const [virtual]
 

get the name of the process this controller is controlling

Referenced by PsnMirrorObjectHandle::registerToReferenceObject().

virtual PsDate PsPvmController::getPurgeDate   [protected, virtual]
 

redefine to take latency into account

Reimplemented from PsController.

virtual void PsPvmController::init   [virtual]
 

redefine for distributed initialisation

Reimplemented from PsController.

virtual void PsPvmController::makeSynchronisationMessage PsNameToPointerMap< PsnReferenceObjectHandle > &    referenceObjects [virtual]
 

make the synchronisation message to be sent to all processes

PsnDuplicatedObjectHandle* PsPvmController::newPsnDuplicatedObjectHandle PsSimulatedObject   object [protected, virtual]
 

create an object handle adapted to handling of duplicated objects

Parameters:
object : the object the object handle will have to handle : the adapted duplicated object handle

Implements PsDistributedController.

PsnMirrorObjectHandle* PsPvmController::newPsnMirrorObjectHandle PsSimulatedObject   obj [protected, virtual]
 

create an object handle for objects mirrored by this controller

Parameters:
object : the object the object handle will have to handle : the mirror object handle

Implements PsDistributedController.

virtual PsnReferenceObjectHandle* PsPvmController::newPsnReferenceObjectHandle PsSimulatedObject   object,
PsController   controller,
PsnSignalDispatcher   signalDispatcher
[protected, virtual]
 

create a reference object handler appropriate for this controller

Parameters:
obj the object to handle the reference object created

Reimplemented from PsController.

virtual void PsPvmController::parseSynchronisationMessage PsnPvmIncomingMessage   message [virtual]
 

parse the received synchronisation messages.

this member function is called by the siames virtual machine when it receives synchronisation messages from distant workstations

Parameters:
message the message to parse

Referenced by PsnSvm::processReceivedMessages(), PsnSvm::synchroniseReceiveAndProcessMessages(), PsnSvm::waitAndProcessMessages(), PsnSvm::waitForAnswerToBlockingRequest(), PsnSvm::waitForMessage(), and PsnSvm::waitForMessageFrom().

virtual PsnObjectHandle* PsPvmController::removeObjectFromDataStructures const PsName   nom [protected, virtual]
 

gestion de la destruction distribuée : destruction des structures locales

Reimplemented from PsController.

virtual void PsPvmController::run   [virtual]
 

redefine run so that it does nothing unless the controller belongs to a spawned process

Reimplemented from PsController.

Reimplemented in PsMultiThreadedPvmController.

Referenced by PsMultiThreadedPvmController::run().

virtual void PsPvmController::sendInitialValuesToMirror PsnPvmIncomingMessage   message [virtual]
 

answer to a MirrorNeedsInitialValues message received by the distributed subsystem

Referenced by PsnSvm::synchroniseReceiveAndProcessMessages(), and PsnSvm::waitForAnswerToBlockingRequest().

virtual void PsPvmController::waitForAnswerToBlockingRequest PsnPvmMessage::MessageTag    tag [virtual]
 

waitForAnswerToBlockingRequest.

make the controller fall bake in a server mode until message tag arrives and is succesfully processed

Referenced by PsnMirrorObjectHandle::registerToReferenceObject().


Member Data Documentation

PsnSvm* PsPvmController::_distributedVirtualMachine [protected]
 

the distributed virtual machine used by the controller

Definition at line 154 of file PsPvmController.h.

bool PsPvmController::_finishing [protected]
 

boolean indicating the controller is going into shutdown mode.

No blocking calls should be made

Definition at line 163 of file PsPvmController.h.


The documentation for this class was generated from the following file:
logo OpenMask

Documentation generated on Mon Nov 25 15:26:21 2002

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