-
Notifications
You must be signed in to change notification settings - Fork 0
graph const_iterator
struct const_iterator
Points to a node in a graph.
-
typedef value_type type
so that generic wrappers can access the parent container'svalue_type
-
const graph<value_type> *root
is a pointer to the parent container. -
const end_node *loc
is the node pointed to by this iterator.
const_iterator()
The default constructor. root
and loc
are both set to NULL
.
const_iterator(graph<value_type> *root, end_node *loc)
This sets root
and loc
directly. It's protected member that should only be used by the parent container.
const_iterator(const const_iterator ©)
A copy constructor that sets root
and loc
.
operator bool()
checks whether this iterator points to a valid node in the graph.
value_type &operator*()
returns this iterator's value.
value_type *operator->()
The dot operator for this iterator's value.
value_type *ptr()
returns a pointer to this iterator's value.
value_type &get()
returns this iterator's value.
int idx()
returns the current index
of this iterator.
iterator &operator++()
Increments the iterator to the next item.
iterator &operator--()
Decrements the iterator to the previous item.
iterator &operator+=(int n)
Increments the iterator by n
.
iterator &operator-=(int n)
Decrements the iterator by n
.
iterator operator+(int n)
Returns the iterator n
elements ahead of this one.
iterator operator-(int n)
Returns the iterator n
elements behind this one.
links &next()
Return the proceeding nodes in the graph from this iterator.
links &prev()
Return the preceding nodes in the graph from this iterator.
bool operator==(iterator i)
bool operator!=(iterator i)
bool operator<(iterator i)
bool operator>(iterator i)
bool operator<=(iterator i)
bool operator>=(iterator i)
bool operator==(const_iterator i)
bool operator!=(const_iterator i)
bool operator<(const_iterator i)
bool operator>(const_iterator i)
bool operator<=(const_iterator i)
bool operator>=(const_iterator i)
Comparison operations between iterators compares index
.
int operator-(iterator i)
int operator-(const_iterator i)
Returns the number of elements between i
and this iterator by subtracting indices.
iterator &operator=(const iterator ©)
set the root
and loc
of this iterator equal to that of another.