HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Namespaces | Data Structures | Typedefs | Enumerations | Functions | Variables
hi Namespace Reference

The HikoGUI namespace. More...

Namespaces

namespace  geo
 HikoGUI geometry types.
 
namespace  v1
 The HikoGUI API version 1.
 

Data Structures

class  abstract_button_widget
 Base class for implementing button widgets. More...
 
class  audio_device_widget
 Audio device configuration widget. More...
 
class  button_delegate
 A button delegate controls the state of a button widget. More...
 
class  cancel_error
 Cancel error is caused by user pressing cancel. More...
 
struct  char_converter
 A converter between character encodings. More...
 
struct  char_map
 Character encoder/decoder template. More...
 
struct  char_map<"ascii">
 ASCII (7-bit) character map. More...
 
struct  char_map<"cp-1252">
 CP-1252 / Windows-1252 character map. More...
 
struct  char_map<"iso-8859-1">
 ISO-8859-1 / Latin-1 character map. More...
 
struct  char_map<"utf-16">
 Unicode UTF-16 encoding. More...
 
struct  char_map<"utf-32">
 Unicode UTF-32 encoding. More...
 
struct  char_map<"utf-8">
 Unicode UTF-8 encoding. More...
 
class  checkbox_widget
 A GUI widget that permits the user to make a binary choice. More...
 
class  const_resource_view
 A read-only view of a resource. More...
 
class  default_radio_button_delegate
 A default radio button delegate. More...
 
class  default_selection_delegate
 A delegate that control the state of a selection_widget. More...
 
class  default_tab_delegate
 A delegate that control the state of a tab_widget. More...
 
class  default_text_delegate
 A default text delegate. More...
 
class  default_text_delegate< gstring >
 A default text delegate specialization for gstring. More...
 
class  default_text_delegate< std::string >
 A default text delegate specialization for std::string. More...
 
class  default_text_delegate< text >
 A default text delegate specialization for text. More...
 
class  default_text_delegate< translate >
 A default text delegate specialization for translate. More...
 
class  default_text_field_delegate
 A default text delegate. More...
 
class  default_text_field_delegate< T >
 A default text delegate specialization for std::integral<T>. More...
 
class  default_toggle_button_delegate
 A default toggle button delegate. More...
 
class  file
 A File object. More...
 
class  file_view
 Map a file into virtual memory. More...
 
class  glob_pattern
 A glob pattern. More...
 
class  grid_layout
 Grid layout is used to layout widgets along an axis. More...
 
class  grid_widget
 A GUI widget that lays out child-widgets in a grid with variable sized cells. More...
 
class  gui_error
 
class  gui_event
 A user interface event. More...
 
class  icon_widget
 An simple GUI widget that displays an icon. More...
 
class  io_error
 Exception thrown during I/O on an error. More...
 
class  key_error
 
struct  keyboard_target_data
 
class  label_widget
 The GUI widget displays and lays out text together with an icon. More...
 
class  log
 
class  menu_button_widget
 A button that is part of a menu. More...
 
class  momentary_button_widget
 A momentary button widget. More...
 
struct  mouse_event_data
 Information for a mouse event. More...
 
class  operation_error
 Exception thrown during execution of a dynamic operation. More...
 
class  os_error
 Exception thrown during an operating system call. More...
 
class  overlay_widget
 A GUI widget which may exist anywhere on a window overlaid above any other widget. More...
 
class  parse_error
 Exception thrown during parsing on an error. More...
 
class  radio_button_widget
 A graphical control element that allows the user to choose only one of a predefined set of mutually exclusive options. More...
 
class  row_column_widget
 A row/column widget lays out child widgets along a row or column. More...
 
class  scroll_aperture_widget
 A scroll aperture widget. More...
 
class  scroll_bar_widget
 Scroll bar widget This widget is used in a pair of a vertical and horizontal scrollbar as a child of the scroll_widget. More...
 
class  scroll_widget
 The scroll widget allows a content widget to be shown in less space than is required. More...
 
class  selection_delegate
 A delegate that controls the state of a selection_widget. More...
 
class  selection_widget
 A graphical control element that allows the user to choose only one of a predefined set of mutually exclusive options. More...
 
class  set_constraints_context
 
class  system_menu_widget
 The system menu widget. More...
 
class  tab_delegate
 A delegate that controls the state of a tab_widget. More...
 
class  tab_widget
 A graphical element that shows only one of a predefined set of mutually exclusive child widgets. More...
 
class  text_delegate
 A delegate that controls the state of a text_widget. More...
 
class  text_field_delegate
 A delegate that controls the state of a text_field_widget. More...
 
class  text_field_widget
 A single line text field. More...
 
class  text_widget
 A text widget. More...
 
class  toggle_widget
 A GUI widget that permits the user to make a binary choice. More...
 
class  toolbar_button_widget
 A momentary button used as a child in the toolbar. More...
 
class  toolbar_tab_button_widget
 A graphical control element that allows the user to choose only one of a predefined set of mutually exclusive views of a tab_widget. More...
 
class  toolbar_widget
 A toolbar widget is located at the top of a window and lays out its children horizontally. More...
 
class  URI
 A Uniform Resource Identifier. More...
 
class  uri_error
 
class  URL
 Universal Resource Locator. More...
 
class  url_error
 
class  widget
 An interactive graphical object as part of the user-interface. More...
 
class  widget_baseline
 The base-line of a widget on which to set the text and graphics. More...
 
class  widget_constraints
 The constraints of a widget. More...
 
class  widget_layout
 The layout of a widget. More...
 
class  window_traffic_lights_widget
 Window control button widget. More...
 
class  window_widget
 The top-level window widget. More...
 

Typedefs

using identity2 = geo::identity
 
using identity3 = geo::identity
 
using lookat3 = geo::lookat
 
using perspective3 = geo::perspective
 
using ssize_t = std::ptrdiff_t
 Signed size/index into an array.
 
using row_widget = row_column_widget<axis::row>
 Lays out children in a row.
 
using column_widget = row_column_widget<axis::column>
 Lays out children in a column.
 
using horizontal_scroll_bar_widget = scroll_bar_widget<axis::horizontal>
 
using vertical_scroll_bar_widget = scroll_bar_widget<axis::vertical>
 
using vertical_scroll_widget = scroll_widget<axis::vertical>
 Vertical scroll widget.
 
using horizontal_scroll_widget = scroll_widget<axis::horizontal>
 Horizontal scroll widget.
 

Enumerations

enum class  seek_whence { seek_whence::begin , seek_whence::current , seek_whence::end }
 The position in the file to seek from. More...
 
enum class  access_mode {
  access_mode::read = 0x1 , access_mode::write = 0x2 , access_mode::rename = 0x4 , access_mode::read_lock = 0x10 ,
  access_mode::write_lock = 0x20 , access_mode::open = 0x100 , access_mode::create = 0x200 , access_mode::truncate = 0x400 ,
  access_mode::random = 0x1000 , access_mode::sequential = 0x2000 , access_mode::no_reuse = 0x4000 , access_mode::write_through = 0x8000 ,
  access_mode::create_directories = 0x10000 , access_mode::open_for_read = open | read , access_mode::open_for_read_and_write = open | read | write , truncate_or_create_for_write = create_directories | open | create | truncate | write
}
 The mode in which way to open a file. More...
 
enum class  path_location {
  path_location::resource_dirs , path_location::executable_file , path_location::executable_dir , path_location::library_file ,
  path_location::library_dir , path_location::data_dir , path_location::log_dir , path_location::preferences_file ,
  path_location::system_font_dirs , path_location::font_dirs , path_location::theme_dirs
}
 File and Directory locations. More...
 
