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

PsnProcess Class Reference

How the distributed kernel for a message passing architecture sees processes. More...

#include <PsnProcess.h>

Inheritance diagram for PsnProcess:

Inheritance graph
[legend]
Collaboration diagram for PsnProcess:

Collaboration graph
[legend]
List of all members.

Public Methods

 PsnProcess (const string &np, const string &mac)
 Constructor.

virtual ~PsnProcess ()
 Destructor.

virtual void unpack (PsIncomingSynchronisationMessage &)
 unpack from a message

virtual void pack (PsOutgoingSynchronisationMessage &) const
 pack in a message

const PsNamegetProcessName () const
 name of the process

const PsNamegetHostMachineName () const
 name of the machine associated to this process

const PsFrequencygetFrequency () const
 Frequency of the controller of the process.

const PsFrequencygetMaxFrequencyOfHostedObjects () const
 maximum frequency of the hosted simulated objects

PsnSvmLinkgetSvmLink () const
 link to the global controller

const PsDategetDateOfLastMessage () const
 Date of the last received message from that process.

const PsDategetPeriod () const
 get the period (in seconds) of the process

void setDateOfLastMessage (const PsDate &d)
 change the date of last message received for this process in this adress space

void setFrequency (const PsFrequency &val)
 change the frequency of this process

void setMaxHostedFrequency (const PsInt &val)
 maximum des fréquence des référentiels hébergés

void setSvmLink (PsnSvmLink *val)
 change the link to the global controller


Protected Attributes

PsDate _dateOfLastMessage
 date of last reception of a message from this process

PsDate _period
 time interval between two supposed receptions from this process.

PsName _processName
 name of the process

PsName _machineName
 machine hosting the process

PsFrequency _processFrequency
 frequency of the process

PsFrequency _maxHostedFrequency
 highest frequency of the process

PsnSvmLink_svmLink
 pointer to the link to the global controller


Detailed Description

How the distributed kernel for a message passing architecture sees processes.

Author:
Siames
Version:
1.0

Definition at line 32 of file PsnProcess.h.


Constructor & Destructor Documentation

PsnProcess::PsnProcess const string &    np,
const string &    mac
 

Constructor.

Definition at line 23 of file PsnProcess.cxx.

References PsController::lcm().

00024             : PsPackable(),
00025               _processName(np),
00026               _dateOfLastMessage ( PsController::initialSimulationDate ), //why not ?
00027               _machineName(mac), 
00028               _maxHostedFrequency (0), //gives a stable point in calculating max
00029               _processFrequency (1) //give a stable point when calculing least common multiplier 
00030 {
00031    assert ( PsController::lcm ( 13 , 1 ) == 13 ) ; //make sure lcm implementation has 1 as stable point.
00032 }

PsnProcess::~PsnProcess   [virtual]
 

Destructor.

Definition at line 36 of file PsnProcess.cxx.

00036                          {
00037 
00038 }


Member Function Documentation

const PsDate & PsnProcess::getDateOfLastMessage   const
 

Date of the last received message from that process.

Definition at line 130 of file PsnProcess.cxx.

References _dateOfLastMessage, and PsDate.

00131 {
00132    return _dateOfLastMessage ;
00133 }

const PsFrequency & PsnProcess::getFrequency   const
 

Frequency of the controller of the process.

Definition at line 80 of file PsnProcess.cxx.

References _processFrequency, and PsFrequency.

00081 {
00082   return _processFrequency ;
00083 }

const PsName & PsnProcess::getHostMachineName   const
 

name of the machine associated to this process

Definition at line 72 of file PsnProcess.cxx.

References _machineName.

00073 {
00074    return _machineName ;
00075 }

const PsFrequency & PsnProcess::getMaxFrequencyOfHostedObjects   const
 

maximum frequency of the hosted simulated objects

Definition at line 87 of file PsnProcess.cxx.

References _maxHostedFrequency, and PsFrequency.

00088 {
00089    return _maxHostedFrequency ;
00090 }

const PsDate & PsnProcess::getPeriod   const
 

get the period (in seconds) of the process

Definition at line 136 of file PsnProcess.cxx.

References _period, and PsDate.

