Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TSTTIterator Class Reference

Wrapper around single-entity TSTT interator. More...

Inheritance diagram for TSTTIterator:
Collaboration diagram for TSTTIterator:

Public Member Functions

 TSTTIterator (TSTTM::Entity &mesh, void *meshset, TSTTM::EntityType type, TSTTM::EntityTopology topo, MsqError &err)
 
virtual void restart ()
 reset iterator More...
 
virtual Mesh::EntityHandle operator* () const
 get current entity handle More...
 
virtual bool is_at_end () const
 check if any remaining entity handles More...
 
virtual void operator++ ()
 step More...
 
virtual ~TSTTIterator ()
 
- Public Member Functions inherited from EntityIterator
virtual ~EntityIterator ()
 

Private Member Functions

void get_next_entity ()
 Advance the iterator to the next entity. More...
 

Private Attributes

TSTTM::Entity tsttMesh
 TSTT mesh interface. More...
 
void * tsttIter
 TSTT iterator handle. More...
 
bool notAtEnd
 Flag to mark if end of iterator had been reached. More...
 
void * entityHandle
 Current TSTT entity handle. More...
 

Detailed Description

Wrapper around single-entity TSTT interator.

Definition at line 75 of file MeshTSTT.cpp.

Constructor & Destructor Documentation

TSTTIterator ( TSTTM::Entity &  mesh,
void *  meshset,
TSTTM::EntityType  type,
TSTTM::EntityTopology  topo,
MsqError err 
)
Parameters
meshThe TSTT mesh interface instance
meshsetThe meshset to iterate over
typeTSTT type in meshset to iterate over
topoTSTT topology in meshset to iterate over

Definition at line 117 of file MeshTSTT.cpp.

References TSTTIterator::get_next_entity(), MsqError::INTERNAL_ERROR, MSQ_SETERR, Mesquite::process_tstt_error(), TSTTIterator::tsttIter, and TSTTIterator::tsttMesh.

120  : tsttMesh(mesh), tsttIter(0), notAtEnd(true), entityHandle(0)
121 {
122  try {
123  tsttMesh.initEntIter( meshset, type, topo, tsttIter );
124  get_next_entity();
125  }
126  catch (TSTTB::Error& tstt_err) {
128  }
129 }
TSTTM::Entity tsttMesh
TSTT mesh interface.
Definition: MeshTSTT.cpp:78
void * tsttIter
TSTT iterator handle.
Definition: MeshTSTT.cpp:79
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
bool notAtEnd
Flag to mark if end of iterator had been reached.
Definition: MeshTSTT.cpp:80
void * entityHandle
Current TSTT entity handle.
Definition: MeshTSTT.cpp:81
void get_next_entity()
Advance the iterator to the next entity.
Definition: MeshTSTT.cpp:87
static msq_std::string process_tstt_error(TSTTB::Error &tstt_err)

Here is the call graph for this function:

~TSTTIterator ( )
virtual

Definition at line 131 of file MeshTSTT.cpp.

References TSTTIterator::tsttIter, and TSTTIterator::tsttMesh.

132 {
133  if (tsttIter)
134  tsttMesh.endEntIter( tsttIter );
135 }
TSTTM::Entity tsttMesh
TSTT mesh interface.
Definition: MeshTSTT.cpp:78
void * tsttIter
TSTT iterator handle.
Definition: MeshTSTT.cpp:79

Member Function Documentation

void get_next_entity ( )
inlineprivate

Advance the iterator to the next entity.

Updates entityHandle and notAtEnd

Definition at line 87 of file MeshTSTT.cpp.

References TSTTIterator::entityHandle, TSTTIterator::notAtEnd, TSTTIterator::tsttIter, and TSTTIterator::tsttMesh.

Referenced by TSTTIterator::operator++(), TSTTIterator::restart(), and TSTTIterator::TSTTIterator().

88  { notAtEnd = tsttMesh.getNextEntIter( tsttIter, entityHandle ); }
TSTTM::Entity tsttMesh
TSTT mesh interface.
Definition: MeshTSTT.cpp:78
void * tsttIter
TSTT iterator handle.
Definition: MeshTSTT.cpp:79
bool notAtEnd
Flag to mark if end of iterator had been reached.
Definition: MeshTSTT.cpp:80
void * entityHandle
Current TSTT entity handle.
Definition: MeshTSTT.cpp:81

Here is the caller graph for this function:

bool is_at_end ( ) const
virtual

check if any remaining entity handles

Implements EntityIterator.

Definition at line 154 of file MeshTSTT.cpp.

References TSTTIterator::notAtEnd.

155 {
156  return !notAtEnd;
157 }
bool notAtEnd
Flag to mark if end of iterator had been reached.
Definition: MeshTSTT.cpp:80
Mesh::EntityHandle operator* ( ) const
virtual

get current entity handle

Implements EntityIterator.

Definition at line 149 of file MeshTSTT.cpp.

References TSTTIterator::entityHandle.

150 {
151  return entityHandle;
152 }
void * entityHandle
Current TSTT entity handle.
Definition: MeshTSTT.cpp:81
void operator++ ( )
virtual

step

Implements EntityIterator.

Definition at line 159 of file MeshTSTT.cpp.

References TSTTIterator::get_next_entity(), and Mesquite::process_tstt_error().

160 {
161  try {
162  get_next_entity();
163  }
164  catch (TSTTB::Error& tstt_err) {
165  process_tstt_error( tstt_err );
166  throw;
167  }
168 }
void get_next_entity()
Advance the iterator to the next entity.
Definition: MeshTSTT.cpp:87
static msq_std::string process_tstt_error(TSTTB::Error &tstt_err)

Here is the call graph for this function:

void restart ( )
virtual

reset iterator

Implements EntityIterator.

Definition at line 137 of file MeshTSTT.cpp.

References TSTTIterator::get_next_entity(), Mesquite::process_tstt_error(), TSTTIterator::tsttIter, and TSTTIterator::tsttMesh.

138 {
139  try {
140  tsttMesh.resetEntIter( tsttIter );
141  get_next_entity();
142  }
143  catch (TSTTB::Error& tstt_err) {
144  process_tstt_error( tstt_err );
145  throw;
146  }
147 }
TSTTM::Entity tsttMesh
TSTT mesh interface.
Definition: MeshTSTT.cpp:78
void * tsttIter
TSTT iterator handle.
Definition: MeshTSTT.cpp:79
void get_next_entity()
Advance the iterator to the next entity.
Definition: MeshTSTT.cpp:87
static msq_std::string process_tstt_error(TSTTB::Error &tstt_err)

Here is the call graph for this function:

Member Data Documentation

void* entityHandle
private

Current TSTT entity handle.

Definition at line 81 of file MeshTSTT.cpp.

Referenced by TSTTIterator::get_next_entity(), and TSTTIterator::operator*().

bool notAtEnd
private

Flag to mark if end of iterator had been reached.

Definition at line 80 of file MeshTSTT.cpp.

Referenced by TSTTIterator::get_next_entity(), and TSTTIterator::is_at_end().

void* tsttIter
private
TSTTM::Entity tsttMesh
private

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