Go to the documentation of this file.
20 #ifndef LIBMESH_STORED_RANGE_H
21 #define LIBMESH_STORED_RANGE_H
24 #include "libmesh/threads.h"
51 template <
typename iterator_type,
typename object_type>
71 _objs(new
std::vector<object_type>()),
82 const iterator_type & last,
83 const unsigned int new_grainsize = 1000) :
89 _objs(new
std::vector<object_type>()),
92 this->
reset(first, last);
107 const unsigned int new_grainsize = 1000) :
201 half = first + (last-first)/2u;
223 const iterator_type & last)
227 for (iterator_type it=first; it!=last; ++it)
228 _objs->push_back(*it);
323 #endif // LIBMESH_STORED_RANGE_H
StoredRange(const iterator_type &first, const iterator_type &last, const unsigned int new_grainsize=1000)
Constructor.
std::vector< object_type >::const_iterator const_iterator
Allows an StoredRange to behave like an STL container.
StoredRange< iterator_type, object_type > & reset(const iterator_type &first, const iterator_type &last)
Resets the StoredRange to contain [first,last).
const_iterator end() const
End of the range.
StoredRange(std::vector< object_type > *objs, const unsigned int new_grainsize=1000)
Constructor.
The libMesh namespace provides an interface to certain functionality in the library.
Dummy "splitting object" used to distinguish splitting constructors from copy constructors.
const_iterator begin() const
Beginning of the range.
std::size_t last_idx() const
Index in the stored vector of the last object.
StoredRange< iterator_type, object_type > & reset()
Resets the range to the last specified range.
void grainsize(const unsigned int &gs)
Set the grain size.
StoredRange(const unsigned int new_grainsize=1000)
Constructor.
StoredRange(const StoredRange< iterator_type, object_type > &er)
Copy constructor.
~StoredRange()
Destructor.
Real distance(const Point &p)
std::vector< object_type > * _objs
StoredRange(StoredRange< iterator_type, object_type > &r, Threads::split)
Splits the range r.
std::size_t first_idx() const
Index in the stored vector of the first object.
bool is_divisible() const
The StoredRange class defines a contiguous, divisible set of objects.
std::size_t grainsize() const
The grain size for the range.
StoredRange(const StoredRange< iterator_type, object_type > &er, const const_iterator &begin_range, const const_iterator &end_range)
NOTE: When using pthreads this constructor is MANDATORY!!!