enum class  gui_event_type {
  none , keyboard_down , keyboard_up , keyboard_grapheme ,
  keyboard_partial_grapheme , keyboard_enter , keyboard_exit , mouse_move ,
  mouse_drag , mouse_down , mouse_up , mouse_wheel ,
  mouse_enter , mouse_exit , mouse_exit_window , gui_event_type::window_redraw ,
  gui_event_type::window_relayout , gui_event_type::window_reconstrain , gui_event_type::window_resize , gui_event_type::window_minimize ,
  gui_event_type::window_maximize , gui_event_type::window_normalize , gui_event_type::window_close , gui_event_type::window_open_sysmenu ,
  gui_event_type::window_set_keyboard_target , gui_event_type::window_remove_keyboard_target , gui_event_type::window_set_clipboard , text_cursor_left_char ,
  text_cursor_right_char , text_cursor_down_char , text_cursor_up_char , text_cursor_left_word ,
  text_cursor_right_word , text_cursor_begin_line , text_cursor_end_line , text_cursor_begin_sentence ,
  text_cursor_end_sentence , text_cursor_begin_document , text_cursor_end_document , text_select_left_char ,
  text_select_right_char , text_select_down_char , text_select_up_char , text_select_word ,
  text_select_left_word , text_select_right_word , text_select_begin_line , text_select_end_line ,
  text_select_begin_sentence , text_select_end_sentence , text_select_document , text_select_begin_document ,
  text_select_end_document , text_delete_char_prev , text_delete_char_next , text_delete_word_prev ,
  text_delete_word_next , text_swap_chars , text_edit_paste , text_edit_copy ,
  text_edit_cut , text_undo , text_redo , text_insert_line ,
  text_insert_line_up , text_insert_line_down , text_mode_insert , gui_widget_next ,
  gui_widget_prev , gui_menu_next , gui_menu_prev , gui_toolbar_open ,
  gui_toolbar_next , gui_toolbar_prev , gui_activate , gui_activate_next ,
  gui_cancel
}
 GUI event type. More...
 
enum class  gui_event_variant {
  gui_event_variant::other , gui_event_variant::mouse , gui_event_variant::keyboard , gui_event_variant::keyboard_target ,
  gui_event_variant::grapheme , gui_event_variant::rectangle , gui_event_variant::clipboard_data
}
 A granular gui event type. More...
 
enum class  button_state { button_state::off , button_state::on , button_state::other }
 The state of a button. More...
 
enum class  widget_mode {
  widget_mode::collapse , widget_mode::invisible , widget_mode::disabled , widget_mode::display ,
  widget_mode::select , widget_mode::partial , widget_mode::enabled
}
 The mode that the widget is operating at. More...
 

Functions

char32_t random_char () noexcept
 
constexpr std::u32string to_u32string (std::u32string_view rhs) noexcept
 Identity conversion from UTF-32 to UTF-32.
 
constexpr std::u32string to_u32string (std::u16string_view rhs) noexcept
 Conversion from UTF-16 to UTF-32.
 
constexpr std::u32string to_u32string (std::u8string_view rhs) noexcept
 Conversion from UTF-8 to UTF-32.
 
constexpr std::u32string to_u32string (std::wstring_view rhs) noexcept
 Conversion from wide-string (UTF-16/32) to UTF-32.
 
constexpr std::u32string to_u32string (std::string_view rhs) noexcept
 Conversion from UTF-8 to UTF-32.
 
constexpr std::u16string to_u16string (std::u32string_view rhs) noexcept
 Conversion from UTF-32 to UTF-16.
 
constexpr std::u16string to_u16string (std::u16string_view rhs) noexcept
 Identity conversion from UTF-16 to UTF-16.
 
constexpr std::u16string to_u16string (std::u8string_view rhs) noexcept
 Conversion from UTF-8 to UTF-16.
 
constexpr std::u16string to_u16string (std::wstring_view rhs) noexcept
 Conversion from wide-string (UTF-16/32) to UTF-16.
 
constexpr std::u16string to_u16string (std::string_view rhs) noexcept
 Conversion from UTF-8 to UTF-16.
 
constexpr std::u8string to_u8string (std::u32string_view rhs) noexcept
 Conversion from UTF-32 to UTF-8.
 
constexpr std::u8string to_u8string (std::u16string_view rhs) noexcept
 Conversion from UTF-16 to UTF-8.
 
constexpr std::u8string to_u8string (std::u8string_view rhs) noexcept
 Identity conversion from UTF-8 to UTF-8.
 
