Chaste Release::3.1
|
#include <AbstractMeshReader.hpp>
Public Member Functions | |
ElementIterator () | |
ElementIterator (unsigned index, AbstractMeshReader *pReader) | |
ElementIterator (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 ElementIterator &rOther) const |
const ElementData & | dereference () const |
Private Attributes | |
unsigned | mIndex |
const std::set< unsigned > * | mpIndices |
std::set< unsigned > ::const_iterator | mIndicesIterator |
AbstractMeshReader * | mpReader |
ElementData | mLastDataRead |
Friends | |
class | boost::iterator_core_access |
An iterator class for element data.
Definition at line 199 of file AbstractMeshReader.hpp.
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::ElementIterator | ( | ) | [inline] |
Default constructor for an iterator that doesn't point to anything.
Definition at line 206 of file AbstractMeshReader.hpp.
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::ElementIterator | ( | unsigned | index, |
AbstractMeshReader * | pReader | ||
) | [inline, explicit] |
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.
index | the index of the item to point at |
pReader | the mesh reader to iterate over |
Definition at line 223 of file AbstractMeshReader.hpp.
References AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::CacheData(), and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mIndex.
AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::ElementIterator | ( | const std::set< unsigned > & | rIndices, |
AbstractMeshReader * | pReader | ||
) |
Constructor for iterating over a subset of the items in the mesh.
rIndices | a set of item indices over which to iterate |
pReader | the mesh reader to iterate over |
Definition at line 175 of file AbstractMeshReader.cpp.
References AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::CacheData(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mIndex, AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mIndicesIterator, AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mpIndices, and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mpReader.
void AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::CacheData | ( | unsigned | index, |
bool | firstRead = false |
||
) | [private] |
Read the pointed-at item data (if we're pointing at anything) and cache it within the iterator, for use in dereference.
index | the item to read |
firstRead | Set to true in the constructor. This ensures that the line 0 is always read |
Definition at line 220 of file AbstractMeshReader.cpp.
References AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements().
Referenced by AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::ElementIterator().
const ElementData& AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::dereference | ( | ) | const [inline, private] |
Dereference this iterator to get the data for the item pointed at.
Note that the returned reference is only valid for as long as this iterator is pointing at the item.
Definition at line 282 of file AbstractMeshReader.hpp.
References AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mLastDataRead, and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mpReader.
bool AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::equal | ( | const ElementIterator & | rOther | ) | const [inline, private] |
Test whether two iterators point at the same item.
rOther | the other iterator |
Definition at line 271 of file AbstractMeshReader.hpp.
References AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mIndex.
unsigned AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::GetIndex | ( | ) | const [inline] |
Get the index of the item pointed at.
Definition at line 245 of file AbstractMeshReader.hpp.
References AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mIndex.
void AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::increment | ( | ) | [private] |
Increment the iterator to point at the next item in the file.
Definition at line 193 of file AbstractMeshReader.cpp.
unsigned AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mIndex [private] |
The index of the item pointed at.
Definition at line 291 of file AbstractMeshReader.hpp.
Referenced by AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::ElementIterator(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::equal(), and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::GetIndex().
std::set<unsigned>::const_iterator AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mIndicesIterator [private] |
Iterator over the indices in that subset.
Definition at line 297 of file AbstractMeshReader.hpp.
Referenced by AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::ElementIterator().
ElementData AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mLastDataRead [private] |
Data for the last item read.
Definition at line 303 of file AbstractMeshReader.hpp.
Referenced by AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::dereference().
const std::set<unsigned>* AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mpIndices [private] |
The set which we're iterating over, if we are iterating over a subset of the items.
Definition at line 294 of file AbstractMeshReader.hpp.
Referenced by AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::ElementIterator().
AbstractMeshReader* AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::mpReader [private] |
The mesh reader we're iterating over.
Definition at line 300 of file AbstractMeshReader.hpp.
Referenced by AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::dereference(), and AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::ElementIterator::ElementIterator().