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 "RuntimeForEngineTest.hxx"
24 using namespace YACS::ENGINE;
27 TestElemNode::TestElemNode(const TestElemNode& other, ComposedNode *father):ElementaryNode(other,father)
31 Node *TestElemNode::simpleClone(ComposedNode *father, bool editionOnly) const
33 return new TestElemNode(*this,father);
36 TestElemInputPort::TestElemInputPort(const std::string& name, Node *node, TypeCode* type):InputPort(name,node,type),DataPort(name,node,type),Port(node)
40 TestElemInputPort::TestElemInputPort(const TestElemInputPort& other, Node *newHelder):InputPort(other,newHelder),DataPort(other,newHelder),Port(other,newHelder)
44 void TestElemInputPort::put(const void *data) throw(ConversionException)
46 cerr << _name << endl;
48 msg << "Not implemented (" << __FILE__ << ":" << __LINE__ << ")";
49 throw Exception(msg.str());
52 InputPort *TestElemInputPort::clone(Node *newHelder) const
54 return new TestElemInputPort(*this,newHelder);
57 void *TestElemInputPort::get() const throw(YACS::Exception)
60 msg << "Not implemented (" << __FILE__ << ":" << __LINE__ << ")";
61 throw Exception(msg.str());
64 void TestElemInputPort::exRestoreInit()
74 void TestElemInputPort::exSaveInit()
77 _initValue->decrRef();
79 _initValue->incrRef();
82 TestElemOutputPort::TestElemOutputPort(const std::string& name, Node *node, TypeCode* type):OutputPort(name,node,type),DataPort(name,node,type),Port(node)
86 TestElemOutputPort::TestElemOutputPort(const TestElemOutputPort& other, Node *newHelder):OutputPort(other,newHelder),DataPort(other,newHelder),Port(other,newHelder)
90 OutputPort *TestElemOutputPort::clone(Node *newHelder) const
92 return new TestElemOutputPort(*this,newHelder);
95 void TestElemOutputPort::put(const void *data) throw(ConversionException)
97 cerr << _name << endl;
99 msg << "Not implemented (" << __FILE__ << ":" << __LINE__ << ")";
100 throw Exception(msg.str());
103 void RuntimeForEngineTest::setRuntime()
105 if (! Runtime::_singleton)
106 Runtime::_singleton = new RuntimeForEngineTest;
109 ElementaryNode* RuntimeForEngineTest::createNode(const string& implementation, const string& name) throw(YACS::Exception)
111 return new TestElemNode(name);
114 InputPort* RuntimeForEngineTest::createInputPort(const string& name, const string& impl, Node * node, TypeCode * type)
116 return new TestElemInputPort(name, node, type);
119 OutputPort* RuntimeForEngineTest::createOutputPort(const string& name, const string& impl, Node * node, TypeCode * type)
121 return new TestElemOutputPort(name, node, type);
124 InputPort* RuntimeForEngineTest::adapt(InputPort* source, const string& impl,TypeCode * type,bool init) throw (ConversionException)
126 return new ProxyPort(source);
129 InputPort* RuntimeForEngineTest::adapt(InPropertyPort* source, const std::string& impl, TypeCode * type, bool init) throw (ConversionException)
131 return adapt((InputPort *)source,impl,type,init);