1 // Copyright (C) 2006-2024 CEA, EDF
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef __SALOMECONTAINER_HXX__
21 #define __SALOMECONTAINER_HXX__
23 #include "YACSRuntimeSALOMEExport.hxx"
24 #include "Container.hxx"
25 #include "SalomeContainerTools.hxx"
26 #include "SalomeContainerHelper.hxx"
30 #include CORBA_CLIENT_HEADER(SALOME_Component)
36 class SalomeComponent;
38 class YACSRUNTIMESALOME_EXPORT SalomeContainer : public Container
40 friend class SalomeComponent;
43 SalomeContainer(const SalomeContainer& other);
45 SalomeContainer(const Container& other, const SalomeContainerTools& sct, const SalomeContainerHelper *lmt, const std::vector<std::string>& componentNames, int shutdownLev);
47 //! For thread safety for concurrent load operation on same Container.
49 //! For thread safety for concurrent load operation on same Container.
51 std::string getKind() const;
52 bool isAlreadyStarted(const Task *askingNode) const;
53 Engines::Container_ptr getContainerPtr(const Task *askingNode) const;
54 void start(const Task *askingNode) override;
55 void start(const Task *askingNode,
56 const std::string& resource_name,
57 const std::string& container_name) override;
58 bool canAcceptImposedResource() override;
59 Container *clone() const;
60 Container *cloneAlways() const;
61 std::string getPlacementId(const Task *askingNode) const;
62 std::string getFullPlacementId(const Task *askingNode) const;
63 void checkCapabilityToDealWith(const ComponentInstance *inst) const ;
64 void setProperty(const std::string& name, const std::string& value);
65 std::string getProperty(const std::string& name) const;
66 void clearProperties();
67 void addComponentName(const std::string& name);
68 void addToResourceList(const std::string& name);
69 virtual CORBA::Object_ptr loadComponent(Task *inst);
70 void shutdown(int level);
72 std::map<std::string,std::string> getResourceProperties(const std::string& name) const;
73 std::map<std::string,std::string> getProperties() const;
74 static const char KIND[];
75 static const char TYPE_PROPERTY_STR[];
78 virtual ~SalomeContainer();
81 //! thread safety in Salome ???
82 YACS::BASES::Mutex _mutex;
83 std::vector<std::string> _componentNames;
84 SalomeContainerHelper *_launchModeType;
86 SalomeContainerTools _sct;