summaryrefslogtreecommitdiff
path: root/NT/src/rotor.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2014-01-06 17:39:21 +0000
committerTim Redfern <tim@eclectronics.org>2014-01-06 17:39:21 +0000
commita940710de90c5bc2b9a3e74f19d60c769ab76643 (patch)
treece3740f465effe29ef2ee15ef13901f019273cd8 /NT/src/rotor.cpp
parent815d1149f9fb6be2c1bc05fb04f574eb928e050e (diff)
thinking out multi inlets
Diffstat (limited to 'NT/src/rotor.cpp')
-rw-r--r--NT/src/rotor.cpp47
1 files changed, 2 insertions, 45 deletions
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 <class T>
- void Rotor::Variable_type<T>::init(std::string s){
- std::istringstream cur(s);
- cur >> value;
- }
-
- template <class T>
- bool Rotor::Variable_type<T>::connect(Node* target){
- if (connectable){
- if (dynamic_cast<Node_type<T>*>(target)){
- connection=target;
- return true;
- }
- }
- return false;
- }
- template <class T>
- const T& Rotor::Variable_type<T>::get(const Frame_parameters &frame){
- if (connection){
- return (dynamic_cast<Node_type<T>*>(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 <class NT>
- void Node_type<NT>::init(map<string,string> 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<string,string> settings={{"type","time"}};