AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator Class Reference

#include <AbstractMeshReader.hpp>

Inherits boost::iterator_facade< NodeIterator, const std::vector< double >, boost::single_pass_traversal_tag >.

Collaboration diagram for AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NodeIterator ()
 NodeIterator (unsigned index, AbstractMeshReader *pReader)
 NodeIterator (const std::set< unsigned > &rIndices, AbstractMeshReader *pReader)
unsigned GetIndex () const

Private Member Functions

void CacheData (unsigned index, bool firstRead=false)
void increment ()
bool equal (const NodeIterator &rOther) const
const std::vector< double > & dereference () const

Private Attributes

unsigned mIndex
const std::set< unsigned > * mpIndices
std::set< unsigned >
::const_iterator 
mIndicesIterator
AbstractMeshReadermpReader
std::vector< doublemLastDataRead

Friends

class boost::iterator_core_access

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator

An iterator class for node data.

Todo:
#1930. We could roll most iterator functionality into a base class here

Definition at line 369 of file AbstractMeshReader.hpp.


Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::NodeIterator (  )  [inline]

Default constructor for an iterator that doesn't point to anything.

Definition at line 376 of file AbstractMeshReader.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::NodeIterator ( unsigned  index,
AbstractMeshReader pReader 
) [inline]

Constructor for pointing to a specific item.

Note that, in the case of an ASCII mesh file, this will actually start wherever the file pointer currently is. The user is responsible for resetting the reader prior to creating an iterator.

Parameters:
index the index of the item to point at
pReader the mesh reader to iterate over

Definition at line 393 of file AbstractMeshReader.hpp.

References AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::CacheData(), and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::mIndex.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::NodeIterator ( const std::set< unsigned > &  rIndices,
AbstractMeshReader pReader 
) [inline]

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::CacheData ( unsigned  index,
bool  firstRead = false 
) [inline, private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
const std::vector<double>& AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::dereference (  )  const [inline, private]

Dereference this iterator to get the data for the item pointed at.

Returns:
reference Note that the returned reference is only valid for as long as this iterator is pointing at the item.

Definition at line 451 of file AbstractMeshReader.hpp.

References AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::mLastDataRead, and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::mpReader.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::equal ( const NodeIterator rOther  )  const [inline, private]
Returns:
true if two iterators point at the same item.
Parameters:
rOther the other iterator

Definition at line 440 of file AbstractMeshReader.hpp.

References AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::mIndex.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::GetIndex (  )  const [inline]
Returns:
the index of the item pointed at.

Definition at line 414 of file AbstractMeshReader.hpp.

References AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::mIndex.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::increment (  )  [inline, private]

Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::mIndex [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::set<unsigned>::const_iterator AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::mIndicesIterator [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<double> AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::mLastDataRead [private]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
const std::set<unsigned>* AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::mpIndices [private]

The set which we're iterating over, if we are iterating over a subset of the items.

Definition at line 463 of file AbstractMeshReader.hpp.

Referenced by AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::increment(), and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::NodeIterator().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
AbstractMeshReader* AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::NodeIterator::mpReader [private]

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

Generated by  doxygen 1.6.2