options.h File Reference

Configuration variables to control configurable aspects of wreport's behaviour. More...

`#include <cstdint>`

Go to the source code of this file.

## Data Structures

struct | wreport::options::DomainErrorHook
| Interface for a callback hook system to delegate handling domain errors to the code using wreport. More...
struct | wreport::options::LocalOverride< T, T1 >
| Temporarily override a variable while this object is in scope. More...

## Namespaces

namespace | wreport
| String functions.

## Macros

#define | WREPORT_OPTIONS_HAS_VAR_CLAMP_DOMAIN_ERRORS
| Newly introduced options get a way for code to test for their existance.
#define | WREPORT_OPTIONS_HAS_VAR_HOOK_DOMAIN_ERRORS

## Variables

bool | wreport::options::var_silent_domain_errors
| Whether domain errors on Var assignments raise exceptions.
bool | wreport::options::var_clamp_domain_errors
| Whether domain errors on Var assignments raise exceptions.
DomainErrorHook * | wreport::options::var_hook_domain_errors
| If set, delegate handling domain errors to this object.

## Detailed Description

Configuration variables to control configurable aspects of wreport's behaviour.

Variables are global and thread_local. They are global because they are consulted in performance-critical code like Var::seti, and they are thread_local so that a thread that changes its own configuration does not affect the others.

LocalOverride can be used to perform configuration changes for the duration of a scope. Note that if while the override is active you pass control to an unrelated part of the code which also uses wreport, the behaviour of that code is also changed.

## Variable Documentation

## var_clamp_domain_errors

bool wreport::options::var_clamp_domain_errors

extern thread_local

Whether domain errors on Var assignments raise exceptions.

If true, domain errors on variable assignments are silent, and the target variable gets set to the minimum or maximum extreme value of the domain corresponding to the direction the value is overflowing.

## var_hook_domain_errors

DomainErrorHook* wreport::options::var_hook_domain_errors

extern thread_local

If set, delegate handling domain errors to this object.

Other than calling the hook functions, setting an out-of-domain value will do nothing. The object will have responsibility for setting or unsetting the Var as needed.

## var_silent_domain_errors

bool wreport::options::var_silent_domain_errors

extern thread_local

Whether domain errors on Var assignments raise exceptions.

If true, domain errors on variable assignments are silent, and the target variable gets set to undefined. If false (default), error_domain is raised.