RobotsIO
Loading...
Searching...
No Matches
ParametersYarpPort.h
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#ifndef ROBOTSIO_PARAMETERSYARPPORT_H
9#define ROBOTSIO_PARAMETERSYARPPORT_H
10
11#include <RobotsIO/Utils/ParametersFiller.h>
12#include <RobotsIO/Utils/YarpBufferedPort.hpp>
13
14#include <yarp/os/Bottle.h>
15
16#include <string>
17
18namespace RobotsIO {
19 namespace Utils {
20 class ParametersYarpPort;
21 }
22}
23
24
27{
28public:
29 ParametersYarpPort(const std::string& port_name);
30
31 virtual ~ParametersYarpPort();
32
33 bool receive_parameters();
34
35 const std::pair<bool, std::string> fill_string(const std::string& key) const override;
36
37 const std::pair<bool, std::size_t> fill_size_t(const std::string& key) const override;
38
39 const std::pair<bool, int> fill_int(const std::string& key) const override;
40
41 const std::pair<bool, double> fill_double(const std::string& key) const override;
42
43 const std::pair<bool, bool> fill_bool(const std::string& key) const override;
44
45private:
46 yarp::os::Bottle last_parameters_;
47
48 bool data_available_ = false;
49};
50
51#endif /* ROBOTSIO_YARPBOTTLE2PARAMETERS_H */