Template Class OpAttrMap#

Class Documentation#

template<typename ValueType>
class OpAttrMap#

Typed live view of an Op attribute column.

Copies share the retained mutable column and observe later registrations, replacements, resets, and growth. Values are returned by value, never as references into a backing array. Registration is not synchronized with readers.

Template Parameters:

ValueType – The attribute value type.

Public Functions

inline int count(const Op &op) const#

Check whether an operator has a value in this column.

Parameters:

op – The operator.

Returns:

1 if present, 0 otherwise.

inline ValueType operator[](const Op &op) const#

Look up an operator’s attribute, raising InternalError if absent.

Parameters:

op – The operator.

Returns:

The value converted to ValueType.

inline ValueType get(const Op &op, ValueType def_value) const#

Look up an operator’s attribute with a fallback.

Parameters:
  • op – The operator.

  • def_value – Fallback when the attribute is absent.

Returns:

The registered value or def_value.

inline ValueType get(const Expr &expr, ValueType def_value) const#

Look up an expression’s attribute with a fallback.

Parameters:
  • expr – A defined expression.

  • def_value – Fallback when expr is not an Op or its attribute is absent.

Returns:

The registered value or def_value.