constexpr std::u8string to_u8string (std::wstring_view rhs) noexcept
 Conversion from wide-string (UTF-16/32) to UTF-8.
 
constexpr std::u8string to_u8string (std::string_view rhs) noexcept
 Conversion from UTF-8 to UTF-8.
 
constexpr std::wstring to_wstring (std::u32string_view rhs) noexcept
 Conversion from UTF-32 to wide-string (UTF-16/32).
 
constexpr std::wstring to_wstring (std::u16string_view rhs) noexcept
 Conversion from UTF-16 to wide-string (UTF-16/32).
 
constexpr std::wstring to_wstring (std::u8string_view rhs) noexcept
 Conversion from UTF-8 to wide-string (UTF-16/32).
 
constexpr std::wstring to_wstring (std::wstring_view rhs) noexcept
 Identity conversion from wide-string (UTF-16/32) to wide-string (UTF-16/32).
 
constexpr std::wstring to_wstring (std::string_view rhs) noexcept
 Conversion from UTF-8 to wide-string (UTF-16/32).
 
constexpr std::string to_string (std::u32string_view rhs) noexcept
 Conversion from UTF-32 to UTF-8.
 
constexpr std::string to_string (std::u16string_view rhs) noexcept
 Conversion from UTF-16 to UTF-8.
 
constexpr std::string to_string (std::u8string_view rhs) noexcept
 Identity conversion from UTF-8 to UTF-8.
 
constexpr std::string to_string (std::wstring_view rhs) noexcept
 Conversion from wide-string (UTF-16/32) to UTF-8.
 
constexpr std::string to_string (std::string_view rhs) noexcept
 Conversion from UTF-8 to UTF-8.
 
template<std::integral T>
std::string to_string (T const &value) noexcept
 Convert integer to string.
 
template<std::integral T>
from_string (std::string_view str, int base=10)
 Convert a string to an integer.
 
template<std::floating_point T>
from_string (std::string_view str)
 Convert a string to an floating point.
 
void terminate_handler () noexcept
 The HikoGUI terminate handler.
 
constexpr access_mode operator| (access_mode const &lhs, access_mode const &rhs) noexcept
 
constexpr access_mode operator& (access_mode const &lhs, access_mode const &rhs) noexcept
 
constexpr bool to_bool (access_mode const &rhs) noexcept
 
generator< std::filesystem::path > glob (glob_pattern pattern)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (std::string_view pattern)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (std::string pattern)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (char const *pattern)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (std::filesystem::path pattern)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (path_location location, std::filesystem::path ref)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (path_location location, std::string_view ref)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (path_location location, std::string ref)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (path_location location, char const *ref)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > get_paths (path_location location)
 Get a set of paths.
 
std::optional< std::filesystem::path > find_path (path_location location, std::filesystem::path const &ref) noexcept
 Find a path.
 
std::filesystem::path get_path (path_location location)
 Get the single and only path.
 
std::string_view to_string (gui_event_type rhs) noexcept
 Convert a GUI event type to a string.
 
constexpr gui_event_type to_gui_event_type (std::string_view name) noexcept
 Convert a name to a GUI event type.
 
constexpr gui_event_variant to_gui_event_variant (gui_event_type type) noexcept
 Convert a gui event type, to an gui event variant.
 
template<std::unsigned_integral T>
hi_force_inline constexpr T get_bit (T const *lhs, std::size_t index) noexcept
 Get a bit from an array of unsigned integers.
 
template<std::unsigned_integral T>
constexpr void set_bit (T *r, std::size_t index, T value=T{1}) noexcept
 Set a bit from an array of unsigned integers.
 
template<std::unsigned_integral T>
hi_force_inline constexpr std::pair< T, T > sll_carry (T lhs, std::size_t rhs, T carry=T{0}) noexcept
 Shift logical left with carry chain.
 
template<std::unsigned_integral T>
hi_force_inline constexpr std::pair< T, T > srl_carry (T lhs, std::size_t rhs, T carry=T{0}) noexcept
 Shift logical right with carry chain.
 
