Formula Cell

class ixion::formula_cell

Public Functions

formula_cell(const formula_cell&)
formula_cell &operator=(formula_cell)
formula_cell()
formula_cell(size_t tokens_identifier)
~formula_cell()
size_t get_identifier() const
void set_identifier(size_t identifier)
double get_value() const
double get_value_nowait() const
void interpret(iface::formula_model_access &context, const abs_address_t &pos)
void check_circular(const iface::formula_model_access &cxt, const abs_address_t &pos)

Determine if this cell contains circular reference by walking through all its reference tokens.

void reset()

Reset cell’s internal state.

std::vector<const formula_token *> get_ref_tokens(const iface::formula_model_access &cxt, const abs_address_t &pos) const

Get a series of all reference tokens included in the formula expression stored in this cell.

Return
an array of reference formula tokens. Each element is a pointer to the actual token instance stored in the cell object. Be aware that the pointer is valid only as long as the actual token instance is alive.
Parameters
  • cxt: model context instance.
  • pos: position of the cell.

const formula_result &get_result_cache() const
const formula_result *get_result_cache_nowait() const
bool is_shared() const
void set_shared(bool b)
class ixion::formula_result

Store formula result which may be either numeric, textural, or error. In case the result is textural, it owns the instance of the string.

Public Types

enum result_type

Values:

value
string
error

Public Functions

formula_result()
formula_result(const formula_result &r)
formula_result(double v)
formula_result(string_id_t strid)
formula_result(formula_error_t e)
~formula_result()
void reset()
void set_value(double v)
void set_string(string_id_t strid)
void set_error(formula_error_t e)
double get_value() const

Get a numeric result value. The caller must make sure the result is of numeric type, else the behavior is undefined.

Return
numeric result value.

string_id_t get_string() const

Get a string ID for textural result value. The caller must make sure the result is of textural type, else the behavior is undefined.

Return
string ID.

formula_error_t get_error() const

Get an error value of the result. The caller must make sure that the result is of error type, else the behavior is undefined.

Return
enum value representing the error.
See
ixion::get_formula_error_name

result_type get_type() const

Get the type of result.

Return
enum value representing the result type.

std::string str(const iface::formula_model_access &cxt) const

Get a string representation of the result value no matter what the result type is.

Return
string representation of the result value.
Parameters
  • cxt: model context object.

void parse(iface::formula_model_access &cxt, const char *p, size_t n)

Parse a textural representation of a formula result, and set result value of appropriate type.

formula_result &operator=(const formula_result &r)
bool operator==(const formula_result &r) const
bool operator!=(const formula_result &r) const