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

PsnProcess.cxx

Go to the documentation of this file.
00001 /*
00002  * This file is part of openMask © INRIA, CNRS, Universite de Rennes 1 1993-2002, thereinafter the Software
00003  * 
00004  * The Software has been developped within the Siames Project. 
00005  * INRIA, the University of Rennes 1 and CNRS jointly hold intellectual property rights
00006  * 
00007  * The Software has been registered with the Agence pour la Protection des
00008  * Programmes (APP) under registration number IDDN.FR.001.510008.00.S.P.2001.000.41200
00009  *  
00010  * This file may be distributed under the terms of the Q Public License
00011  * version 1.0 as defined by Trolltech AS of Norway and appearing in the file
00012  * LICENSE.QPL included in the packaging of this file.
00013  *
00014  * Licensees holding valid specific licenses issued by INRIA, CNRS or Université de Rennes 1 
00015  * for the software may use this file in accordance with that specific license
00016  *
00017  */
00018 #include <PsnProcess.h>
00019 #include <PsnSvmLink.h>
00020 #include "PsController.h"
00021 //-----------------------------------------------------------------------------
00022 
00023 PsnProcess::PsnProcess (const string & np, const string & mac)
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 }
00033 
00034 //-----------------------------------------------------------------------------
00035 
00036 PsnProcess::~PsnProcess () {
00037 
00038 }
00039 
00040 //-----------------------------------------------------------------------------
00041 
00042 void PsnProcess::pack (PsOutgoingSynchronisationMessage & out) const
00043 {
00044    _processName.pack(out) ;
00045    _svmLink->pack(out) ;
00046 }
00047 
00048 //-----------------------------------------------------------------------------
00049 
00050 void PsnProcess::unpack (PsIncomingSynchronisationMessage & in) 
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 }
00061 
00062 
00063 //-----------------------------------------------------------------------------
00064 
00065 const PsName & PsnProcess::getProcessName () const 
00066 {
00067    return _processName ;
00068 }
00069  
00070 //-----------------------------------------------------------------------------
00071 
00072 const PsName & PsnProcess::getHostMachineName () const 
00073 {
00074    return _machineName ;
00075 }
00076 
00077 
00078 //-----------------------------------------------------------------------------
00079 
00080 const PsFrequency & PsnProcess::getFrequency () const 
00081 {
00082   return _processFrequency ;
00083 }
00084 
00085 //-----------------------------------------------------------------------------
00086 
00087 const PsFrequency & PsnProcess::getMaxFrequencyOfHostedObjects () const 
00088 {
00089    return _maxHostedFrequency ;
00090 }
00091 
00092 //-----------------------------------------------------------------------------
00093 
00094 PsnSvmLink * PsnProcess::getSvmLink () const 
00095 {
00096    return _svmLink ;
00097 }
00098 
00099 //-----------------------------------------------------------------------------
00100 
00101 void PsnProcess::setFrequency (const PsFrequency & val) 
00102 {
00103    _processFrequency = val ;
00104    _period = PsNumericTypeT<double>(1.0) / val ;
00105 }
00106 
00107 //-----------------------------------------------------------------------------
00108 
00109 void PsnProcess::setMaxHostedFrequency (const PsFrequency & val) 
00110 {
00111    _maxHostedFrequency = val ;
00112 } 
00113 
00114 //-----------------------------------------------------------------------------
00115 
00116 void PsnProcess::setSvmLink (PsnSvmLink * val) 
00117 {
00118    _svmLink = val ;
00119 }
00120 
00121 
00122 
00123 void PsnProcess::setDateOfLastMessage ( const PsDate & d )
00124 {
00125    _dateOfLastMessage = d ;
00126 }
00127 
00128 
00129 
00130 const PsDate & PsnProcess::getDateOfLastMessage () const 
00131 {
00132    return _dateOfLastMessage ;
00133 }
00134 
00135 
00136 const PsDate & PsnProcess::getPeriod () const 
00137 {
00138    return _period ;
00139 }
00140 
00141 
00142 
00143 
00144 
00145 
00146 
00147 
00148 
00149 

logo OpenMask

Documentation generated on Mon Nov 25 15:25:01 2002

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