Ariles
Loading...
Searching...
No Matches
common.h
Go to the documentation of this file.
1/**
2 @file
3 @author Alexander Sherikov
4
5 @copyright 2018-2020 Alexander Sherikov, Licensed under the Apache License, Version 2.0.
6 (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
7
8 @brief
9*/
10
11#pragma once
12
13
15
16
17// http://docs.ros.org/api/xmlrpcpp/html/classXmlRpc_1_1XmlRpcValue.html
18#include <XmlRpcValue.h>
19
20
21namespace ariles2
22{
23 namespace ns_rosparam
24 {
26
27
29 {
30 public:
31 std::string root_name_;
32 XmlRpc::XmlRpcValue root_value_;
33
34 ::ros::NodeHandle nh_;
35
36
37 public:
38 /**
39 * @brief Get current node
40 *
41 * @return pointer to the current node
42 */
43 XmlRpc::XmlRpcValue &getRawNode(const std::size_t depth)
44 {
45 if (node_stack_[depth].isArray())
46 {
47 return (getRawNode(depth - 1)[node_stack_[depth].index_]);
48 }
49 return (*node_stack_[depth].node_);
50 }
51
52
53 XmlRpc::XmlRpcValue &getRawNode()
54 {
55 return (getRawNode(node_stack_.size() - 1));
56 }
57 };
58 } // namespace ns_rosparam
59} // namespace ariles2
XmlRpc::XmlRpcValue & getRawNode(const std::size_t depth)
Get current node.
Definition common.h:43
::ros::NodeHandle nh_
Definition common.h:34
XmlRpc::XmlRpcValue root_value_
Definition common.h:32
XmlRpc::XmlRpcValue & getRawNode()
Definition common.h:53
#define ARILES2_LOCAL
Definition visibility.h:47