Parameters.cpp
Go to the documentation of this file.
00001 /*
00002  * Parameters.cpp
00003  *
00004  *  Created on: Oct 28, 2013
00005  *      Author: blackpc
00006  */
00007 
00008 #include <scriptable_monitor/Parameters.h>
00009 
00010 template<> int          Parameters::get<int>(uint32_t index) { return boost::lexical_cast<int>((*_parameters)[index]); }
00011 template<> double       Parameters::get<double>(uint32_t index) { return boost::lexical_cast<double>((*_parameters)[index]); }
00012 template<> bool         Parameters::get<bool>(uint32_t index) { return boost::lexical_cast<bool>((*_parameters)[index]); }
00013 template<> string       Parameters::get<string>(uint32_t index) { return (*_parameters)[index]; }
00014 template<> YamlPtr      Parameters::get<YamlPtr>(uint32_t index) {
00015          stringstream yaml_stream;
00016          yaml_stream << (*_parameters)[index];
00017          YAML::Parser parser(yaml_stream);
00018          YAML::Node document;
00019          parser.GetNextDocument(document);
00020          return YamlPtr(document.Clone());
00021 }
00022 
00023 template<> void         Parameters::set<YAML::Node&>(YAML::Node& value) {
00024         YAML::Emitter emitter;
00025         emitter << value;
00026         _parameters->push_back(emitter.c_str());
00027 }


scriptable_monitor
Author(s):
autogenerated on Wed Aug 26 2015 16:21:30