template<std::unsigned_integral T>
hi_force_inline constexpr std::pair< T, T > sra_carry (T lhs, std::size_t rhs) noexcept
 Shift arithmetic right with carry chain.
 
template<std::unsigned_integral T>
hi_force_inline constexpr std::pair< T, T > add_carry (T lhs, T rhs, T carry=T{0}) noexcept
 Add two numbers with carry chain.
 
template<std::unsigned_integral T>
hi_force_inline constexpr std::pair< T, T > mul_carry (T lhs, T rhs, T carry=T{0}, T accumulator=T{0}) noexcept
 Multiply with carry.
 
template<std::unsigned_integral T>
hi_force_inline constexpr T wide_div (T lhs_lo, T lhs_hi, T rhs) noexcept
 Wide divide.
 
template<std::unsigned_integral T>
hi_force_inline constexpr ssize_t bsr_carry_chain (T const *lhs, std::size_t n) noexcept
 Bit scan reverse.
 
template<std::unsigned_integral T>
hi_force_inline constexpr void invert_carry_chain (T *r, T const *rhs, std::size_t n) noexcept
 Invert unsigned integers using a carry-chain Technically this is not an carry chain.
 
template<std::unsigned_integral T>
hi_force_inline constexpr void sll_carry_chain (T *r, T const *lhs, std::size_t rhs, std::size_t n) noexcept
 shift logical right using a carry-chain
 
template<std::unsigned_integral T>
hi_force_inline constexpr void srl_carry_chain (T *r, T const *lhs, std::size_t rhs, std::size_t n) noexcept
 shift logical right using a carry-chain
 
template<std::unsigned_integral T>
hi_force_inline constexpr void sra_carry_chain (T *r, T const *lhs, std::size_t rhs, std::size_t n) noexcept
 shift arithmetic right using a carry-chain This sign-extends the left most bit.
 
template<std::unsigned_integral T>
hi_force_inline constexpr void and_carry_chain (T *r, T const *lhs, T const *rhs, std::size_t n) noexcept
 and-operation unsigned integers using a carry-chain
 
template<std::unsigned_integral T>
hi_force_inline constexpr void or_carry_chain (T *r, T const *lhs, T const *rhs, std::size_t n) noexcept
 or-operation unsigned integers using a carry-chain
 
template<std::unsigned_integral T>
hi_force_inline constexpr void xor_carry_chain (T *r, T const *lhs, T const *rhs, std::size_t n) noexcept
 xor-operation unsigned integers using a carry-chain
 
template<std::unsigned_integral T>
hi_force_inline constexpr bool eq_carry_chain (T const *lhs, T const *rhs, std::size_t n) noexcept
 
template<std::unsigned_integral T>
hi_force_inline constexpr bool ne_carry_chain (T const *lhs, T const *rhs, std::size_t n) noexcept
 
template<std::unsigned_integral T>
hi_force_inline constexpr std::strong_ordering cmp_unsigned_carry_chain (T const *lhs, T const *rhs, std::size_t n) noexcept
 
template<std::unsigned_integral T>
hi_force_inline constexpr std::strong_ordering cmp_signed_carry_chain (T const *lhs, T const *rhs, std::size_t n) noexcept
 
template<std::unsigned_integral T>
hi_force_inline constexpr bool lt_unsigned_carry_chain (T const *lhs, T const *rhs, std::size_t n) noexcept
 
template<std::unsigned_integral T>
hi_force_inline constexpr bool gt_unsigned_carry_chain (T const *lhs, T const *rhs, std::size_t n) noexcept
 
template<std::unsigned_integral T>
hi_force_inline constexpr bool ge_unsigned_carry_chain (T const *lhs, T const *rhs, std::size_t n) noexcept
 
template<std::unsigned_integral T>
hi_force_inline constexpr bool le_unsigned_carry_chain (T const *lhs, T const *rhs, std::size_t n) noexcept
 
template<std::unsigned_integral T>
hi_force_inline constexpr void neg_carry_chain (T *r, T const *rhs, std::size_t n) noexcept
 Negate unsigned integers using a carry-chain This is a two's compliment negate.
 
