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

PsMultiThreadedPvmController.h

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 #ifndef PsMultiThreadedPvmControllerHEADER
00019 #define PsMultiThreadedPvmControllerHEADER
00020 
00021 
00022 #include "PsPvmController.h"
00023 #include "PsnMutexLock.h"
00024 #include "PsnMutexLock.h"
00025 #include "PsnCondition.h"
00026 
00027 class PsnScheduler ;
00028 
00038 class PsMultiThreadedPvmController : public PsPvmController 
00039 {
00040 public:
00045    PsMultiThreadedPvmController(PsObjectDescriptor & initialObjects, 
00046                              const PsDate & initialDate,
00047                              int argc,
00048                              char * argv [] ) ;
00049 
00051    virtual ~PsMultiThreadedPvmController() ;
00052 
00054    virtual PsnScheduler * createScheduler () ;
00055 
00057    virtual void run() ;
00058 
00063    virtual PsSimulatedObject * getPointerToSimulatedObjectNamed (const PsName & objectName );
00064 
00066    virtual void computeNextSimulationStep() ;
00067 
00068 protected:
00070    unsigned int _numberOfThreads ;
00071 
00073    mutable PsnMutexLock _dataLock ;
00074  
00076    mutable PsnCondition _accessCondition ;
00077 
00079    mutable pthread_t _accessingThread ;
00080 
00082    map<PsName, PsSimulatedObject * > _pointerToObjectCache ;
00083 
00085    map<PsName, PsSimulatedObject * > _addToCache ;
00086 
00087 };
00088 #endif

logo OpenMask

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

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