Class for a single-instance object providing useful information ans services. More...
#include <eagine/main_ctx.hpp>
Public Member Functions | |
main_ctx (main_ctx &&)=delete | |
Not move constructible. | |
main_ctx (const main_ctx &)=delete | |
Not copy constructible. | |
auto | operator= (main_ctx &&)=delete |
Not move assignable. | |
auto | operator= (const main_ctx &)=delete |
Not copy asignable. | |
auto | instance_id () const noexcept -> process_instance_id_t |
Returns this process instance id. Not equal to system PID. | |
auto | preinitialize () noexcept -> main_ctx & |
Does potentially expensive initialization and caching. | |
auto | build () const noexcept -> const build_info & |
Returns a reference to build information instance. | |
auto | args () noexcept -> program_args & |
Returns a reference to program arguments wrapper. | |
auto | log () noexcept -> logger & |
Returns a reference to the root logger object. | |
auto | watchdog () noexcept -> process_watchdog & |
Returns a reference to process watchdog object. | |
auto | config () noexcept -> application_config & |
Returns a reference to application config object. | |
auto | system () noexcept -> system_info & |
Returns a reference to system information object. | |
auto | user () noexcept -> user_info & |
Returns a reference to user information object. | |
auto | scratch_space () noexcept -> memory::buffer & |
Returns a reference to shared temporary buffer. | |
auto | compressor () noexcept -> data_compressor & |
Returns a reference to shared data compressor object. | |
auto | exe_path () const noexcept -> string_view |
Returns the executable path. | |
auto | app_name () const noexcept -> string_view |
Returns the application name. | |
Static Public Member Functions | |
static auto | get () noexcept -> main_ctx & |
Returns the single instance. | |
Class for a single-instance object providing useful information ans services.
A single instance of this class is initialized in the main function and constructs several useful utility service objects that can be shared throughout the system.