1 // Copyright (C) 2006-2014 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "InlineNode.hxx"
21 #include "Visitor.hxx"
22 #include "Container.hxx"
26 #include "YacsTrace.hxx"
28 using namespace YACS::ENGINE;
32 InlineNode::~InlineNode()
35 _container->decrRef();
38 void InlineNode::accept(Visitor *visitor)
40 visitor->visitInlineNode(this);
43 //! Set the script (as a string) to execute
45 * \param script: script to execute
47 void InlineNode::setScript(const std::string& script)
54 InlineFuncNode::~InlineFuncNode()
58 void InlineFuncNode::accept(Visitor *visitor)
60 visitor->visitInlineFuncNode(this);
64 * \param fname: name of the function contained in the script to execute
66 void InlineFuncNode::setFname(const std::string& fname)
72 void InlineFuncNode::checkBasicConsistency() const throw(YACS::Exception)
74 InlineNode::checkBasicConsistency();
77 string mess = "Function name is not defined";
78 throw Exception(mess);
82 void InlineNode::setExecutionMode(const std::string& mode)
84 if(mode == _mode)return;
85 if(mode == "local"||mode == "remote")
92 std::string InlineNode::getExecutionMode()
97 Container* InlineNode::getContainer()
102 void InlineNode::setContainer(Container* cont)
104 if (cont == _container) return;
106 _container->decrRef();
109 _container->incrRef();
112 void InlineNode::performDuplicationOfPlacement(const Node& other)
114 const InlineNode &otherC=*(dynamic_cast<const InlineNode *>(&other));
115 //if other has no container don't clone: this will not have one
116 if(otherC._container)
117 _container=otherC._container->clone();
120 bool InlineNode::isDeployable() const