h5cpp  0.5.2
A modern C++ wrapper for the HDF5 C library
hdf5::node::RecursiveNodeIterator Class Reference

recursive node iterator More...

#include <recursive_node_iterator.hpp>

Public Types

using value_type = Node
 
using pointer = value_type *
 
using reference = value_type &
 
using difference_type = ssize_t
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

 RecursiveNodeIterator ()=delete
 default constructor More...
 
Node operator* () const
 return current Node instance More...
 
Nodeoperator-> ()
 return address of the actual Node instance More...
 
RecursiveNodeIteratoroperator++ ()
 advance to next element More...
 
RecursiveNodeIterator operator++ (int)
 advance to next element More...
 
bool operator== (const RecursiveNodeIterator &rhs) const
 
bool operator!= (const RecursiveNodeIterator &rhs) const
 

Static Public Member Functions

static RecursiveNodeIterator begin (const Group &current_group)
 create iterator to the first element More...
 
static RecursiveNodeIterator end (const Group &current_group)
 create iterator to the last+1 element More...
 

Detailed Description

Iterator which recursively iterates over all subelements of a particular group. All relevant constructors are private. To construct an instance of this iterator use the two static factory functions begin() and end().

Group top = ...;
while(iter != end)
{
//do something here
++iter;
}
// or with STL
std::for_each(RecursiveNodeIterator::begin(top),
[](const Node &node) { ...do something ... ; });
static RecursiveNodeIterator end(const Group &current_group)
create iterator to the last+1 element
static RecursiveNodeIterator begin(const Group &current_group)
create iterator to the first element

Unlike NodeIterator, RecursiveNodeIterator is a simple forward iterator.

Member Typedef Documentation

◆ difference_type

◆ iterator_category

using hdf5::node::RecursiveNodeIterator::iterator_category = std::forward_iterator_tag

◆ pointer

◆ reference

◆ value_type

Constructor & Destructor Documentation

◆ RecursiveNodeIterator()

hdf5::node::RecursiveNodeIterator::RecursiveNodeIterator ( )
delete

There is no default constructors -> would not make too much sense.

Member Function Documentation

◆ begin()

static RecursiveNodeIterator hdf5::node::RecursiveNodeIterator::begin ( const Group current_group)
static

Static factory function returning an instance of RecursiveForwardIterator on the first element of the top group.

Parameters
current_groupthe top level group where to start with recursive iteration
Returns
instance of RecursiveNodeIterator

◆ end()

static RecursiveNodeIterator hdf5::node::RecursiveNodeIterator::end ( const Group current_group)
static

Static factory function returning an instance of RecursiveForwardIterator on the last+1 element of top group.

Parameters
current_groupthe top level group at which to start the recursive iteration.
Returns
instance of RecursiveNodeIterator

◆ operator!=()

bool hdf5::node::RecursiveNodeIterator::operator!= ( const RecursiveNodeIterator rhs) const

◆ operator*()

Node hdf5::node::RecursiveNodeIterator::operator* ( ) const

Returns an instance of the actual node the iterator refers to.

Returns
instance of node::Node

◆ operator++() [1/2]

RecursiveNodeIterator& hdf5::node::RecursiveNodeIterator::operator++ ( )

Advances to the next element in line.

while(...)
{
++iter;
}
RecursiveNodeIterator()=delete
default constructor
Returns
reference to the udpated iterator

◆ operator++() [2/2]

RecursiveNodeIterator hdf5::node::RecursiveNodeIterator::operator++ ( int  )

Advances to the next element in line but returns an iterator to the previous element.

while(...)
{
Node n = *iter++; //give me the actual node and advance
std::cout<<n.link().path()<<std::endl;
}
Returns
instance of RecursiveNodeIterator

◆ operator->()

Node* hdf5::node::RecursiveNodeIterator::operator-> ( )

Returns the adress of the actual node in memory.

Returns
adress of current Node

◆ operator==()

bool hdf5::node::RecursiveNodeIterator::operator== ( const RecursiveNodeIterator rhs) const

The documentation for this class was generated from the following file: