1 #include "RuntimeForEngineTest.hxx"
5 using namespace YACS::ENGINE;
8 TestElemNode::TestElemNode(const TestElemNode& other, ComposedNode *father):ElementaryNode(other,father)
12 Node *TestElemNode::simpleClone(ComposedNode *father, bool editionOnly) const
14 return new TestElemNode(*this,father);
17 TestElemInputPort::TestElemInputPort(const std::string& name, Node *node, TypeCode* type):InputPort(name,node,type),DataPort(name,node,type),Port(node)
21 TestElemInputPort::TestElemInputPort(const TestElemInputPort& other, Node *newHelder):InputPort(other,newHelder),DataPort(other,newHelder),Port(other,newHelder)
25 void TestElemInputPort::put(const void *data) throw(ConversionException)
27 cerr << _name << endl;
29 msg << "Not implemented (" << __FILE__ << ":" << __LINE__ << ")";
30 throw Exception(msg.str());
33 InputPort *TestElemInputPort::clone(Node *newHelder) const
35 return new TestElemInputPort(*this,newHelder);
38 void *TestElemInputPort::get() const throw(Exception)
41 msg << "Not implemented (" << __FILE__ << ":" << __LINE__ << ")";
42 throw Exception(msg.str());
45 void TestElemInputPort::exRestoreInit()
55 void TestElemInputPort::exSaveInit()
58 _initValue->decrRef();
60 _initValue->incrRef();
63 TestElemOutputPort::TestElemOutputPort(const std::string& name, Node *node, TypeCode* type):OutputPort(name,node,type),DataPort(name,node,type),Port(node)
67 TestElemOutputPort::TestElemOutputPort(const TestElemOutputPort& other, Node *newHelder):OutputPort(other,newHelder),DataPort(other,newHelder),Port(other,newHelder)
71 OutputPort *TestElemOutputPort::clone(Node *newHelder) const
73 return new TestElemOutputPort(*this,newHelder);
76 void TestElemOutputPort::put(const void *data) throw(ConversionException)
78 cerr << _name << endl;
80 msg << "Not implemented (" << __FILE__ << ":" << __LINE__ << ")";
81 throw Exception(msg.str());
84 void RuntimeForEngineTest::setRuntime()
86 if (! Runtime::_singleton)
87 Runtime::_singleton = new RuntimeForEngineTest;
90 ElementaryNode* RuntimeForEngineTest::createNode(const string& implementation, const string& name) throw(Exception)
92 return new TestElemNode(name);
95 InputPort* RuntimeForEngineTest::createInputPort(const string& name, const string& impl, Node * node, TypeCode * type)
97 return new TestElemInputPort(name, node, type);
100 OutputPort* RuntimeForEngineTest::createOutputPort(const string& name, const string& impl, Node * node, TypeCode * type)
102 return new TestElemOutputPort(name, node, type);
105 InputPort* RuntimeForEngineTest::adapt(InputPort* source, const string& impl,TypeCode * type) throw (ConversionException)
107 return new ProxyPort(source);