PSCF v1.2
|
Vertex iterator for graph associated with a polymer. More...
#include <VertexIterator.h>
Public Member Functions | |
VertexIterator (PolymerSpecies const &polymer) | |
Constructor. | |
~VertexIterator () | |
Destructor. | |
void | begin (int sourceId, int targetId) |
Initialize iterator. | |
VertexIterator & | operator++ () |
Increment operator - move to next vertex. | |
int | currentId () const |
Get index of the current vertex. | |
bool | isEnd () const |
Return true iff currentId == targetId. | |
bool | notEnd () const |
Return true iff currentId != targetId. | |
Vertex iterator for graph associated with a polymer.
Usage: Suppose that object p is an instance of a subclass of PolymerSpecies. The following snippet illustrates how to iterate from vertex iSource to vertex iTarget of the associated polymer:
Definition at line 37 of file VertexIterator.h.
Pscf::VertexIterator::VertexIterator | ( | PolymerSpecies const & | polymer | ) |
Constructor.
polymer | associated PolymerSpecies object |
Definition at line 17 of file VertexIterator.cpp.
Pscf::VertexIterator::~VertexIterator | ( | ) |
Destructor.
Definition at line 26 of file VertexIterator.cpp.
void Pscf::VertexIterator::begin | ( | int | sourceId, |
int | targetId ) |
Initialize iterator.
Definition at line 32 of file VertexIterator.cpp.
VertexIterator & Pscf::VertexIterator::operator++ | ( | ) |
Increment operator - move to next vertex.
Definition at line 41 of file VertexIterator.cpp.
References Pscf::PolymerSpecies::edge(), notEnd(), Pscf::PolymerSpecies::path(), UTIL_CHECK, and Pscf::Edge::vertexId().
int Pscf::VertexIterator::currentId | ( | ) | const |
Get index of the current vertex.
Definition at line 63 of file VertexIterator.cpp.
bool Pscf::VertexIterator::isEnd | ( | ) | const |
Return true iff currentId == targetId.
Definition at line 69 of file VertexIterator.cpp.
bool Pscf::VertexIterator::notEnd | ( | ) | const |
Return true iff currentId != targetId.
Definition at line 77 of file VertexIterator.cpp.
Referenced by operator++().