Version: 9.15.0
Container.hxx
Go to the documentation of this file.
1 // Copyright (C) 2006-2025 CEA, EDF
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 #ifndef __CONTAINER_HXX__
21 #define __CONTAINER_HXX__
22 
23 #include "YACSlibEngineExport.hxx"
24 #include "Exception.hxx"
25 #include "RefCounter.hxx"
26 
27 #include <list>
28 #include <map>
29 
30 namespace YACS
31 {
32  namespace ENGINE
33  {
34  class ComponentInstance;
35  class Proc;
36  class Task;
42  {
43  protected:
44  Container();
45 #ifndef SWIG
46  virtual ~Container();
47 #endif
48  public:
49  virtual std::string getKind() const = 0;
50  //Execution only methods
51  virtual std::string getDiscreminantStrOfThis(const Task *askingNode) const;
52  virtual bool isAlreadyStarted(const Task *askingNode) const = 0;
53  virtual void start(const Task *askingNode) = 0;
54  virtual void start(const Task *askingNode,
55  const std::string& resource_name,
56  const std::string& container_name);
57  virtual bool canAcceptImposedResource();
58  virtual bool isUsingPythonCache();
59  virtual void usePythonCache(bool v);
60  virtual std::string getPlacementId(const Task *askingNode) const = 0;
61  virtual std::string getFullPlacementId(const Task *askingNode) const = 0;
62  //Edition only methods
63  virtual void setAttachOnCloningStatus(bool val) const;
64  virtual void attachOnCloning() const;
65  virtual void dettachOnCloning() const;
66  virtual bool isAttachedOnCloning() const;
67  virtual void lock() = 0;
68  virtual void unLock() = 0;
70  virtual Container *clone() const = 0;
71  virtual Container *cloneAlways() const = 0;
72  virtual bool isSupportingRTODefNbOfComp() const;
73  virtual void checkCapabilityToDealWith(const ComponentInstance *inst) const = 0;
74  virtual void setProperty(const std::string& name,const std::string& value) = 0;
75  virtual std::string getProperty(const std::string& name) const = 0;
76  virtual void clearProperties() = 0;
77  virtual void addComponentName(const std::string& name) = 0;
78  virtual std::map<std::string,std::string> getProperties() const = 0;
79  virtual std::map<std::string,std::string> getResourceProperties(const std::string& name) const = 0;
80  virtual void setProperties(const std::map<std::string,std::string>& properties);
81  virtual std::string getName() const { return _name; }
83  void setName(std::string name) { _name = name; }
84  void setProc(Proc* proc) { _proc = proc; }
85  Proc* getProc() { return _proc; }
86  virtual void shutdown(int level) = 0;
87  static const char KIND_ENTRY[];
88  static const char AOC_ENTRY[];
89  static const char USE_PYCACHE_PROPERTY[];
90  protected:
91  std::string _name;
92  mutable bool _isAttachedOnCloning;
94  };
95  }
96 }
97 
98 #endif
#define YACSLIBENGINE_EXPORT
Base class for all component instances.
virtual std::map< std::string, std::string > getProperties() const =0
void setName(std::string name)
WARNING ! name is used in edition to identify different containers, it is not the runtime name of the...
Definition: Container.hxx:83
virtual void start(const Task *askingNode)=0
virtual void shutdown(int level)=0
virtual std::string getKind() const =0
void setProc(Proc *proc)
Definition: Container.hxx:84
virtual bool isAlreadyStarted(const Task *askingNode) const =0
virtual void unLock()=0
virtual void setProperty(const std::string &name, const std::string &value)=0
virtual std::string getFullPlacementId(const Task *askingNode) const =0
virtual void clearProperties()=0
virtual void addComponentName(const std::string &name)=0
virtual std::string getProperty(const std::string &name) const =0
virtual std::string getPlacementId(const Task *askingNode) const =0
virtual Container * cloneAlways() const =0
virtual std::map< std::string, std::string > getResourceProperties(const std::string &name) const =0
virtual Container * clone() const =0
WARNING ! clone behaviour MUST be in coherence with what is returned by isAttachedOnCloning() method
virtual void checkCapabilityToDealWith(const ComponentInstance *inst) const =0
virtual std::string getName() const
Definition: Container.hxx:81
virtual void lock()=0
Base class for all schema objects.
Definition: Proc.hxx:44