template<std::unsigned_integral T>
hi_force_inline constexpr void add_carry_chain (T *r, T const *lhs, T const *rhs, std::size_t n) noexcept
 Add unsigned integers using a carry-chain.
 
template<std::unsigned_integral T>
hi_force_inline constexpr void sub_carry_chain (T *r, T const *lhs, T const *rhs, std::size_t n) noexcept
 Subtract unsigned integers using a carry-chain.
 
template<std::unsigned_integral T>
hi_force_inline constexpr void mul_carry_chain (T *hi_restrict r, T const *lhs, T const *rhs, std::size_t n) noexcept
 Multiply unsigned integers using a carry-chain.
 
template<std::unsigned_integral T>
constexpr void div_carry_chain (T *hi_restrict quotient, T *hi_restrict remainder, T const *lhs, T const *rhs, std::size_t n) noexcept
 Divide unsigned integers using a carry-chain This function does a bit-wise division.
 
template<std::unsigned_integral T>
constexpr void signed_div_carry_chain (T *hi_restrict quotient, T *hi_restrict remainder, T const *lhs, T const *rhs, std::size_t n) noexcept
 signed divide unsigned integers using a carry-chain This function does a bit-wise division.
 
std::string get_last_error_message () noexcept
 Get the OS error message from the last error received on this thread.
 
template<typename Functor >
void process_call (Functor &&functor, std::string_view data)
 Call a function in a new process.
 
constexpr std::size_t operator""_uz (unsigned long long lhs) noexcept
 
constexpr std::size_t operator""_zu (unsigned long long lhs) noexcept
 
constexpr std::ptrdiff_t operator""_z (unsigned long long lhs) noexcept
 
template<typename T , typename U >
bool compare_store (T &lhs, U &&rhs) noexcept
 Compare then store if there was a change.
 
template<typename T , typename U >
bool compare_store (std::atomic< T > &lhs, U &&rhs) noexcept
 Compare then store if there was a change.
 
std::shared_ptr< button_delegatemake_default_radio_button_delegate (auto &&value, auto &&on_value) noexcept
 Make a shared pointer to a radio-button delegate.
 
std::shared_ptr< button_delegatemake_default_toggle_button_delegate (auto &&value, auto &&...args) noexcept
 Make a shared pointer to a toggle-button delegate.
 
std::shared_ptr< selection_delegatemake_default_selection_delegate (auto &&value, auto &&options, auto &&...off_value) noexcept
 Create a shared pointer to a default selection delegate.
 
std::shared_ptr< tab_delegatemake_default_tab_delegate (auto &&value) noexcept
 Create a shared pointer to a default tab delegate.
 
std::shared_ptr< text_delegatemake_default_text_delegate (auto &&value) noexcept
 Create a shared pointer to a default text delegate.
 
std::shared_ptr< text_field_delegatemake_default_text_field_delegate (auto &&value) noexcept
 Create a shared pointer to a default text delegate.
 

Variables

std::atomic< char const * > terminate_message = nullptr
 Message to show when the application is terminated.
 
std::terminate_handler old_terminate_handler
 The old terminate handler.
 
constexpr auto gui_event_type_metadata
 
log log_global
 

Detailed Description

The HikoGUI namespace.

Function Documentation

◆ add_carry()

template<std::unsigned_integral T>
hi_force_inline constexpr std::pair< T, T > hi::add_carry ( T lhs,
T rhs,
T carry = T{0} )
constexprnoexcept

Add two numbers with carry chain.

Parameters
lhsThe left hand side
rhsThe right hand side
carryFrom the previous add in the chain
Returns
(result, carry) pair

◆ add_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr void hi::add_carry_chain ( T * r,
T const * lhs,
T const * rhs,
std::size_t n )
constexprnoexcept

Add unsigned integers using a carry-chain.

Parameters
rThe result of the addition.
lhsThe left hand side operand of the addition.
rhsThe right hand side operand of the addition.
nThe number of digits of r, lhs and rhs.

◆ and_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr void hi::and_carry_chain ( T * r,
T const * lhs,
T const * rhs,
std::size_t n )
constexprnoexcept

