11 #include <rapidxml.hpp>
18 template <
typename Ch>
22 using TListNodes = std::vector<const rapidxml::xml_node<Ch>*>;
33 for (
const auto& node : nodes_)
35 ret = node->first_node(name);
36 if (ret !=
nullptr)
return ret;
41 TListNodes& getListOfNodes() {
return nodes_; }
42 const TListNodes& getListOfNodes()
const {
return nodes_; }
48 template <
typename Ch_>
54 if (!current)
throw std::runtime_error(
"++ called on end() iterator!?");
55 current = current->next_sibling();
56 JointXMLnode<Ch>::TListNodes& lst = parent.getListOfNodes();
57 while (!current && lst_idx < lst.size())
60 if (lst_idx < lst.size())
61 current = lst[lst_idx]->first_node();
70 if (!current)
throw std::runtime_error(
"-> called on end() iterator!?");
76 if (!current)
throw std::runtime_error(
"* called on end() iterator!?");
80 bool operator==(
const iterator& it)
const
82 return (this->current == it.current) && (this->lst_idx == it.lst_idx) &&
83 (&this->parent == &it.parent);
85 bool operator!=(
const iterator& it)
const {
return !(*
this == it); }
91 JointXMLnode<Ch>::TListNodes& lst = parent.getListOfNodes();
92 while (!current && lst_idx < lst.size())
94 current = lst[lst_idx]->first_node();
95 if (!current) lst_idx++;
108 iterator end() {
return iterator(*
this, nodes_.size()); }
Definition: JointXMLnode.h:46
Definition: JointXMLnode.h:20
Definition: basic_types.h:28