service.cpp
Go to the documentation of this file.
1 /*
2  * (C) 2014, Intermodalics BVBA
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * 3. Neither the name of the copyright holder nor the names of its contributors
13  * may be used to endorse or promote products derived from this software
14  * without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
19  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
20  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
31 #include <rtt_dynamic_reconfigure_tests/TestConfig.h>
32 
33 using namespace rtt_dynamic_reconfigure_tests;
34 
35 namespace rtt_dynamic_reconfigure {
36 
37 template <>
38 struct Updater<TestConfig> {
39  static bool propertiesFromConfig(TestConfig &config, uint32_t level, RTT::PropertyBag &bag) {
40  setProperty<int>("int_param", bag, config.int_param);
41  setProperty<double>("double_param", bag, config.double_param);
42  setProperty<std::string>("str_param", bag, config.str_param);
43  setProperty<bool>("bool_param", bag, config.bool_param);
44  setProperty<double>("non_existent", bag, config.non_existent);
45  return true;
46  }
47  static bool configFromProperties(TestConfig &config, const RTT::PropertyBag &bag) {
48  getProperty<int>("int_param", bag, config.int_param);
49  getProperty<double>("double_param", bag, config.double_param);
50  getProperty<std::string>("str_param", bag, config.str_param);
51  getProperty<bool>("bool_param", bag, config.bool_param);
52  getProperty<double>("non_existent", bag, config.non_existent);
53  return true;
54  }
55 };
56 
57 } // namespace rtt_dynamic_reconfigure
58 
59 RTT_DYNAMIC_RECONFIGURE_SERVICE_PLUGIN(TestConfig, "test_reconfigure")
static bool propertiesFromConfig(TestConfig &config, uint32_t level, RTT::PropertyBag &bag)
Definition: service.cpp:39
#define RTT_DYNAMIC_RECONFIGURE_SERVICE_PLUGIN(CONFIG, NAME)
static bool configFromProperties(TestConfig &config, const RTT::PropertyBag &bag)
Definition: service.cpp:47


rtt_dynamic_reconfigure_tests
Author(s): Johannes Meyer
autogenerated on Mon May 10 2021 02:45:24