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 __CONTAINER_HXX__
21 #define __CONTAINER_HXX__
23 #include "YACSlibEngineExport.hxx"
24 #include "Exception.hxx"
25 #include "RefCounter.hxx"
34 class ComponentInstance;
37 * This is an abstract class, that represents an abstract process in which ComponentInstances can be launched and run.
38 * An instance of this will be mapped to one and only one physical container (except in the foreach context)
40 class YACSLIBENGINE_EXPORT Container : public RefCounter
48 //Execution only methods
49 virtual bool isAlreadyStarted(const ComponentInstance *inst) const = 0;
50 virtual void start(const ComponentInstance *inst) throw(Exception) = 0;
51 virtual std::string getPlacementId(const ComponentInstance *inst) const = 0;
52 virtual std::string getFullPlacementId(const ComponentInstance *inst) const = 0;
53 //Edition only methods
54 virtual void attachOnCloning() const;
55 virtual void dettachOnCloning() const;
56 bool isAttachedOnCloning() const;
57 //! \b WARNING ! clone behaviour \b MUST be in coherence with what is returned by isAttachedOnCloning() method
58 virtual Container *clone() const = 0;
59 virtual Container *cloneAlways() const = 0;
60 virtual bool isSupportingRTODefNbOfComp() const;
61 virtual void checkCapabilityToDealWith(const ComponentInstance *inst) const throw(Exception) = 0;
62 virtual void setProperty(const std::string& name,const std::string& value) = 0;
63 virtual std::string getProperty(const std::string& name) const = 0;
64 virtual void clearProperties() = 0;
65 virtual std::map<std::string,std::string> getProperties() const = 0;
66 virtual std::map<std::string,std::string> getResourceProperties(const std::string& name) const = 0;
67 virtual void setProperties(const std::map<std::string,std::string>& properties);
68 std::string getName() const { return _name; };
69 //! \b WARNING ! name is used in edition to identify different containers, it is not the runtime name of the container
70 void setName(std::string name) { _name = name; };
71 void setProc(Proc* proc) { _proc = proc; };
72 Proc* getProc() { return _proc; };
73 virtual void shutdown(int level);
76 mutable bool _isAttachedOnCloning;