summaryrefslogtreecommitdiff
path: root/NT/src/factory.h
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2014-01-19 19:54:38 +0000
committerTim Redfern <tim@eclectronics.org>2014-01-19 19:54:38 +0000
commitce528aa299501ecab63018f91b937766ffbc95be (patch)
tree34972d49d69c5cf926a3974a020e945ff4576a8c /NT/src/factory.h
parent1e01ca3e89beca6870a3112c4513df66dd07dbb1 (diff)
variables writing json
Diffstat (limited to 'NT/src/factory.h')
-rw-r--r--NT/src/factory.h19
1 files changed, 3 insertions, 16 deletions
diff --git a/NT/src/factory.h b/NT/src/factory.h
index b576c49..0482ebe 100644
--- a/NT/src/factory.h
+++ b/NT/src/factory.h
@@ -20,28 +20,15 @@ namespace Rotor {
if (category_map.find(category)==category_map.end()) category_map[category]=vector<Node*>();
category_map[category].push_back(proto);
};
- Node *create(std::map<std::string,std::string> &settings){
- if (settings.find("type")!=settings.end()) {
- if (type_map.find(settings["type"])!=type_map.end()) {
- return type_map[settings["type"]]->clone(settings);
- }
- }
- return NULL;
- };
Node *create(Json::Value &settings){
if (type_map.find(settings["type"].asString())!=type_map.end()) {
return type_map[settings["type"].asString()]->clone(settings);
}
return NULL;
};
-
- bool list_node(const std::string &t,xmlIO XML);
- bool list_node(const std::string &t,Json::Value &JSON);
- void list_node(Rotor::Node* type,xmlIO XML,int i=0);
- void list_nodes(xmlIO XML);
- void list_nodes(Json::Value &JSON);
- void list_categories(xmlIO XML);
- void list_categories(Json::Value &JSON);
+ bool list_node(const std::string &t,Json::Value &json);
+ void list_nodes(Json::Value &json);
+ void list_categories(Json::Value &json);
private:
std::map<std::string,Node*> type_map;
std::map<std::string,std::vector<Rotor::Node*> > category_map;