HikoGUI
A low latency retained GUI
|
Utilities to assert and bound check. More...
#include "type_traits.hpp"
#include "terminate.hpp"
#include "../macros.hpp"
#include "exception.hpp"
#include <exception>
#include <ranges>
Go to the source code of this file.
Namespaces | |
namespace | hi |
The HikoGUI namespace. | |
namespace | hi::v1 |
The HikoGUI API version 1. | |
Concepts | |
concept | hi::v1::bound_check_range_helper |
Functions | |
hi_export_module (hikogui.utility.assert) | |
hi_warning_push () | |
hi_warning_ignore_msvc (26472) | |
hi_export constexpr bool | hi::v1::bound_check (std::integral auto index, std::integral auto upper) noexcept |
Check if an index is less than the bound. | |
hi_export constexpr bool | hi::v1::bound_check (std::integral auto index, std::integral auto lower, std::integral auto upper) noexcept |
Check if an index is between the lower (inclusive) and upper (exclusive). | |
hi_export constexpr bool | hi::v1::bound_check (std::floating_point auto index, std::floating_point auto lower, std::floating_point auto upper) noexcept |
Check if an floating point value is between the lower (inclusive) and upper (inclusive). | |
hi_export constexpr bool | hi::v1::bound_check (std::integral auto index, bound_check_range_helper auto &&range) noexcept |
Check if an index is within a range. | |
hi_warning_pop () | |
Utilities to assert and bound check.
hi_warning_ignore_msvc | ( | 26472 | ) |
Get a bit from an array of unsigned integers. The integers are arranged in little-endian order.
lhs | The array of integers from which to take the bit. |
index | The index of the bit |
Set a bit from an array of unsigned integers. The integers are arranged in little-endian order.
r | The array of integers on which to set the bit. |
index | The index of the bit |
value | The value of the bit, either 0 or 1. |
Shift logical left with carry chain.
lhs | The original value |
rhs | The count by how much to shift lhs left. |
carry | The carry data to or with the lower bits. |
Shift logical right with carry chain.
lhs | The original value |
rhs | The count by how much to shift lhs right. |
carry | The carry data to or with the lower bits. |
Shift arithmetic right with carry chain.
lhs | The original value |
rhs | The count by how much to shift lhs right. |
Add two numbers with carry chain.
lhs | The left hand side |
rhs | The right hand side |
carry | From the previous add in the chain |
Multiply with carry. The carry is a high-word of the multiplication result and has the same size as the inputs. The accumulator is used when doing long-multiplication from the previous row. This function does not overflow even if all the arguments are at max.
lhs | The left hand side. |
rhs | The right hand side. |
carry | The carry-input; carry-output from the previous mul_carry() . |
accumulator | The column value during a long multiply. |
Wide divide. Can be used to divide a wide unsigned integer by a unsigned integer, as long as the result fits in an unsigned integer.
lhs_lo | The low side of a wide left-hand-side |
lhs_hi | The high side of a wide left-hand-side |
rhs | The right hand side |
Bit scan reverse.
lhs | The array of unsigned integers to find the highest set bit off. |
n | The number of unsigned integers in the array. |
Invert unsigned integers using a carry-chain Technically this is not an carry chain.
r | The result of the inversion. |
rhs | The right hand side operand. |
n | The number of digits of r and rhs. |
shift logical right using a carry-chain
r | The result of the logical-shift-right. |
lhs | The left hand side operand of the lsr. |
rhs | The right hand side operand of the lsr, the number of bits to shift. |
n | The number of digits of r, lhs and rhs. |
shift logical right using a carry-chain
r | The result of the logical-shift-right. |
lhs | The left hand side operand of the lsr. |
rhs | The right hand side operand of the lsr, the number of bits to shift. |
n | The number of digits of r, lhs and rhs. |
shift arithmetic right using a carry-chain This sign-extends the left most bit.
r | The result of the logical-shift-right. |
lhs | The left hand side operand of the lsr. |
rhs | The right hand side operand of the lsr, the number of bits to shift. |
n | The number of digits of r, lhs and rhs. |
and-operation unsigned integers using a carry-chain
r | The result of the and-operation. |
lhs | The left hand side operand of the and-operation. |
rhs | The right hand side operand of the and-operation. |
n | The number of digits of r, lhs and rhs. |
or-operation unsigned integers using a carry-chain
r | The result of the and-operation. |
lhs | The left hand side operand of the or-operation. |
rhs | The right hand side operand of the or-operation. |
n | The number of digits of r, lhs and rhs. |
xor-operation unsigned integers using a carry-chain
r | The result of the and-operation. |
lhs | The left hand side operand of the xor-operation. |
rhs | The right hand side operand of the xor-operation. |
n | The number of digits of r, lhs and rhs. |
Negate unsigned integers using a carry-chain This is a two's compliment negate.
r | The result of the addition. |
rhs | The left hand side operand of the addition. |
n | The number of digits of r, lhs and rhs. |
Add unsigned integers using a carry-chain
r | The result of the addition. |
lhs | The left hand side operand of the addition. |
rhs | The right hand side operand of the addition. |
n | The number of digits of r, lhs and rhs. |
Subtract unsigned integers using a carry-chain
r | The result of the addition. |
lhs | The left hand side operand of the addition. |
rhs | The right hand side operand of the addition. |
n | The number of digits of r, lhs and rhs. |
Multiply unsigned integers using a carry-chain
r | The result of the multiplication. |
lhs | The left hand side operand. |
rhs | The right hand side operand. |
n | The number of digits of r, lhs and rhs. |
Divide unsigned integers using a carry-chain This function does a bit-wise division.
quotient | The result of the division. |
remainder | The remainder of the division. |
lhs | The left hand side operand. |
rhs | The right hand side operand. |
n | The number of digits of quotient, remainder, lhs and rhs. |
signed divide unsigned integers using a carry-chain This function does a bit-wise division. This function will allocate memory when one or both operands are negative.
quotient | The result of the division. |
remainder | The remainder of the division. The remainder has same sign as lhs. |
lhs | The left hand side operand. |
rhs | The right hand side operand. |
n | The number of digits of quotient, remainder, lhs and rhs. |