Commit 54c2d234 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

Make it easier to iterator over blocks.

Now `for (block : multiblock)` is supported.
parent d1a59aad
......@@ -111,6 +111,15 @@ public:
VTKM_CONT
void PrintSummary(std::ostream& stream) const;
//@{
/// API to support range-based for loops on blocks.
std::vector<DataSet>::iterator begin() noexcept { return this->Blocks.begin(); }
std::vector<DataSet>::iterator end() noexcept { return this->Blocks.end(); }
std::vector<DataSet>::const_iterator begin() const noexcept { return this->Blocks.begin(); }
std::vector<DataSet>::const_iterator end() const noexcept { return this->Blocks.end(); }
std::vector<DataSet>::const_iterator cbegin() const noexcept { return this->Blocks.begin(); }
std::vector<DataSet>::const_iterator cend() const noexcept { return this->Blocks.end(); }
//@}
private:
std::vector<vtkm::cont::DataSet> Blocks;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment