summaryrefslogtreecommitdiff
path: root/NT/src/rotor.h
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2014-01-20 01:59:04 +0000
committerTim Redfern <tim@eclectronics.org>2014-01-20 01:59:04 +0000
commit0dfbf40106d6a6c70d949e1f5bcfa1b33b20a68f (patch)
tree99a257b9e35d3eb76948f99a7cb51eed53514b01 /NT/src/rotor.h
parentbd5a1d60ab7e1a930835e239cc0ee7257e9e82ad (diff)
member access permissions
Diffstat (limited to 'NT/src/rotor.h')
-rw-r--r--NT/src/rotor.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/NT/src/rotor.h b/NT/src/rotor.h
index ef90eb6..040435b 100644
--- a/NT/src/rotor.h
+++ b/NT/src/rotor.h
@@ -70,6 +70,10 @@ namespace Rotor {
Frame_parameters nextframe() const{
return Frame_parameters(time+(1.0/framerate),framerate,duration,w,h);
}
+ double get_time() const{
+ return time;
+ }
+ private:
double time; //num/denom ?
double framerate;
double duration;
@@ -83,6 +87,12 @@ namespace Rotor {
virtual void init(Json::Value s)=0;
virtual bool connect(Node* target)=0;
virtual std::string get_type()=0;
+ bool is_connected(){
+ if (connection) return true;
+ return false;
+ }
+ std::string get_connection_id();
+ protected:
Node* connection;
bool connectable;
std::string name;
@@ -115,6 +125,7 @@ namespace Rotor {
}
return value;
}
+ protected:
T value;
};
class Variable_array: public Variable {
@@ -131,7 +142,7 @@ namespace Rotor {
name=s["name"].asString();
}
Json::Value to_json();
- std::string get_type(){ //need this to output node templates
+ std::string get_type(){
return TypeName<T>::Get();
}
bool connect(Node* target){
@@ -158,6 +169,8 @@ namespace Rotor {
}
return value;
}
+ const std::vector<Variable_type<T>>& get_values(){return values;};
+ protected:
std::vector<Variable_type<T>> values;
T value;
};
@@ -187,9 +200,12 @@ namespace Rotor {
}
return false;
}
+ std::string get_type(){return type;};
+ std::string& get_id(){return id;};
Json::Value to_json();
virtual Node* clone(Json::Value &_settings)=0;
- virtual std::string output_type()=0;
+ virtual std::string get_output_type()=0;
+ protected:
std::string type;
std::string id;
std::string type_id;
@@ -209,7 +225,7 @@ namespace Rotor {
}
if (settings["id"]!=nullptr) id=settings["id"].asString();
}
- std::string output_type(){return TypeName<NT>::Get();};
+ std::string get_output_type(){return TypeName<NT>::Get();};
template <class IT> Variable_type<IT>* create_inlet(std::string name){
vars[name]=new Variable_type<IT>(name,true);
return (dynamic_cast<Variable_type<IT>*>(vars[name]));