Salome HOME
merge from branch DEV tag mergeto_trunk_04apr08
[modules/yacs.git] / src / engine / ServiceNode.hxx
1 #ifndef __SERVICENODE_HXX__
2 #define __SERVICENODE_HXX__
3
4 #include "ElementaryNode.hxx"
5 #include <string>
6
7 namespace YACS
8 {
9   namespace ENGINE
10   {
11     class ComponentInstance;
12
13 /*! \brief Class for calculation node associated with a component service
14  *
15  * \ingroup Nodes
16  *
17  * \see InlineNode
18  * \see ElementaryNode
19  */
20     class ServiceNode: public ElementaryNode 
21     {
22     protected:
23       ServiceNode(const std::string& name);
24       ServiceNode(const ServiceNode& other, ComposedNode *father);
25       void performDuplicationOfPlacement(const Node& other);
26     public:
27       virtual void load();
28       virtual bool isDeployable() const;
29       virtual void setComponent(ComponentInstance* compo) throw(Exception);
30       virtual ComponentInstance *getComponent();
31       virtual void setRef(const std::string& ref);
32       virtual std::string getRef();
33       virtual void setMethod(const std::string& method){ _method=method; }
34       virtual std::string getMethod(){return _method;}
35       virtual ServiceNode *createNode(const std::string& name) = 0;
36       virtual ~ServiceNode();
37       virtual void accept(Visitor *visitor);
38
39 //! Return the service node kind
40 /*!
41  * A runtime can provide several implementations of a service node.
42  * Each implementation has a different kind. A ComponentInstance can be
43  * associated to a ServiceNode with the same kind.
44  */
45       virtual std::string getKind() const;
46       static const char KIND[];
47       virtual std::string typeName() {return "YACS__ENGINE__ServiceNode";}
48     protected:
49       ComponentInstance* _component;
50       std::string _method;
51       std::string _ref;
52     };
53   }
54 }
55
56 #endif