Salome HOME
copy tag mergefrom_BR_V0_1_CC_Salome_04oct07
[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     // local C++ implementation - single process
12
13     class CppComponent;
14
15     typedef void (*MYRUN)(int nbin, int nbout, 
16                           YACS::ENGINE::Any **in, YACS::ENGINE::Any ** out);
17     
18 /*! \brief Class for C++ Nodes (in process component)
19  *
20  * local C++ implementation - single process
21  *
22  * \ingroup Nodes
23  *
24  */
25     class CppNode : public YACS::ENGINE::ServiceNode 
26     {
27     protected:
28       Node *simpleClone(ComposedNode *father, bool editionOnly) const;
29     public:
30       CppNode(const CppNode &other, ComposedNode *father);
31       CppNode(const std::string &name);
32       virtual void load();
33       virtual void execute();
34       virtual ServiceNode* createNode(const std::string& name);
35       CppNode* cloneNode(const std::string& name);
36
37       void setCode(const std::string & componentName, const std::string & service);
38       void setFunc(MYRUN fonc);
39     
40       static const char IMPL_NAME[];
41       static const char KIND[];
42       std::string getKind() const { return CppNode::KIND; }
43     protected:
44       std::string _componentName;
45       MYRUN _run;
46
47     };
48   }
49 }
50
51 #endif