SDSL 3.0.3
Succinct Data Structure Library
Loading...
Searching...
No Matches
sdsl::cst_bfs_iterator< Cst, Queue > Class Template Reference

A forward iterator for a breath first traversal of a tree. More...

#include <cst_iterators.hpp>

Public Types

using iterator_category = std::forward_iterator_tag
 
using value_type = typename Cst::node_type
 
using difference_type = std::ptrdiff_t
 
using pointer = value_type *
 
using reference = value_type &
 
typedef const value_type const_reference
 
typedef Cst::size_type size_type
 
typedef cst_bfs_iterator< Cst, Queue > iterator
 
typedef Queue queue_type
 

Public Member Functions

 cst_bfs_iterator (Cst const *cst, const value_type node, bool valid=true, bool end_it=false)
 Constructor.
 
size_type size () const
 Returns the current number of nodes in the queue.
 
const_reference operator* () const
 Method for dereferencing the iterator.
 
iteratoroperator++ ()
 Prefix increment of the iterator.
 
iterator operator++ (int)
 Postfix increment of the iterator.
 
bool operator== (iterator const &it) const
 Equality operator.
 
bool operator!= (iterator const &it) const
 Inequality operator.
 

Detailed Description

template<class Cst, class Queue = std::queue<typename Cst::node_type>>
class sdsl::cst_bfs_iterator< Cst, Queue >

A forward iterator for a breath first traversal of a tree.

Template Parameters
CstA class which fulfills the CST concept
QueueA queue for the traversal. Note that for large data, you should use an external implementation of a queue.

Definition at line 299 of file cst_iterators.hpp.

Member Typedef Documentation

◆ const_reference

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
typedef const value_type sdsl::cst_bfs_iterator< Cst, Queue >::const_reference

Definition at line 308 of file cst_iterators.hpp.

◆ difference_type

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
using sdsl::cst_bfs_iterator< Cst, Queue >::difference_type = std::ptrdiff_t

Definition at line 304 of file cst_iterators.hpp.

◆ iterator

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
typedef cst_bfs_iterator<Cst, Queue> sdsl::cst_bfs_iterator< Cst, Queue >::iterator

Definition at line 310 of file cst_iterators.hpp.

◆ iterator_category

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
using sdsl::cst_bfs_iterator< Cst, Queue >::iterator_category = std::forward_iterator_tag

Definition at line 302 of file cst_iterators.hpp.

◆ pointer

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
using sdsl::cst_bfs_iterator< Cst, Queue >::pointer = value_type *

Definition at line 305 of file cst_iterators.hpp.

◆ queue_type

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
typedef Queue sdsl::cst_bfs_iterator< Cst, Queue >::queue_type

Definition at line 311 of file cst_iterators.hpp.

◆ reference

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
using sdsl::cst_bfs_iterator< Cst, Queue >::reference = value_type &

Definition at line 306 of file cst_iterators.hpp.

◆ size_type

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
typedef Cst::size_type sdsl::cst_bfs_iterator< Cst, Queue >::size_type

Definition at line 309 of file cst_iterators.hpp.

◆ value_type

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
using sdsl::cst_bfs_iterator< Cst, Queue >::value_type = typename Cst::node_type

Definition at line 303 of file cst_iterators.hpp.

Constructor & Destructor Documentation

◆ cst_bfs_iterator()

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
sdsl::cst_bfs_iterator< Cst, Queue >::cst_bfs_iterator ( Cst const * cst,
const value_type node,
bool valid = true,
bool end_it = false )
inline

Constructor.

Parameters
cstPointer to the compressed suffix tree.
nodeRoot node of the traversal.
validState of the iterator.
endIf valid=true and end=true, we get the end() iterator otherwise `‘end’' has no effect.

Definition at line 326 of file cst_iterators.hpp.

Member Function Documentation

◆ operator!=()

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
bool sdsl::cst_bfs_iterator< Cst, Queue >::operator!= ( iterator const & it) const
inline

Inequality operator.

Definition at line 395 of file cst_iterators.hpp.

◆ operator*()

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
const_reference sdsl::cst_bfs_iterator< Cst, Queue >::operator* ( ) const
inline

Method for dereferencing the iterator.

Definition at line 343 of file cst_iterators.hpp.

◆ operator++() [1/2]

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
iterator & sdsl::cst_bfs_iterator< Cst, Queue >::operator++ ( )
inline

Prefix increment of the iterator.

Definition at line 349 of file cst_iterators.hpp.

◆ operator++() [2/2]

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
iterator sdsl::cst_bfs_iterator< Cst, Queue >::operator++ ( int )
inline

Postfix increment of the iterator.

Definition at line 370 of file cst_iterators.hpp.

◆ operator==()

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
bool sdsl::cst_bfs_iterator< Cst, Queue >::operator== ( iterator const & it) const
inline

Equality operator.

Definition at line 378 of file cst_iterators.hpp.

◆ size()

template<class Cst , class Queue = std::queue<typename Cst::node_type>>
size_type sdsl::cst_bfs_iterator< Cst, Queue >::size ( ) const
inline

Returns the current number of nodes in the queue.

Definition at line 337 of file cst_iterators.hpp.


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