MultiNodeRapidXMLReader.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5*
6* ArmarX is free software; you can redistribute it and/or modify
7* it under the terms of the GNU General Public License version 2 as
8* published by the Free Software Foundation.
9*
10* ArmarX is distributed in the hope that it will be useful, but
11* WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17*
18* @package ArmarXCore::Core
19* @author Simon Ottenhaus( simon dot ottenhaus at kit dot edu)
20* @author Mirko Waechter( mirko dot waechter at kit dot edu)
21* @date 2017
22* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
23* GNU General Public License
24*/
25
26#pragma once
27
28#include <vector>
29
30#include "RapidXmlReader.h"
31
32namespace armarx
33{
34 using RapidXmlReaderNodeSeq = std::vector<RapidXmlReaderNode>;
35
37 {
38 public:
40
44
46 first_node(const char* name) const
47 {
48 for (const RapidXmlReaderNode& node : nodeSeq)
49 {
50 auto resultNode = node.first_node(name);
51 if (resultNode.is_valid())
52 {
53 return resultNode;
54 }
55 }
57 }
58
60 nodes(const char* name = nullptr) const
61 {
62 RapidXmlReaderNodeSeq resultSeq;
63 for (const RapidXmlReaderNode& node : nodeSeq)
64 {
65 node.nodes(name, resultSeq);
66 }
67 return resultSeq;
68 }
69
70 void
72 {
73 nodeSeq.emplace_back(node);
74 }
75
76 private:
78 };
79} // namespace armarx
MultiNodeRapidXMLReader(RapidXmlReaderNodeSeq nodes)
RapidXmlReaderNode first_node(const char *name) const
RapidXmlReaderNodeSeq nodes(const char *name=nullptr) const
void addNode(const RapidXmlReaderNode &node)
static RapidXmlReaderNode NullNode()
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::vector< RapidXmlReaderNode > RapidXmlReaderNodeSeq