NCBI C++ ToolKit
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
xml::node_set::iterator Class Reference

Search Toolkit Book for xml::node_set::iterator

The xml::node_set::iterator class is used to iterate over nodes in a node set. More...

#include <misc/xmlwrapp/node_set.hpp>

+ Collaboration diagram for xml::node_set::iterator:

Public Types

typedef node value_type
 
typedef std::ptrdiff_t difference_type
 
typedef value_typepointer
 
typedef value_typereference
 
typedef std::forward_iterator_tag iterator_category
 

Public Member Functions

 iterator ()
 Create a new uninitialised xml::node_set::iterator object. More...
 
 iterator (const iterator &other)
 Create a new xml::node_set::iterator object using another one as a template. More...
 
iteratoroperator= (const iterator &other)
 Create a copy of the xml::node_set::iterator object. More...
 
 ~iterator ()
 Destroy the object. More...
 
reference operator* () const
 Provide a reference to the node. More...
 
pointer operator-> () const
 Provide a pointer to the node. More...
 
iteratoroperator++ ()
 Prefix increment. More...
 
iterator operator++ (int)
 Postfix increment. More...
 
bool operator== (const iterator &other) const
 Compare two iterators. More...
 
bool operator!= (const iterator &other) const
 Compare two iterators. More...
 

Private Member Functions

 iterator (node_set *parent, int index)
 
void swap (iterator &other)
 

Private Attributes

node_setparent_
 
int current_index_
 

Friends

class node_set
 
class const_iterator
 

Detailed Description

The xml::node_set::iterator class is used to iterate over nodes in a node set.

The iterator is one directional.

Definition at line 119 of file node_set.hpp.

Member Typedef Documentation

◆ difference_type

Definition at line 123 of file node_set.hpp.

◆ iterator_category

typedef std::forward_iterator_tag xml::node_set::iterator::iterator_category

Definition at line 126 of file node_set.hpp.

◆ pointer

Definition at line 124 of file node_set.hpp.

◆ reference

Definition at line 125 of file node_set.hpp.

◆ value_type

Definition at line 122 of file node_set.hpp.

Constructor & Destructor Documentation

◆ iterator() [1/3]

xml::node_set::iterator::iterator ( void  )
inline

Create a new uninitialised xml::node_set::iterator object.

Definition at line 131 of file node_set.hpp.

◆ iterator() [2/3]

xml::node_set::iterator::iterator ( const iterator other)

Create a new xml::node_set::iterator object using another one as a template.

Definition at line 199 of file node_set.cpp.

References current_index_, and parent_.

◆ ~iterator()

xml::node_set::iterator::~iterator ( void  )
inline

Destroy the object.

Definition at line 150 of file node_set.hpp.

◆ iterator() [3/3]

xml::node_set::iterator::iterator ( node_set parent,
int  index 
)
inlineprivate

Definition at line 209 of file node_set.hpp.

Member Function Documentation

◆ operator!=()

bool xml::node_set::iterator::operator!= ( const iterator other) const
inline

Compare two iterators.

Parameters
otherAnother iterator
Returns
True if the iterators are not equal

Definition at line 204 of file node_set.hpp.

◆ operator*()

node_set::iterator::reference xml::node_set::iterator::operator* ( void  ) const

Provide a reference to the node.

Exceptions
throwsexception if the iterator is invalid

Definition at line 212 of file node_set.cpp.

References xml::kDerefError.

◆ operator++() [1/2]

node_set::iterator & xml::node_set::iterator::operator++ ( void  )

Prefix increment.

Exceptions
Throwsexception if the iterator is not initialised or out of range

Definition at line 226 of file node_set.cpp.

References xml::kAdvError.

◆ operator++() [2/2]

node_set::iterator xml::node_set::iterator::operator++ ( int  )

Postfix increment.

Exceptions
Throwsexception if the iterator is not initialised or out of range

Definition at line 235 of file node_set.cpp.

References tmp.

◆ operator->()

node_set::iterator::pointer xml::node_set::iterator::operator-> ( void  ) const

Provide a pointer to the node.

Exceptions
throwsexception if the iterator is invalid

Definition at line 219 of file node_set.cpp.

References xml::kRefError.

◆ operator=()

node_set::iterator & xml::node_set::iterator::operator= ( const iterator other)

Create a copy of the xml::node_set::iterator object.

Parameters
otherAnother xml::node_set::iterator object

Definition at line 205 of file node_set.cpp.

References swap(), and tmp.

◆ operator==()

bool xml::node_set::iterator::operator== ( const iterator other) const
inline

Compare two iterators.

Parameters
otherAnother iterator
Returns
True if the iterators are equal

Definition at line 192 of file node_set.hpp.

References current_index_, and parent_.

◆ swap()

void xml::node_set::iterator::swap ( iterator other)
private

Definition at line 242 of file node_set.cpp.

References current_index_, parent_, and swap().

Friends And Related Function Documentation

◆ const_iterator

friend class const_iterator
friend

Definition at line 218 of file node_set.hpp.

◆ node_set

friend class node_set
friend

Definition at line 217 of file node_set.hpp.

Member Data Documentation

◆ current_index_

int xml::node_set::iterator::current_index_
private

◆ parent_

node_set* xml::node_set::iterator::parent_
private

The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:40 2024 by modify_doxy.py rev. 669887