nw::kernel::Services

struct Services

Public Functions

Services()
void set_module_loading(bool value)

Sets that a module is loading.

void create()

Creates services.

void start()

Initializes kernel services.

void shutdown()

Shutsdown kernel services.

GameProfile *profile() const

Gets current game profile.

template<typename T>
T *add()

Adds a service.

template<typename T>
const T *get() const

Gets a service.

template<typename T>
T *get_mut()

Gets a service as non-const.

Friends

friend GlobalMemory *global_allocator()

Gets global allocator.

friend void set_game_profile(GameProfile*)

Sets game profile. Must be called before nw::kernel::services().start();

Note

Caller retains ownerserhip of profile.

friend Module *load_module(const std::filesystem::path &path, bool instantiate)

Loads a module If instantiate is false, no areas are loaded and Service::initialize at module_post_instantiation is not called.

friend nlohmann::json stats()

Logs service stats.

friend void unload_module()

Unloads currently active module.