1 // Copyright (C) 2006-2015 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;
31 const char InlineNode::LOCAL_STR[]="local";
33 const char InlineNode::REMOTE_STR[]="remote";
35 InlineNode::~InlineNode()
38 _container->decrRef();
41 void InlineNode::accept(Visitor *visitor)
43 visitor->visitInlineNode(this);
46 //! Set the script (as a string) to execute
48 * \param script: script to execute
50 void InlineNode::setScript(const std::string& script)
57 InlineFuncNode::~InlineFuncNode()
61 void InlineFuncNode::accept(Visitor *visitor)
63 visitor->visitInlineFuncNode(this);
67 * \param fname: name of the function contained in the script to execute
69 void InlineFuncNode::setFname(const std::string& fname)
75 void InlineFuncNode::checkBasicConsistency() const throw(YACS::Exception)
77 InlineNode::checkBasicConsistency();
80 string mess = "Function name is not defined";
81 throw Exception(mess);
85 void InlineNode::setExecutionMode(const std::string& mode)
87 if(mode == _mode)return;
88 if(mode == LOCAL_STR || mode == REMOTE_STR)
95 std::string InlineNode::getExecutionMode()
100 Container* InlineNode::getContainer()
105 void InlineNode::setContainer(Container* cont)
107 if (cont == _container) return;
109 _container->decrRef();
112 _container->incrRef();
115 void InlineNode::performDuplicationOfPlacement(const Node& other)
117 const InlineNode &otherC=*(dynamic_cast<const InlineNode *>(&other));
118 //if other has no container don't clone: this will not have one
119 if(otherC._container)
120 _container=otherC._container->clone();
123 void InlineNode::performShallowDuplicationOfPlacement(const Node& other)
125 const InlineNode &otherC=*(dynamic_cast<const InlineNode *>(&other));
126 //if other has no container don't clone: this will not have one
127 if(otherC._container)
129 _container=otherC._container;
130 _container->incrRef();
134 bool InlineNode::isDeployable() const
136 if(_mode==REMOTE_STR)