Back to index

salome-smesh  6.5.0
MeshJobManager_i.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2011-2012  EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 // Authors : Guillaume Boulant (EDF) - 01/03/2011
00020 
00021 #ifndef _MESHJOBMANAGER_HXX_
00022 #define _MESHJOBMANAGER_HXX_
00023 
00024 // include the stubs generating from MESHJOB.idl
00025 #include <SALOMEconfig.h>
00026 #include CORBA_SERVER_HEADER(MESHJOB)
00027 #include CORBA_SERVER_HEADER(SALOME_Component)
00028 #include "SALOME_Component_i.hxx"
00029 
00030 #include "SALOME_Launcher.hxx"
00031 #include <vector>
00032 #include <string>
00033 #include <map>
00034 
00035 class MeshJobManager_i: public virtual POA_MESHJOB::MeshJobManager,
00036                         public Engines_Component_i
00037 {
00038 public:
00039   MeshJobManager_i(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa,
00040                    PortableServer::ObjectId * contId,
00041                    const char *instanceName, const char *interfaceName);
00042   ~MeshJobManager_i();
00043 
00044   bool           configure  (const char *configId,
00045                           const MESHJOB::ConfigParameter & configParameter);
00046   CORBA::Long    initialize (const MESHJOB::MeshJobParameterList & meshJobParameterList,
00047                           const char *configId);
00048   bool           start      (CORBA::Long jobId);
00049   char*          getState   (CORBA::Long jobId);
00050   MESHJOB::MeshJobResults * finalize(CORBA::Long jobId);
00051   MESHJOB::MeshJobPaths *   getPaths(CORBA::Long jobId);
00052   bool           clean      (CORBA::Long jobId);
00053 
00054   static long JOBID_UNDEFINED;
00055 
00056 private:
00057   Engines::SalomeLauncher_var   _salomeLauncher;
00058   Engines::ResourcesManager_var _resourcesManager;
00059   
00060   // This maps the config identifier to the config parameters. A
00061   // config is a resource with additionnal data specifying the
00062   // location of the binary program to be executed by the task
00063   std::map<std::string, MESHJOB::ConfigParameter> _configMap;
00064 
00065   // This maps a job identifier to its associated datetime tag. When
00066   // a job is created during the initialize function, a datetime tag
00067   // is associated to this job and can be used to characterized files
00068   // and directories associated to this job.
00069   std::map<long, long> _jobDateTimeMap;
00070   std::map<long, MESHJOB::MeshJobPaths*> _jobPathsMap;
00071 
00072   const char* _writeDataFile   (std::vector<MESHJOB::MeshJobParameter> listConcreteMesh,
00073                                 std::vector<MESHJOB::MeshJobParameter> listSteelBarMesh);
00074   const char* _writeScriptFile (const char * dataFileName, const char * configId);
00075 
00076   std::vector<std::string> * _getResourceNames();
00077 
00078 };
00079 
00080 #endif
00081