Resolved pivot values of a typing rule, or the reason it failed.
More...
#include <rexlib/core/operation/type_rule/type_rule_resolution.hpp>
Resolved pivot values of a typing rule, or the reason it failed.
Allocation free and trivially copyable. A failure is reported as a status, not thrown.
- See also
- operand_type_rule
◆ fail()
Derive a failed resolution from this one.
Unlike failure, the pivots resolved so far are preserved.
- Parameters
-
| status | The reason of the failure. Must not be type_rule_status::ok. |
| operand_index | Index of the operand the failure is attributed to. |
| output_operand | Whether operand_index refers to an output operand. |
| type | The offending type. |
- Returns
- type_rule_resolution The failed resolution.
◆ failure()
Construct a failed resolution.
- Parameters
-
| status | The reason of the failure. Must not be type_rule_status::ok. |
| operand_index | Index of the operand the failure is attributed to. |
| output_operand | Whether operand_index refers to an output operand. |
| type | The offending type. |
- Returns
- type_rule_resolution The failed resolution.
◆ get_offending_type()
| numerical_type rexlib::type_rule_resolution::get_offending_type |
( |
| ) |
const |
|
noexcept |
Get the type that caused the failure.
- Returns
- numerical_type The offending type.
◆ get_operand_index()
| std::size_t rexlib::type_rule_resolution::get_operand_index |
( |
| ) |
const |
|
noexcept |
Get the index of the operand a failure is attributed to.
- Returns
- std::size_t The operand index.
◆ get_pivot()
| numerical_type rexlib::type_rule_resolution::get_pivot |
( |
std::size_t |
index | ) |
const |
|
noexcept |
Get the value of a resolved pivot.
- Parameters
-
| index | Index of the pivot. Must be less than the pivot count. |
- Returns
- numerical_type The pivot value. May be numerical_type::unknown when the pivot is free and was not bound.
◆ get_pivot_count()
| std::size_t rexlib::type_rule_resolution::get_pivot_count |
( |
| ) |
const |
|
noexcept |
Get the number of resolved pivots.
- Returns
- std::size_t The pivot count.
◆ get_status()
Get the outcome of the resolution.
- Returns
- type_rule_status The status.
◆ is_output_operand()
| bool rexlib::type_rule_resolution::is_output_operand |
( |
| ) |
const |
|
noexcept |
Check whether the failing operand is an output.
- Returns
- true The operand is an output operand.
-
false The operand is an input operand.
◆ operator bool()
| rexlib::type_rule_resolution::operator bool |
( |
| ) |
const |
|
explicitnoexcept |
Check whether the resolution succeeded.
- Returns
- true The rule resolved successfully.
-
false The rule could not be resolved.
◆ set_pivot()
Set the value of a pivot.
- Parameters
-
| index | Index of the pivot. Must be less than max_type_pivot_count. |
| type | The pivot value. |
◆ set_pivot_count()
| void rexlib::type_rule_resolution::set_pivot_count |
( |
std::size_t |
count | ) |
|
|
noexcept |
Set the number of pivots the resolution holds.
- Parameters
-
| count | The pivot count. Must not exceed max_type_pivot_count. |
The documentation for this class was generated from the following file: