model_cell_range
Defined in header: <ixion/model_cell_range.hpp>
-
class model_cell_range
STL-compliant range over the cells of a sheet (or sub-range). Returned by model_context::iterate_cells. Supports range-
forand STL/range algorithms via its nested const_iterator.The caller has to ensure that the model content does not change for the duration of the iteration.
Public Functions
-
model_cell_range()
Construct an empty range.
-
model_cell_range(const model_cell_range&) = delete
-
model_cell_range(model_cell_range &&other)
Move constructor.
-
~model_cell_range()
-
model_cell_range &operator=(const model_cell_range&) = delete
-
model_cell_range &operator=(model_cell_range &&other)
Move assignment.
-
const_iterator begin() const
Get an iterator to the first cell of the range.
-
const_iterator cbegin() const
Get an iterator to the first cell of the range.
Friends
- friend class detail::model_context_impl
-
struct cell
One cell yielded by the iteration: its position within the sheet, its type and its value. Empty cells are yielded too, with the empty type and no meaningful value.
Public Types
-
using value_type = std::variant<bool, double, std::string_view, const formula_cell*>
Type of the stored value. A formula cell is represented by a pointer to its formula_cell instance, which remains valid as long as the cell stays in the model.
-
using value_type = std::variant<bool, double, std::string_view, const formula_cell*>
-
class const_iterator
Move-only input iterator over the cells of a model_cell_range. The end of the range is marked by a sentinel rather than another iterator.
Public Types
-
using iterator_category = std::input_iterator_tag
Iterator category, which is input iterator.
-
using difference_type = std::ptrdiff_t
Type of the difference between two iterators.
Public Functions
-
const_iterator()
Construct an iterator at the end position.
-
const_iterator(const_iterator &&other)
Move constructor.
-
const_iterator &operator=(const_iterator &&other)
Move assignment.
-
~const_iterator()
-
const_iterator &operator++()
Advance to the next cell.
-
void operator++(int)
Advance to the next cell. Nothing is returned, as the iterator is move-only.
-
bool operator==(const const_iterator &r) const
Compare the positions of two iterators.
-
using iterator_category = std::input_iterator_tag
-
struct sentinel
End sentinel to allow const_iterator to remain move-only while still satisfying std::sentinel_for etc.
-
model_cell_range()