From a940710de90c5bc2b9a3e74f19d60c769ab76643 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 6 Jan 2014 17:39:21 +0000 Subject: thinking out multi inlets --- NT/src/rotor.cpp | 47 ++--------------------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) (limited to 'NT/src/rotor.cpp') diff --git a/NT/src/rotor.cpp b/NT/src/rotor.cpp index 597ded6..677fae0 100644 --- a/NT/src/rotor.cpp +++ b/NT/src/rotor.cpp @@ -5,53 +5,10 @@ #include "factory.h" using namespace std; - -namespace Rotor{ - template - void Rotor::Variable_type::init(std::string s){ - std::istringstream cur(s); - cur >> value; - } - - template - bool Rotor::Variable_type::connect(Node* target){ - if (connectable){ - if (dynamic_cast*>(target)){ - connection=target; - return true; - } - } - return false; - } - template - const T& Rotor::Variable_type::get(const Frame_parameters &frame){ - if (connection){ - return (dynamic_cast*>(connection))->get_output(frame); - } - return value; - } - bool Node::connect(string v,Node *t){ - auto var=vars.find(v); - if (var!=vars.end()){ - if ((*var).second->connect(t)){ - return true; - } - } - return false; - } - template - void Node_type::init(map settings){ - for (auto s:settings) { - if (vars.find(s.first)!=vars.end()){ - vars[s.first]->init(s.second); - //printf("set %s to %s\n",s.first.c_str(),s.second.c_str()); - } - }; - } -} - using namespace Rotor; +//factory generates linker errors if rotor.h implementation is seperated: why? + int main(){ Node_factory f; map settings={{"type","time"}}; -- cgit v1.2.3