00137 {
00138    return _period ;
00139 }

const PsName & PsnProcess::getProcessName   const
 

name of the process

Definition at line 65 of file PsnProcess.cxx.

References _processName.

Referenced by PsnSvm::synchroniseReceiveAndProcessMessages().

00066 {
00067    return _processName ;
00068 }

PsnSvmLink * PsnProcess::getSvmLink   const
 

link to the global controller

Definition at line 94 of file PsnProcess.cxx.

References _svmLink.

Referenced by PsnSvm::connectToDistributedSimulation(), PsnSvm::createDistributedSimulation(), PsnSvm::getLinkToProcessNamed(), and PsnSvm::synchroniseReceiveAndProcessMessages().

00095 {
00096    return _svmLink ;
00097 }

void PsnProcess::pack PsOutgoingSynchronisationMessage   const [virtual]
 

pack in a message

Implements PsPackable.

Definition at line 42 of file PsnProcess.cxx.

References _processName, _svmLink, PsPackable::pack(), and PsName::pack().

00043 {
00044    _processName.pack(out) ;
00045    _svmLink->pack(out) ;
00046 }

void PsnProcess::setDateOfLastMessage const PsDate   d
 

change the date of last message received for this process in this adress space

Definition at line 123 of file PsnProcess.cxx.

References _dateOfLastMessage, and PsDate.

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

00124 {
00125    _dateOfLastMessage = d ;
00126 }

void PsnProcess::setFrequency const PsFrequency   val
 

change the frequency of this process

Definition at line 101 of file PsnProcess.cxx.

References _period, _processFrequency, and PsFrequency.

00102 {
00103    _processFrequency = val ;
00104    _period = PsNumericTypeT<double>(1.0) / val ;
00105 }

void PsnProcess::setMaxHostedFrequency const PsInt   val
 

maximum des fréquence des référentiels hébergés

void PsnProcess::setSvmLink PsnSvmLink   val
 

change the link to the global controller

Definition at line 116 of file PsnProcess.cxx.

References _svmLink.

Referenced by PsnSvm::connectToDistributedSimulation(), and PsnSvm::createDistributedSimulation().

00117 {
00118    _svmLink = val ;
00119 }

void PsnProcess::unpack PsIncomingSynchronisationMessage   [virtual]
 

unpack from a message

Implements PsPackable.

Definition at line 50 of file PsnProcess.cxx.

References _processName, and _svmLink.

00051 {
00052 #ifdef _DEBUGPVMMESS 
00053   cerr<<"PsnProcess::extract "<<endl;
00054 #endif
00055    in >> _processName >> *_svmLink ;
00056 
00057 #ifdef _DEBUGPVMMESS 
00058    cerr<<"process named "<<_processName<<endl;
00059 #endif
00060 }


Member Data Documentation

PsDate PsnProcess::_dateOfLastMessage [protected]
 

date of last reception of a message from this process

Definition at line 84 of file PsnProcess.h.

Referenced by getDateOfLastMessage(), and setDateOfLastMessage().

PsName PsnProcess::_machineName [protected]
 

machine hosting the process

Definition at line 96 of file PsnProcess.h.

Referenced by getHostMachineName().

PsFrequency PsnProcess::_maxHostedFrequency [protected]
 

highest frequency of the process

Definition at line 102 of file PsnProcess.h.

Referenced by getMaxFrequencyOfHostedObjects().

PsDate PsnProcess::_period [protected]
 

time interval between two supposed receptions from this process.

should be equal to 1/frequency

Definition at line 90 of file PsnProcess.h.

Referenced by getPeriod(), and setFrequency().

PsFrequency PsnProcess::_processFrequency [protected]
 

frequency of the process

Definition at line 99 of file PsnProcess.h.

Referenced by getFrequency(), and setFrequency().

PsName PsnProcess::_processName [protected]
 

name of the process

Definition at line 93 of file PsnProcess.h.

Referenced by getProcessName(), pack(), and unpack().

PsnSvmLink* PsnProcess::_svmLink [protected]
 

pointer to the link to the global controller

Definition at line 105 of file PsnProcess.h.

Referenced by getSvmLink(), pack(), setSvmLink(), and unpack().


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

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

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