and-operation unsigned integers using a carry-chain

Parameters
rThe result of the and-operation.
lhsThe left hand side operand of the and-operation.
rhsThe right hand side operand of the and-operation.
nThe number of digits of r, lhs and rhs.

◆ bsr_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr ssize_t hi::bsr_carry_chain ( T const * lhs,
std::size_t n )
constexprnoexcept

Bit scan reverse.

Parameters
lhsThe array of unsigned integers to find the highest set bit off.
nThe number of unsigned integers in the array.
Returns
index of leading one, or -1 when rhs is zero.

◆ div_carry_chain()

template<std::unsigned_integral T>
constexpr void hi::div_carry_chain ( T *hi_restrict quotient,
T *hi_restrict remainder,
T const * lhs,
T const * rhs,
std::size_t n )
constexprnoexcept

Divide unsigned integers using a carry-chain This function does a bit-wise division.

Note
quotient and remainder may not alias with lhs or rhs or with each other.
Parameters
quotientThe result of the division.
remainderThe remainder of the division.
lhsThe left hand side operand.
rhsThe right hand side operand.
nThe number of digits of quotient, remainder, lhs and rhs.

◆ get_bit()

template<std::unsigned_integral T>
hi_force_inline constexpr T hi::get_bit ( T const * lhs,
std::size_t index )
constexprnoexcept

Get a bit from an array of unsigned integers.

The integers are arranged in little-endian order.

Parameters
lhsThe array of integers from which to take the bit.
indexThe index of the bit
Returns
The value of the bit, either 0 or 1, with the same type as the integers of the array.

◆ invert_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr void hi::invert_carry_chain ( T * r,
T const * rhs,
std::size_t n )
constexprnoexcept

Invert unsigned integers using a carry-chain Technically this is not an carry chain.

Parameters
rThe result of the inversion.
rhsThe right hand side operand.
nThe number of digits of r and rhs.

◆ mul_carry()

template<std::unsigned_integral T>
hi_force_inline constexpr std::pair< T, T > hi::mul_carry ( T lhs,
T rhs,
T carry = T{0},
T accumulator = T{0} )
constexprnoexcept

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.

Parameters
lhsThe left hand side.
rhsThe right hand side.
carryThe carry-input; carry-output from the previous mul_carry().
accumulatorThe column value during a long multiply.
Returns
low, high of the result.

◆ mul_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr void hi::mul_carry_chain ( T *hi_restrict r,
T const * lhs,
T const * rhs,
std::size_t n )
constexprnoexcept

Multiply unsigned integers using a carry-chain.

Note
r May not alias with lhs or rhs.
Parameters
rThe result of the multiplication.
lhsThe left hand side operand.
rhsThe right hand side operand.
nThe number of digits of r, lhs and rhs.

◆ neg_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr void hi::neg_carry_chain ( T * r,
T const * rhs,
std::size_t n )
constexprnoexcept

Negate unsigned integers using a carry-chain This is a two's compliment negate.

Parameters
rThe result of the addition.
rhsThe left hand side operand of the addition.
nThe number of digits of r, lhs and rhs.

◆ or_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr void hi::or_carry_chain ( T * r,
T const * lhs,
T const * rhs,
std::size_t n )
constexprnoexcept

or-operation unsigned integers using a carry-chain

Parameters
rThe result of the and-operation.
lhsThe left hand side operand of the or-operation.
rhsThe right hand side operand of the or-operation.
nThe number of digits of r, lhs and rhs.

◆ set_bit()

template<std::unsigned_integral T>
constexpr void hi::set_bit ( T * r,
std::size_t index,
T value = T{1} )
constexprnoexcept

Set a bit from an array of unsigned integers.

The integers are arranged in little-endian order.

Parameters
rThe array of integers on which to set the bit.
indexThe index of the bit
valueThe value of the bit, either 0 or 1.

◆ signed_div_carry_chain()

template<std::unsigned_integral T>
constexpr void hi::signed_div_carry_chain ( T *hi_restrict quotient,
T *hi_restrict remainder,
T const * lhs,
T const * rhs,
std::size_t n )
constexprnoexcept

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.

