Salome HOME
dade5c643e7c3e95ed24e9bdf80cd47e4fc42e07
[modules/yacs.git] / src / engine / ServiceNode.hxx
1 // Copyright (C) 2006-2022  CEA/DEN, EDF R&D
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 __SERVICENODE_HXX__
21 #define __SERVICENODE_HXX__
22
23 #include "YACSlibEngineExport.hxx"
24 #include "ElementaryNode.hxx"
25
26 #include <string>
27
28 namespace YACS
29 {
30   namespace ENGINE
31   {
32     class ComponentInstance;
33
34     class YACSLIBENGINE_EXPORT ServiceNode : public ElementaryNode
35     {
36     protected:
37       ServiceNode(const std::string& name);
38       ServiceNode(const ServiceNode& other, ComposedNode *father);
39       void performDuplicationOfPlacement(const Node& other);
40       void performShallowDuplicationOfPlacement(const Node& other);
41     public:
42       virtual void load();
43       virtual bool isDeployable() const;
44       virtual void setComponent(ComponentInstance* compo) ;
45       virtual ComponentInstance *getComponent();
46       virtual const ComponentInstance *getComponent() const;
47       virtual Container *getContainer();
48       virtual void setRef(const std::string& ref);
49       virtual std::string getRef();
50       virtual void setMethod(const std::string& method) { _method=method; }
51       virtual std::string getMethod(){return _method;}
52       virtual ServiceNode *createNode(const std::string& name) = 0;
53       virtual ~ServiceNode();
54       virtual void accept(Visitor *visitor);
55       virtual std::string getKind() const;
56       virtual std::string typeName() { return "YACS__ENGINE__ServiceNode"; }
57     public:
58       static const char KIND[];
59     protected:
60       ComponentInstance *_component;
61       std::string _method;
62       std::string _ref;
63     };
64   }
65 }
66
67 #endif