1#ifndef CONFIGPARSER_HPP
2#define CONFIGPARSER_HPP
4#include "rclcpp/rclcpp.hpp"
6#include "yaml-cpp/yaml.h"
32 if (this->
type != NodeType::Map)
34 throw runtime_error(
"Not a map but a " + to_string(this->
type));
36 return this->
node[elementName];
40 if (this->
type != NodeType::Sequence)
42 throw runtime_error(
"Not a sequence but a " + to_string(this->
type));
46 template <
typename T>
inline T
getElement(
string elementName) {
return this->
node[elementName].as<T>(); }
47 template <
typename T>
inline bool getElement(T* res,
string elementName)
49 *res = this->
node[elementName].as<T>();
bool hasElement(string elementName)
ConfigElement operator[](int i)
bool getElement(T *res, string elementName)
T getElement(string elementName)
ConfigElement getElement(string elementName)
ConfigElement operator[](string elementName)
NodeType::value getType()
vector< ConfigElement > getElements()