libimgdoc2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
imgdoc2::IHostingEnvironment Class Referenceabstract

#include <IEnvironment.h>

Public Member Functions

virtual void Log (int level, const char *message)=0
 
virtual bool IsLogLevelActive (int level)=0
 
virtual void ReportFatalErrorAndExit (const char *message)=0
 
 IHostingEnvironment (const IHostingEnvironment &)=delete
 
IHostingEnvironmentoperator= (const IHostingEnvironment &)=delete
 
 IHostingEnvironment (IHostingEnvironment &&)=delete
 
IHostingEnvironmentoperator= (IHostingEnvironment &&)=delete
 

Detailed Description

In this class functionality "to be provided by a hosting environment" ist gathered. The prime example is "debug logging", which is a cross-cutting concern, and it is allowed to route debug print to the hosting environment.

Member Function Documentation

◆ IsLogLevelActive()

virtual bool imgdoc2::IHostingEnvironment::IsLogLevelActive ( int  level)
pure virtual

Queries if the specified log level is active. This method may be called concurrently. For possible values of the log level, see the constants "LogLevel".

Parameters
levelThe log level.
Returns
True if the log level is active, false if not.

◆ Log()

virtual void imgdoc2::IHostingEnvironment::Log ( int  level,
const char *  message 
)
pure virtual

This method is used for debug output. It may be called concurrently. For possible values of the log level, see the constants "LogLevel".

Parameters
levelThe log level (c.f. constants "LogLevel..." for possible values).
messageThe message text (in UTF8-encoding).

◆ ReportFatalErrorAndExit()

virtual void imgdoc2::IHostingEnvironment::ReportFatalErrorAndExit ( const char *  message)
pure virtual

Report fatal error and terminate the application. This is to be used for fatal error, where no recovery is possible. Obviously, this should be the last resort.

Parameters
messageThe message.

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