1 #ifndef __INLINENODE_HXX__
2 #define __INLINENODE_HXX__
4 #include "ElementaryNode.hxx"
11 /*! \brief Class for calculation node (script) inlined (and executed) in the schema
15 * This node is like a script. It has no state if it is executed several times.
16 * Each execution the string _script is executed within a clean context.
21 class InlineNode : public ElementaryNode
24 InlineNode(const InlineNode& other, ComposedNode *father)
25 :ElementaryNode(other,father),_script(other._script) { }
26 InlineNode(const std::string& name):ElementaryNode(name) { }
28 //! Set the script (as a string) to execute
30 * \param script: script to execute
32 virtual void setScript(const std::string& script) { _script=script; }
33 virtual std::string getScript(){return _script;}
35 //! Return a new InlineNode node by making a copy of this node
37 * \param name: name of the new node
38 * \return the new node built by cloning.
40 virtual InlineNode* cloneNode(const std::string& name)
41 { throw Exception("Not implemented");};
42 virtual void accept(Visitor *visitor);
43 virtual ~InlineNode();
48 /*! \brief Class for calculation node (function) inlined (and executed) in the schema
52 * This node is like a function. It can have a state. The first time the node
53 * is executed, the string _script is executed in a clean context followed by the
54 * execution of the function _fname. Next times, the function _fname is executed
55 * within the preserved context.
60 class InlineFuncNode : public InlineNode
63 InlineFuncNode(const InlineFuncNode& other, ComposedNode *father)
64 :InlineNode(other,father),_fname(other._fname) { }
65 InlineFuncNode(const std::string& name):InlineNode(name) { }
67 //! Set the function name to use in node execution
69 * \param fname: name of the function contained in the script to execute
71 virtual void setFname(const std::string& fname) { _fname=fname; }
72 virtual std::string getFname() { return _fname; }
73 void accept(Visitor *visitor);
74 virtual ~InlineFuncNode();