![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Iterator for conveniently stepping through Nodes and Attributes. More...
#include <ticpp.h>
Public Member Functions | |
| T * | begin (const Node *parent) const |
| For for loop comparisons. | |
| T * | end () const |
| For for loop comparisons. | |
| Iterator (const std::string &value="") | |
| Constructor. | |
| Iterator (T *node, const std::string &value="") | |
| Constructor. | |
| Iterator (const Iterator &it) | |
| Constructor. | |
| T * | Get () const |
| Gets internal pointer. | |
| Iterator & | operator= (const Iterator &it) |
| Sets internal pointer. | |
| Iterator & | operator= (T *p) |
| Sets internal pointer. | |
| Iterator & | operator++ () |
| Sets internal pointer to the Next Sibling, or Iterator::END, if there are no more siblings. | |
| Iterator | operator++ (int) |
| Sets internal pointer to the Next Sibling, or Iterator::END, if there are no more siblings. | |
| Iterator & | operator-- () |
| Sets internal pointer to the Previous Sibling, or Iterator::END, if there are no prior siblings. | |
| Iterator | operator-- (int) |
| Sets internal pointer to the Previous Sibling, or Iterator::END, if there are no prior siblings. | |
| bool | operator!= (const T *p) const |
| Compares internal pointer. | |
| bool | operator!= (const Iterator &it) const |
| Compares internal pointer. | |
| bool | operator== (T *p) const |
| Compares internal pointer*. | |
| bool | operator== (const Iterator &it) const |
| Compares internal pointer. | |
| T * | operator-> () const |
| So Iterator behaves like a STL iterator. | |
| T & | operator* () const |
| So Iterator behaves like a STL iterator. | |
Private Attributes | |
| T * | m_p |
| Internal Pointer. | |
| std::string | m_value |
| Value for NextSibling calls. | |
Iterator for conveniently stepping through Nodes and Attributes.
TinyXML++ introduces iterators:
Iterators have the added advantage of filtering by type:
Finally, Iterators also work with Attributes
|
inline |
Constructor.
| value | If not empty, this iterator will only visit nodes with matching value. // Only iterates through Element nodes with value "ElementValue"
ticpp::Iterator< ticpp::Element > child( "ElementValue" );
for ( child = child.begin( parent ); child != child.end(); child++ )
|
Definition at line 1152 of file ticpp.h.
Referenced by Iterator(), operator!=(), operator++(), operator++(), operator--(), operator--(), operator=(), operator=(), and operator==().
|
inline |
|
inline |
|
inline |
For for loop comparisons.
| parent | The parent of the nodes to iterate. |
Definition at line 1127 of file ticpp.h.
References ticpp::Node::IterateFirst(), and m_value.
|
inline |
|
inline |
|
inline |
Compares internal pointer.
Definition at line 1233 of file ticpp.h.
References Iterator(), m_p, and operator!=().
Referenced by operator!=().
|
inline |
|
inline |
|
inline |
|
inline |
Sets internal pointer to the Next Sibling, or Iterator::END, if there are no more siblings.
Definition at line 1196 of file ticpp.h.
References Iterator().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Compares internal pointer.
Definition at line 1249 of file ticpp.h.
References Iterator(), m_p, and operator==().
Referenced by operator==().
|
inline |
|
private |
Internal Pointer.
Definition at line 1114 of file ticpp.h.
Referenced by Iterator(), Iterator(), Iterator(), Get(), operator!=(), operator!=(), operator*(), operator++(), operator--(), operator->(), operator=(), operator=(), operator==(), and operator==().
|
private |
Value for NextSibling calls.
Definition at line 1115 of file ticpp.h.
Referenced by Iterator(), Iterator(), Iterator(), begin(), operator++(), operator--(), and operator=().