1 // Copyright (C) 2006-2014 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"
28 #include <SALOMEconfig.h>
29 #include CORBA_CLIENT_HEADER(SALOME_Component)
30 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
36 class SalomeComponent;
38 class YACSRUNTIMESALOME_EXPORT SalomeContainer : public Container
40 friend class SalomeComponent;
43 SalomeContainer(const SalomeContainer& other);
44 //! For thread safety for concurrent load operation on same Container.
46 //! For thread safety for concurrent load operation on same Container.
48 bool isAlreadyStarted(const ComponentInstance *inst) const;
49 Engines::Container_ptr getContainerPtr(const ComponentInstance *inst) const;
50 void start(const ComponentInstance *inst) throw (Exception);
51 Container *clone() const;
52 std::string getPlacementId(const ComponentInstance *inst) const;
53 std::string getFullPlacementId(const ComponentInstance *inst) const;
54 void checkCapabilityToDealWith(const ComponentInstance *inst) const throw (Exception);
55 virtual void setProperty(const std::string& name, const std::string& value);
56 virtual void addComponentName(std::string name);
57 virtual CORBA::Object_ptr loadComponent(ComponentInstance *inst);
58 virtual void shutdown(int level);
60 void addToComponentList(const std::string & name);
61 void addToResourceList(const std::string & name);
62 virtual std::map<std::string,std::string> getResourceProperties(const std::string& name);
65 virtual ~SalomeContainer();
68 //! thread safety in Salome ???
69 YACS::BASES::Mutex _mutex;
70 Engines::Container_var _trueCont;
71 std::vector<std::string> _componentNames;
72 std::map<const ComponentInstance *,Engines::Container_var> _trueContainers;
76 Engines::ContainerParameters _params;