|
HikoGUI
A low latency retained GUI
|
#include <ttauri/error_info.hpp>
Public Member Functions | |
| error_info (source_location location) noexcept | |
| Open an error info transaction. | |
| error_info (bool reopen) noexcept | |
| Reopen a error info transaction. | |
| error_info (error_info &&rhs) noexcept=delete | |
| error_info & | operator= (error_info &&rhs) noexcept=delete |
| error_info (error_info const &rhs)=delete | |
| error_info & | operator= (error_info const &rhs)=delete |
| template<basic_fixed_string Tag, typename Arg > | |
| error_info & | set (Arg &&value) noexcept |
| Set an information for a given tag. | |
Static Public Member Functions | |
| static void | close () noexcept |
| Close the current transaction. | |
| template<typename ValueType , basic_fixed_string Tag> | |
| static std::optional< ValueType > | pop () noexcept |
| Destructive read data from the current transaction. | |
| template<typename ValueType , basic_fixed_string Tag> | |
| static std::optional< ValueType > | peek () noexcept |
| Non-destructive read data from the current transaction. | |
| static std::string | string () noexcept |
| Return the list of entries with their current set value. | |
Error information passed alongside an error code or exception.
Example:
|
inlinenoexcept |
Open an error info transaction.
A transaction may only be opened when the error_info is in idle state; just before throwing an exception.
|
inlinenoexcept |
Reopen a error info transaction.
A closed transaction may be reopened to add more information to a thrown exception. Used when (re-)throwing an exception from a catch block.
| reopen | True when reopening an error_info transaction. Must be set to true. |
|
inlinestaticnoexcept |
Close the current transaction.
After the transaction is closed it can no longer be reopened or written to.
This function should be called in a non-throwing catch block, either directly or through the usage of error_info::pop or to_string(std::exception &e, bool)
|
inlinestaticnoexcept |
Non-destructive read data from the current transaction.
This function will NOT close the current transaction.
| Tag | a struct type used as an identifier. This struct type should have a public typedef of value_type for the value returned by this function. |
|
inlinestaticnoexcept |
Destructive read data from the current transaction.
This function will close the current transaction. Continued pop() and peek() calls will still be able to read from the current, but closed, transaction.
| Tag | a struct type used as an identifier. This struct type should have a public typedef of value_type for the value returned by this function. |
|
inlinenoexcept |
Set an information for a given tag.
You can chain multiple .set() calls.
| Tag | a struct type used as an identifier. This struct type should have a public typedef of value_type for the value set in this function. |
| value | The value to set. |
|
inlinestaticnoexcept |
Return the list of entries with their current set value.