Skip to content
Snippets Groups Projects
Commit cfeb1556 authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

PreTag commit. Cherry picked "Fixed missing sensor name from callbacks in YAML" from demo branch.

parent 8a38e611
No related branches found
No related tags found
No related merge requests found
Pipeline #3453 passed
......@@ -64,7 +64,7 @@ class parserYAML {
string _file;
bool _relative_path;
string _path_root;
vector<array<string, 2>> _callbacks;
vector<array<string, 3>> _callbacks;
public:
parserYAML(){
_params = map<string, string>();
......@@ -75,7 +75,7 @@ public:
_files = vector<string>();
_path_root = "";
_relative_path = false;
_callbacks = vector<array<string, 2>>();
_callbacks = vector<array<string, 3>>();
}
parserYAML(string file){
_params = map<string, string>();
......@@ -86,7 +86,7 @@ public:
_file = file;
_path_root = "";
_relative_path = false;
_callbacks = vector<array<string, 2>>();
_callbacks = vector<array<string, 3>>();
}
parserYAML(string file, string path_root){
_params = map<string, string>();
......@@ -97,7 +97,7 @@ public:
_file = file;
_path_root = path_root;
_relative_path = true;
_callbacks = vector<array<string, 2>>();
_callbacks = vector<array<string, 3>>();
}
~parserYAML(){
//
......@@ -112,7 +112,7 @@ public:
vector<array<string, 2>> sensorsSerialization();
vector<array<string, 3>> processorsSerialization();
vector<string> getFiles();
vector<array<string, 2>> getCallbacks();
vector<array<string, 3>> getCallbacks();
map<string,string> getParams();
void parse();
map<string, string> fetchAsMap(YAML::Node);
......@@ -239,7 +239,7 @@ void parserYAML::parseFirstLevel(string file){
_paramsProc.push_back(pProc);
}
for(const auto& kv : n_config["callbacks"]){
_callbacks.push_back({{kv[0].as<std::string>(), kv[1].as<std::string>()}});
_callbacks.push_back({{kv[0].as<std::string>(), kv[1].as<std::string>(), kv[2].as<std::string>()}});
}
YAML::Node n_files = n["files"];
assert(n_files.Type() == YAML::NodeType::Sequence && "trying to parse files node but found a non-Sequence node");
......@@ -262,7 +262,7 @@ vector<array<string, 3>> parserYAML::processorsSerialization(){
vector<string> parserYAML::getFiles(){
return this->_files;
}
vector<array<string, 2>> parserYAML::getCallbacks(){
vector<array<string, 3>> parserYAML::getCallbacks(){
return this->_callbacks;
}
map<string,string> parserYAML::getParams(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment