RobotsIO
Loading...
Searching...
No Matches
ParametersExtractor.cpp
1/*
2 * Copyright (C) 2019 Istituto Italiano di Tecnologia (IIT)
3 *
4 * This software may be modified and distributed under the terms of the
5 * BSD 3-Clause license. See the accompanying LICENSE file for details.
6 */
7
8#include <RobotsIO/Utils/ParametersExtractor.h>
9#include <RobotsIO/Utils/Parameters.h>
10
11using namespace RobotsIO::Utils;
12
13
14ParametersExtractor::ParametersExtractor(const RobotsIO::Utils::Parameters& parameters) :
15 parameters_(parameters)
16{ }
17
18
19void ParametersExtractor::extract_fields()
20{
21 for (const auto& key : parameters_.keys())
22 {
23 parameters_.extract_field(key, *this);
24 }
25}
26
27
28void ParametersExtractor::extract_field(const std::string& key)
29{
30 parameters_.extract_field(key, *this);
31}
virtual std::vector< std::string > keys() const =0
virtual void extract_field(const std::string &key, RobotsIO::Utils::ParametersExtractor &extractor) const =0