MGIS
Loading...
Searching...
No Matches
Config.hxx File Reference
#include <limits>
#include "MGIS/Config-c.h"

Classes

struct  mgis::attributes::UnsafeAttribute
 an attribute use to indicate that a method or a function as being unsafe without precautions More...
 
struct  mgis::attributes::ThrowingAttribute< bool >
 an attribute use to indicate that a method may throw or not More...
 

Namespaces

namespace  mgis
 the namespace mgis encloses all the MGIS project.
 

Typedefs

using mgis::size_type = mgis_size_type
 a simple alias to the the default indexing type used by mgis
 
using mgis::real = mgis_real
 alias to the numeric type used
 

Enumerations

enum struct  mgis::config::ContractViolationPolicy { ABORT , RAISE }
 policy used in case of contract violation
 
enum struct  mgis::config::ErrorReportPolicy { INVALIDRESULT , RAISE , ABORT }
 error reporting policy used by default when a Context is available.
 

Variables

constexpr auto mgis::config::contract_violation_policy
 variable stating which policy is used for reporting a contract violation
 
constexpr auto mgis::config::default_error_report_policy
 variable stating which policy is used by default for reporting a runtime error when using a context.
 
constexpr auto mgis::unsafe = attributes::UnsafeAttribute{}
 
constexpr auto mgis::throwing = attributes::ThrowingAttribute<true>{}
 
constexpr auto mgis::not_throwing = attributes::ThrowingAttribute<false>{}
 
constexpr size_type mgis::dynamic_extent
 a constant whose role is similar to std::dynamic_extent
 

Detailed Description

Author
Thomas Helfer
Date
19/06/2018

Variable Documentation

◆ contract_violation_policy

constexpr auto mgis::config::contract_violation_policy
inlineconstexpr
Initial value:
=
ContractViolationPolicy::ABORT

variable stating which policy is used for reporting a contract violation

By default, std::abort is called.

If MGIS_USE_EXCEPTIONS_FOR_CONTRACT_VIOLATION is defined mgis::raise is called.

◆ default_error_report_policy

constexpr auto mgis::config::default_error_report_policy
inlineconstexpr
Initial value:
=
ErrorReportPolicy::INVALIDRESULT

variable stating which policy is used by default for reporting a runtime error when using a context.

By default, error are reported by returning an invalid result and registring an error message in a context

If MGIS_USE_EXCEPTIONS_FOR_ERROR_REPORTING is defined, registring an error message in a context, mgis::raise is called

If MGIS_USE_ABORT_FOR_ERROR_REPORTING is defined, registring an error message in a context, the error message is printed an the standard error stream and std::abort is called.

Note
if setErrorReportingAsFatal is called, this policy is ignored as any error will lead to display the error message on the standard error stream and call std::abort.