1 // Copyright (C) 2006-2016 CEA/DEN, EDF R&D
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) throw (Exception);
55 Container *clone() const;
56 Container *cloneAlways() const;
57 std::string getPlacementId(const Task *askingNode) const;
58 std::string getFullPlacementId(const Task *askingNode) const;
59 void checkCapabilityToDealWith(const ComponentInstance *inst) const throw (Exception);
60 void setProperty(const std::string& name, const std::string& value);
61 std::string getProperty(const std::string& name) const;
62 void clearProperties();
63 void addComponentName(const std::string& name);
64 void addToResourceList(const std::string& name);
65 virtual CORBA::Object_ptr loadComponent(Task *inst);
66 void shutdown(int level);
68 std::map<std::string,std::string> getResourceProperties(const std::string& name) const;
69 std::map<std::string,std::string> getProperties() const;
70 static const char KIND[];
71 static const char TYPE_PROPERTY_STR[];
74 virtual ~SalomeContainer();
77 //! thread safety in Salome ???
78 YACS::BASES::Mutex _mutex;
79 std::vector<std::string> _componentNames;
80 SalomeContainerHelper *_launchModeType;
82 SalomeContainerTools _sct;