session_handler

Defined in header: <ixion/interface/session_handler.hpp>

class session_handler

Interface for receiving the events of one formula cell interpretation, for tracing or debugging. The interpreter creates one handler per cell through the factory set with model_context::set_session_handler_factory(), calls begin_cell_interpret() first, then the push methods for each token as it gets processed, then one of set_result(), set_invalid_expression() or set_formula_error(), and end_cell_interpret() last.

Public Functions

virtual ~session_handler()
virtual void begin_cell_interpret(const abs_address_t &pos) = 0

Called when the interpretation of a formula cell begins.

Parameters:

pos – Position of the formula cell.

virtual void end_cell_interpret() = 0

Called when the interpretation of the formula cell ends.

virtual void set_result(const formula_result &result) = 0

Called when the interpretation has produced a result.

Parameters:

result – Result of the formula cell.

virtual void set_invalid_expression(std::string_view msg) = 0

Called when the interpretation has failed because the formula expression is not valid.

Parameters:

msg – Message describing the problem.

virtual void set_formula_error(std::string_view msg) = 0

Called when the interpretation has failed with a formula error.

Parameters:

msg – Message describing the error.

virtual void push_token(fopcode_t fop) = 0

Called for an operator or a structural token, such as a parenthesis or a separator.

Parameters:

fop – Opcode of the token.

virtual void push_value(double val) = 0

Called for a numeric literal.

Parameters:

val – Numeric value.

virtual void push_error(formula_error_t err) = 0

Called for an error literal.

Parameters:

err – Error value.

virtual void push_string(std::string_view s) = 0

Called for a string literal.

Parameters:

s – String value.

virtual void push_single_ref(const address_t &addr, const abs_address_t &pos) = 0

Called for a cell reference.

Parameters:
  • addr – Cell reference, whose components, if relative, are offsets from the position of the formula cell.

  • pos – Position of the formula cell.

virtual void push_range_ref(const range_t &range, const abs_address_t &pos) = 0

Called for a range reference.

Parameters:
  • range – Range reference, whose components, if relative, are offsets from the position of the formula cell.

  • pos – Position of the formula cell.

virtual void push_table_ref(const table_ref_t &table) = 0

Called for a table reference.

Parameters:

table – Table reference.

virtual void push_function(formula_function_t foc) = 0

Called for a function, before its arguments get processed.

Parameters:

foc – Opcode of the function.