MOAB: Mesh Oriented datABase  (version 5.5.0)
MBIter.hpp File Reference
#include "Internals.hpp"
#include "moab/Range.hpp"
#include "moab/Core.hpp"
#include <vector>
#include <algorithm>
+ Include dependency graph for MBIter.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  iBase_EntityArrIterator_Private
 
class  iBase_EntityArrIterator_Private::IsType
 
class  MBIter< Container >
 

Macros

#define IS_BUILDING_MB
 

Typedefs

typedef MBIter< std::vector< EntityHandle > > MBListIter
 
typedef MBIter< moab::RangeMBRangeIter
 

Functions

template<typename T >
ErrorCode step_iterator (T &curr, const T &end, int num_steps, bool &at_end)
 
template<typename T >
ErrorCode step_iterator (typename std::vector< T >::const_iterator &curr, const typename std::vector< T >::const_iterator &end, int num_steps, bool &at_end)
 
ErrorCode step_iterator (Range::const_iterator &curr, const Range::const_iterator &end, int num_steps, bool &at_end)
 

Macro Definition Documentation

◆ IS_BUILDING_MB

#define IS_BUILDING_MB

Definition at line 4 of file MBIter.hpp.

Typedef Documentation

◆ MBListIter

typedef MBIter< std::vector< EntityHandle > > MBListIter

Definition at line 187 of file MBIter.hpp.

◆ MBRangeIter

Definition at line 188 of file MBIter.hpp.

Function Documentation

◆ step_iterator() [1/3]

ErrorCode step_iterator ( Range::const_iterator &  curr,
const Range::const_iterator &  end,
int  num_steps,
bool &  at_end 
)
inline

Definition at line 104 of file MBIter.hpp.

108 {
109  if( 0 > num_steps ) return MB_FAILURE;
110 
111  at_end = ( end - curr <= num_steps );
112 
113  if( at_end )
114  curr = end;
115  else
116  curr += num_steps;
117  return MB_SUCCESS;
118 }

References MB_SUCCESS.

◆ step_iterator() [2/3]

template<typename T >
ErrorCode step_iterator ( T curr,
const T end,
int  num_steps,
bool &  at_end 
)
inline

Definition at line 73 of file MBIter.hpp.

74 {
75  if( 0 > num_steps ) return MB_FAILURE;
76 
77  while( num_steps && curr != end )
78  {
79  num_steps--;
80  curr++;
81  }
82  at_end = ( curr == end );
83  return MB_SUCCESS;
84 }

References MB_SUCCESS.

Referenced by MBIter< Container >::step().

◆ step_iterator() [3/3]

template<typename T >
ErrorCode step_iterator ( typename std::vector< T >::const_iterator &  curr,
const typename std::vector< T >::const_iterator &  end,
int  num_steps,
bool &  at_end 
)
inline

Definition at line 87 of file MBIter.hpp.

91 {
92  if( 0 > num_steps ) return MB_FAILURE;
93 
94  assert( curr <= end ); // Sanity check
95  at_end = ( end - curr <= num_steps );
96 
97  if( at_end )
98  curr = end;
99  else
100  curr += num_steps;
101  return MB_SUCCESS;
102 }

References MB_SUCCESS.