MGIS
Loading...
Searching...
No Matches
mgis::Context Struct Referencefinal

a class used to pass an execution context to most methods of MGIS and gather information (error, logs). More...

#include </home/runner/work/MFrontGenericInterfaceSupport/MFrontGenericInterfaceSupport/include/MGIS/Context.hxx>

Inheritance diagram for mgis::Context:
mgis::ErrorBacktrace mgis::AbstractErrorHandler

Public Member Functions

 Context () noexcept
 default constructor
 
 Context (const ContextInitializer &) noexcept
 constructor for an initializer
 
const VerbosityLevelgetVerbosityLevel () const noexcept
 
void setVerbosityLevel (const VerbosityLevel) noexcept
 change the level of verbosity
 
 ~Context () noexcept override
 destructor
 
- Public Member Functions inherited from mgis::ErrorBacktrace
InvalidResult registerErrorMessage (const char *const) override final
 register a new error message
 
InvalidResult registerErrorMessage (const ErrorReport) noexcept
 register a new error message
 
InvalidResult registerErrorMessageWithoutSourceLocation (const ErrorReport) noexcept
 register a new error message
 
void clearErrorMessages () noexcept
 remove the error messages
 
std::string getErrorMessage (const bool=true) noexcept
 
std::string getRawErrorMessage (const bool=true) noexcept
 
bool empty () const noexcept
 
 ~ErrorBacktrace () noexcept override
 destructor
 
- Public Member Functions inherited from mgis::AbstractErrorHandler
virtual constexpr ~AbstractErrorHandler ()=default
 destructor
 

Additional Inherited Members

- Public Types inherited from mgis::ErrorBacktrace
using ErrorReportFunction = std::string(*)(const int)
 brief a simple alias
 
using ErrorReport = std::variant< const char *, std::pair< int, ErrorReportFunction >, std::string >
 a simple alias listing the main way to report an error.
 
- Static Public Member Functions inherited from mgis::ErrorBacktrace
static void setErrorReportingAsFatal () noexcept
 specify if error reporting shall be fatal
 
static void unsetErrorReportingAsFatal () noexcept
 specify if error reporting shall be fatal
 

Detailed Description

a class used to pass an execution context to most methods of MGIS and gather information (error, logs).

The Context may be changed at various stage of the computation. For example, the verbosity level or the logging stream can be changed when calling a new model: this is can useful to debug a specific rm.

The default logging stream is the one returned by the mgis::getLogStream free function.

Constructor & Destructor Documentation

◆ Context() [1/2]

mgis::Context::Context ( )
noexcept

default constructor

The verbositiy level is initialized by calling the getDefaultVerbosityLevel function.

◆ Context() [2/2]

mgis::Context::Context ( const ContextInitializer )
noexcept

constructor for an initializer

Parameters
[in]iinitializer

Member Function Documentation

◆ getVerbosityLevel()

const VerbosityLevel & mgis::Context::getVerbosityLevel ( ) const
noexcept
Returns
the verbosity level

◆ setVerbosityLevel()

void mgis::Context::setVerbosityLevel ( const VerbosityLevel  )
noexcept

change the level of verbosity

Parameters
[in]lthe new verbose level

The documentation for this struct was generated from the following file: