address_t

Defined in header: <ixion/address.hpp>

struct address_t

Stores either absolute or relative address. Each component is absolute or relative on its own. An absolute component is a position, whereas a relative component is an offset from the position of the cell the address is used in.

Public Functions

address_t()

Construct the absolute address of the top-left cell of the first sheet.

address_t(sheet_t _sheet, row_t _row, col_t _column, bool _abs_sheet = true, bool _abs_row = true, bool _abs_column = true)

Construct an address from its components and their absolute flags.

address_t(const address_t &r)

Copy constructor.

address_t(const abs_address_t &r)

Construct an address with all components absolute.

bool valid() const

Check whether the address is valid. An absolute sheet component must not be negative, and the row and column components must be within their upper bounds.

abs_address_t to_abs(const abs_address_t &origin) const

Convert the address to an absolute address. Each relative component gets added to the corresponding component of the origin.

Parameters:

origin – Position of the cell the address is used in.

Returns:

Absolute address.

::std::string get_name() const

Get a string representation of the address, for debugging.

void set_absolute(bool abs)

Set all three components absolute or relative.

std::strong_ordering operator<=>(const address_t &r) const

Order addresses by their components and flags, in declaration order.

bool operator==(const address_t &r) const

Compare all the components and flags of two addresses.

Public Members

sheet_t sheet

Sheet index, or sheet offset when relative.

row_t row

Row position, or row offset when relative.

col_t column

Column position, or column offset when relative.

bool abs_sheet

Whether the sheet component is absolute.

bool abs_row

Whether the row component is absolute.

bool abs_column

Whether the column component is absolute.

struct hash

Hash function for use in unordered containers.

Public Functions

size_t operator()(const address_t &addr) const

Compute the hash value of an address.