moab
MBIter.hpp File Reference
#include "Internals.hpp"
#include "moab/Range.hpp"
#include "moab/Core.hpp"
#include <vector>
#include <algorithm>

Go to the source code of this file.

Classes

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

Defines

#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)

Define Documentation

#define IS_BUILDING_MB

Definition at line 4 of file MBIter.hpp.


Typedef Documentation

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

Definition at line 167 of file MBIter.hpp.

Definition at line 168 of file MBIter.hpp.


Function Documentation

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

Definition at line 64 of file MBIter.hpp.

{
  if (0 > num_steps) return MB_FAILURE;

  while (num_steps && curr != end) {
    num_steps--;
    curr++;
  }
  at_end = (curr == end);
  return MB_SUCCESS;
}
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 78 of file MBIter.hpp.

{
  if (0 > num_steps) return MB_FAILURE;

  assert(curr <= end); // Sanity check
  at_end = (end - curr <= num_steps);

  if (at_end)
    curr = end;
  else
    curr += num_steps;
  return MB_SUCCESS;
}
ErrorCode step_iterator ( Range::const_iterator &  curr,
const Range::const_iterator &  end,
int  num_steps,
bool &  at_end 
) [inline]

Definition at line 95 of file MBIter.hpp.

{
  if (0 > num_steps) return MB_FAILURE;

  at_end = (end - curr <= num_steps);

  if (at_end)
    curr = end;
  else
    curr += num_steps;
  return MB_SUCCESS;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines