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

TSTT iterator using array-iterator interface and buffer of handles. More...

Inheritance diagram for TSTTArrIter:
Collaboration diagram for TSTTArrIter:

Public Member Functions

 TSTTArrIter (TSTTM::Arr &mesh, void *meshset, TSTTM::EntityType type, TSTTM::EntityTopology topo, unsigned buffer_count=1024)
 
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 ~TSTTArrIter ()
 
- Public Member Functions inherited from EntityIterator
virtual ~EntityIterator ()
 

Private Member Functions

void get_next_array ()
 

Private Attributes

sidl::array< void * > handleArray
 
void * tsttIter
 
int index
 
int count
 
bool notAtEnd
 
TSTTM::Arr & myMesh
 

Detailed Description

TSTT iterator using array-iterator interface and buffer of handles.

Definition at line 198 of file MeshTSTT.cpp.

Constructor & Destructor Documentation

TSTTArrIter ( TSTTM::Arr &  mesh,
void *  meshset,
TSTTM::EntityType  type,
TSTTM::EntityTopology  topo,
unsigned  buffer_count = 1024 
)

Definition at line 234 of file MeshTSTT.cpp.

References TSTTArrIter::get_next_array(), and TSTTArrIter::tsttIter.

239  : handleArray( alloc_sidl_vector<void*>(buffer_count) ),
240  tsttIter(0),
241  index(0),
242  count(0),
243  notAtEnd(false),
244  myMesh( mesh )
245 {
246  mesh.initEntArrIter( meshset, type, topo, buffer_count, tsttIter );
247  get_next_array();
248 }
sidl::array< void * > handleArray
Definition: MeshTSTT.cpp:202
TSTTM::Arr & myMesh
Definition: MeshTSTT.cpp:206

Here is the call graph for this function:

~TSTTArrIter ( )
virtual

Definition at line 250 of file MeshTSTT.cpp.

References TSTTArrIter::myMesh, Mesquite::process_tstt_error(), and TSTTArrIter::tsttIter.

251 {
252  try {
253  if (tsttIter)
254  myMesh.endEntArrIter( tsttIter );
255  }
256  catch (TSTTB::Error& tstt_err) {
257  process_tstt_error( tstt_err );
258  throw;
259  }
260 }
TSTTM::Arr & myMesh
Definition: MeshTSTT.cpp:206
static msq_std::string process_tstt_error(TSTTB::Error &tstt_err)

Here is the call graph for this function:

Member Function Documentation

void get_next_array ( )
inlineprivate

Definition at line 208 of file MeshTSTT.cpp.

References TSTTArrIter::count, TSTTArrIter::handleArray, TSTTArrIter::index, TSTTArrIter::myMesh, TSTTArrIter::notAtEnd, and TSTTArrIter::tsttIter.

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

209  {
210  index = count = 0;
211  notAtEnd = myMesh.getEntArrNextIter( tsttIter, handleArray, count ) && count;
212  }
sidl::array< void * > handleArray
Definition: MeshTSTT.cpp:202
TSTTM::Arr & myMesh
Definition: MeshTSTT.cpp:206

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 279 of file MeshTSTT.cpp.

References TSTTArrIter::count, TSTTArrIter::index, and TSTTArrIter::notAtEnd.

280 {
281  return index == count && !notAtEnd;
282 }
Mesh::EntityHandle operator* ( ) const
virtual

get current entity handle

Implements EntityIterator.

Definition at line 274 of file MeshTSTT.cpp.

References TSTTArrIter::handleArray, and TSTTArrIter::index.

275 {
276  return handleArray.get(index);
277 }
sidl::array< void * > handleArray
Definition: MeshTSTT.cpp:202
void operator++ ( )
virtual

step

Implements EntityIterator.

Definition at line 284 of file MeshTSTT.cpp.

References TSTTArrIter::count, TSTTArrIter::get_next_array(), TSTTArrIter::index, TSTTArrIter::notAtEnd, and Mesquite::process_tstt_error().

285 {
286  try {
287  ++index;
288  if (index == count && notAtEnd)
289  get_next_array();
290  }
291  catch (TSTTB::Error& tstt_err) {
292  process_tstt_error( tstt_err );
293  throw;
294  }
295 }
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 262 of file MeshTSTT.cpp.

References TSTTArrIter::get_next_array(), TSTTArrIter::myMesh, Mesquite::process_tstt_error(), and TSTTArrIter::tsttIter.

263 {
264  try {
265  myMesh.resetEntArrIter( tsttIter );
266  get_next_array();
267  }
268  catch (TSTTB::Error& tstt_err) {
269  process_tstt_error( tstt_err );
270  throw;
271  }
272 }
TSTTM::Arr & myMesh
Definition: MeshTSTT.cpp:206
static msq_std::string process_tstt_error(TSTTB::Error &tstt_err)

Here is the call graph for this function:

Member Data Documentation

int count
private
sidl::array<void*> handleArray
private

Definition at line 202 of file MeshTSTT.cpp.

Referenced by TSTTArrIter::get_next_array(), and TSTTArrIter::operator*().

TSTTM::Arr& myMesh
private
bool notAtEnd
private
void* tsttIter
private

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