Salome HOME
Update copyrights 2014.
[modules/yacs.git] / src / engine / ServiceNode.hxx
1 // Copyright (C) 2006-2014  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     public:
41       virtual void load();
42       virtual bool isDeployable() const;
43       virtual void setComponent(ComponentInstance* compo) throw(Exception);
44       virtual ComponentInstance *getComponent();
45       virtual Container *getContainer();
46       virtual void setRef(const std::string& ref);
47       virtual std::string getRef();
48       virtual void setMethod(const std::string& method){ _method=method; }
49       virtual std::string getMethod(){return _method;}
50       virtual ServiceNode *createNode(const std::string& name) = 0;
51       virtual ~ServiceNode();
52       virtual void accept(Visitor *visitor);
53       virtual std::string getKind() const;
54       static const char KIND[];
55       virtual std::string typeName() {return "YACS__ENGINE__ServiceNode";}
56     protected:
57       ComponentInstance* _component;
58       std::string _method;
59       std::string _ref;
60     };
61   }
62 }
63
64 #endif