named_expressions_iterator

Defined in header: <ixion/named_expressions_iterator.hpp>

class named_expressions_iterator

Iterator over the named expressions of one scope, either the global scope or one sheet. Obtained from model_context::get_named_expressions_iterator(). It is a cursor: check has(), read get(), then call next(), until has() returns false. The expressions are visited in the order of their names.

Deprecated:

Use named_expressions_range, obtained from model_context::iterate_named_expressions(), which works with range-for and the standard algorithms.

Public Functions

named_expressions_iterator()

Construct an iterator over no named expressions.

named_expressions_iterator(const named_expressions_iterator &other)

Copy constructor.

named_expressions_iterator(named_expressions_iterator &&other)

Move constructor.

~named_expressions_iterator()
size_t size() const

Get the number of named expressions in the scope.

bool has() const

Check whether the iterator is at a named expression rather than past the end.

void next()

Advance to the next named expression.

named_expression get() const

Get the named expression at the current position.

named_expressions_iterator &operator=(const named_expressions_iterator &other)

Copy assignment.

struct named_expression

One named expression, as returned by get(). Both pointers refer to storage inside the model and remain valid as long as the named expression stays in the model.

Public Members

const std::string *name

Name of the expression.

const named_expression_t *expression

The expression itself.