Note
quotient and remainder may not alias with lhs or rhs or with each other.
Parameters
quotientThe result of the division.
remainderThe remainder of the division. The remainder has same sign as lhs.
lhsThe left hand side operand.
rhsThe right hand side operand.
nThe number of digits of quotient, remainder, lhs and rhs.

◆ sll_carry()

template<std::unsigned_integral T>
hi_force_inline constexpr std::pair< T, T > hi::sll_carry ( T lhs,
std::size_t rhs,
T carry = T{0} )
constexprnoexcept

Shift logical left with carry chain.

Parameters
lhsThe original value
rhsThe count by how much to shift lhs left.
carryThe carry data to or with the lower bits.
Returns
(result, carry); the carry which can be used to pass into the next iteration.

◆ sll_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr void hi::sll_carry_chain ( T * r,
T const * lhs,
std::size_t rhs,
std::size_t n )
constexprnoexcept

shift logical right using a carry-chain

Parameters
rThe result of the logical-shift-right.
lhsThe left hand side operand of the lsr.
rhsThe right hand side operand of the lsr, the number of bits to shift.
nThe number of digits of r, lhs and rhs.

◆ sra_carry()

template<std::unsigned_integral T>
hi_force_inline constexpr std::pair< T, T > hi::sra_carry ( T lhs,
std::size_t rhs )
constexprnoexcept

Shift arithmetic right with carry chain.

Parameters
lhsThe original value
rhsThe count by how much to shift lhs right.
Returns
(result, carry); the carry which can be used to pass into the next iteration.

◆ sra_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr void hi::sra_carry_chain ( T * r,
T const * lhs,
std::size_t rhs,
std::size_t n )
constexprnoexcept

shift arithmetic right using a carry-chain This sign-extends the left most bit.

Parameters
rThe result of the logical-shift-right.
lhsThe left hand side operand of the lsr.
rhsThe right hand side operand of the lsr, the number of bits to shift.
nThe number of digits of r, lhs and rhs.

◆ srl_carry()

template<std::unsigned_integral T>
hi_force_inline constexpr std::pair< T, T > hi::srl_carry ( T lhs,
std::size_t rhs,
T carry = T{0} )
constexprnoexcept

Shift logical right with carry chain.

Parameters
lhsThe original value
rhsThe count by how much to shift lhs right.
carryThe carry data to or with the lower bits.
Returns
(result, carry); the carry which can be used to pass into the next iteration.

◆ srl_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr void hi::srl_carry_chain ( T * r,
T const * lhs,
std::size_t rhs,
std::size_t n )
constexprnoexcept

shift logical right using a carry-chain

Parameters
rThe result of the logical-shift-right.
lhsThe left hand side operand of the lsr.
rhsThe right hand side operand of the lsr, the number of bits to shift.
nThe number of digits of r, lhs and rhs.

◆ sub_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr void hi::sub_carry_chain ( T * r,
T const * lhs,
T const * rhs,
std::size_t n )
constexprnoexcept

Subtract unsigned integers using a carry-chain.

Parameters
rThe result of the addition.
lhsThe left hand side operand of the addition.
rhsThe right hand side operand of the addition.
nThe number of digits of r, lhs and rhs.

◆ wide_div()

template<std::unsigned_integral T>
hi_force_inline constexpr T hi::wide_div ( T lhs_lo,
T lhs_hi,
T rhs )
constexprnoexcept

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.

Parameters
lhs_loThe low side of a wide left-hand-side
lhs_hiThe high side of a wide left-hand-side
rhsThe right hand side
Returns
The result.

◆ xor_carry_chain()

template<std::unsigned_integral T>
hi_force_inline constexpr void hi::xor_carry_chain ( T * r,
T const * lhs,
T const * rhs,
std::size_t n )
constexprnoexcept

xor-operation unsigned integers using a carry-chain

Parameters
rThe result of the and-operation.
lhsThe left hand side operand of the xor-operation.
rhsThe right hand side operand of the xor-operation.
nThe number of digits of r, lhs and rhs.