1 // Copyright (C) 2006-2021 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::releaseData()
47 msg << "Not implemented (" << __FILE__ << ":" << __LINE__ << ")";
48 throw Exception(msg.str());
51 void TestElemInputPort::put(const void *data)
53 cerr << _name << endl;
55 msg << "Not implemented (" << __FILE__ << ":" << __LINE__ << ")";
56 throw Exception(msg.str());
59 InputPort *TestElemInputPort::clone(Node *newHelder) const
61 return new TestElemInputPort(*this,newHelder);
64 void *TestElemInputPort::get() const
67 msg << "Not implemented (" << __FILE__ << ":" << __LINE__ << ")";
68 throw Exception(msg.str());
71 void TestElemInputPort::exRestoreInit()
81 void TestElemInputPort::exSaveInit()
84 _initValue->decrRef();
86 _initValue->incrRef();
89 TestElemOutputPort::TestElemOutputPort(const std::string& name, Node *node, TypeCode* type):OutputPort(name,node,type),DataPort(name,node,type),Port(node)
93 TestElemOutputPort::TestElemOutputPort(const TestElemOutputPort& other, Node *newHelder):OutputPort(other,newHelder),DataPort(other,newHelder),Port(other,newHelder)
97 OutputPort *TestElemOutputPort::clone(Node *newHelder) const
99 return new TestElemOutputPort(*this,newHelder);
102 void TestElemOutputPort::put(const void *data)
104 cerr << _name << endl;
106 msg << "Not implemented (" << __FILE__ << ":" << __LINE__ << ")";
107 throw Exception(msg.str());
110 void RuntimeForEngineTest::setRuntime()
112 if (! Runtime::_singleton)
113 Runtime::_singleton = new RuntimeForEngineTest;
116 std::vector< std::pair<std::string,int> > RuntimeForEngineTest::getCatalogOfComputeNodes() const
118 return std::vector< std::pair<std::string,int> >();
121 ElementaryNode* RuntimeForEngineTest::createNode(const string& implementation, const string& name)
123 return new TestElemNode(name);
126 InputPort* RuntimeForEngineTest::createInputPort(const string& name, const string& impl, Node * node, TypeCode * type)
128 return new TestElemInputPort(name, node, type);
131 OutputPort* RuntimeForEngineTest::createOutputPort(const string& name, const string& impl, Node * node, TypeCode * type)
133 return new TestElemOutputPort(name, node, type);
136 InputPort* RuntimeForEngineTest::adapt(InputPort* source, const string& impl,TypeCode * type,bool init)
138 return new ProxyPort(source);
141 InputPort* RuntimeForEngineTest::adapt(InPropertyPort* source, const std::string& impl, TypeCode * type, bool init)
143 return adapt((InputPort *)source,impl,type,init);