-
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 typeso that generic wrappers can access the parent container'svalue_type
-
const graph<value_type> *rootis a pointer to the parent container. -
const end_node *locis 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.
const_iterator &operator++()
Increments the iterator to the next item.
const_iterator &operator--()
Decrements the iterator to the previous item.
const_iterator &operator+=(int n)
Increments the iterator by n.
const_iterator &operator-=(int n)
Decrements the iterator by n.
const_iterator operator+(int n)
Returns the iterator n elements ahead of this one.
const_iterator operator-(int n)
Returns the iterator n elements behind this one.
const_links next()
Return the proceeding nodes in the graph from this iterator.
const_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.
const_iterator &operator=(const iterator ©)
const_iterator &operator=(const const_iterator ©)set the root and loc of this iterator equal to that of another.