Salome HOME
merge from branch DEV tag mergeto_trunk_04apr08
[modules/yacs.git] / src / engine / Container.hxx
1 #ifndef __CONTAINER_HXX__
2 #define __CONTAINER_HXX__
3
4 #include "Exception.hxx"
5 #include "RefCounter.hxx"
6
7 #include <list>
8 #include <map>
9
10 namespace YACS
11 {
12   namespace ENGINE
13   {
14     class ComponentInstance;
15     /*!
16      * This is an abstract class, that represents an abstract process in which ComponentInstances can be launched and run.
17      */
18     class Container : public RefCounter
19     {
20     protected:
21       Container();
22       virtual ~Container();
23     public:
24       //Execution only methods
25       virtual bool isAlreadyStarted() const = 0;
26       virtual void start() throw(Exception) = 0;
27       virtual std::string getPlacementId() const = 0;
28       //Edition only methods
29       virtual void attachOnCloning() const;
30       virtual void dettachOnCloning() const;
31       bool isAttachedOnCloning() const;
32       //! \b WARNING ! clone behaviour \b MUST be in coherence with what is returned by isAttachedOnCloning() method
33       virtual Container *clone() const = 0;
34       virtual bool isSupportingRTODefNbOfComp() const;
35       virtual void checkCapabilityToDealWith(const ComponentInstance *inst) const throw(Exception) = 0;
36       virtual void setProperty(const std::string& name,const std::string& value);
37       virtual std::string getProperty(const std::string& name);
38       std::map<std::string,std::string> getProperties() { return _propertyMap; };
39       virtual void setProperties(std::map<std::string,std::string> properties);
40       std::string getName() const { return _name; };
41       //! \b WARNING ! name is used in edition to identify different containers, it is not the runtime name of the container
42       void setName(std::string name) { _name = name; };
43     protected:
44       std::string _name;
45       mutable bool _isAttachedOnCloning;
46       std::map<std::string,std::string> _propertyMap;
47     };
48   }
49 }
50
51 #endif