Salome HOME
aebcfffbd9ea04a6bd1b54f7edf9608f78fe55f6
[modules/yacs.git] / src / runtime / CppNode.hxx
1
2 #ifndef _CPPNODE_HXX_
3 #define _CPPNODE_HXX_
4
5 #include "ServiceNode.hxx"
6
7 namespace YACS
8 {
9   namespace ENGINE
10   {
11     class Any;
12
13     // local C++ implementation - single process
14
15     class CppComponent;
16
17     typedef void (*MYRUN)(int nbin, int nbout, 
18                           YACS::ENGINE::Any **in, YACS::ENGINE::Any ** out);
19     
20 /*! \brief Class for C++ Nodes (in process component)
21  *
22  * local C++ implementation - single process
23  *
24  * \ingroup Nodes
25  *
26  */
27     class CppNode : public YACS::ENGINE::ServiceNode 
28     {
29     protected:
30       Node *simpleClone(ComposedNode *father, bool editionOnly) const;
31     public:
32       CppNode(const CppNode &other, ComposedNode *father);
33       CppNode(const std::string &name);
34       virtual void load();
35       virtual void execute();
36       virtual ServiceNode* createNode(const std::string& name);
37       CppNode* cloneNode(const std::string& name);
38
39       void setCode(const std::string & componentName, const std::string & service);
40       void setFunc(MYRUN fonc);
41     
42       static const char IMPL_NAME[];
43       static const char KIND[];
44       std::string getKind() const { return CppNode::KIND; }
45     protected:
46       std::string _componentName;
47       MYRUN _run;
48
49     };
50   }
51 }
52
53 #endif