]> SALOME platform Git repositories - modules/yacs.git/blob - src/runtime/SalomeContainerTools.hxx
Salome HOME
Revert commit bc803f251236fa3b020c (14/03/2020) due to new ForEachLoopDyn implementation
[modules/yacs.git] / src / runtime / SalomeContainerTools.hxx
1 // Copyright (C) 2006-2020  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #pragma once
21
22 #include "YACSRuntimeSALOMEExport.hxx"
23 #include "SALOMEconfig.h"
24 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
25
26 #include <string>
27 #include <vector>
28 #include <map>
29
30 namespace YACS
31 {
32   namespace ENGINE
33   {
34     class Task;
35     class Container;
36     class ComponentInstance;
37     class SalomeContainerHelper;
38
39     class YACSRUNTIMESALOME_EXPORT SalomeContainerTools
40     {
41     public:
42       SalomeContainerTools();
43       SalomeContainerTools(const SalomeContainerTools& other);
44       std::string getProperty(const std::string& name) const;
45       void setProperty(const std::string& name, const std::string& value);
46       const std::map<std::string,std::string>& getProperties() const { return _propertyMap; }
47       void clearProperties();
48       std::map<std::string,std::string> getResourceProperties(const std::string& name) const;
49       void addToComponentList(const std::string& name);
50       void addToResourceList(const std::string& name);
51     public:
52       std::string getContainerName() const;
53       void setContainerName(const std::string& name);
54       std::string getNotNullContainerName(const Container *contPtr, const Task *askingNode, bool& isEmpty) const;
55       std::string getHostName() const;
56       Engines::ContainerParameters getParameters() const { return _params; }
57       static void SetContainerNameOf(Engines::ContainerParameters& params, const std::string& name);
58     public:
59       static void Start(const std::vector<std::string>& compoNames, SalomeContainerHelper *schelp, SalomeContainerTools& sct, int& shutdownLevel, const Container *cont, const Task *askingNode);
60       static CORBA::Object_ptr LoadComponent(SalomeContainerHelper *launchModeType, Container *cont, Task *askingNode);
61       static CORBA::Object_ptr CreateComponentInstance(Container *cont, Engines::Container_ptr contPtr, const ComponentInstance *inst);
62       static std::string GetPlacementId(const SalomeContainerHelper *launchModeType, const Container *cont, const Task *askingNode);
63       static std::string GetFullPlacementId(const SalomeContainerHelper *launchModeType, const Container *cont, const Task *askingNode);
64     protected:
65       std::map<std::string,std::string> _propertyMap;
66       Engines::ContainerParameters _params;
67     };
68   }
69 }