2#ifndef _CONSOLIX_APPLICATION_UTILS_HPP_INCLUDED
3#define _CONSOLIX_APPLICATION_UTILS_HPP_INCLUDED
37 template <
typename InitAction>
38 void init(InitAction init_action) {
49 template <
typename Component,
typename... Args>
50 inline std::shared_ptr<Component>
add(Args&&... args) {
57 inline void add(std::shared_ptr<IAppComponent> component) {
72 template <
typename IterationAction>
73 inline void run(IterationAction iteration_action) {
std::shared_ptr< Component > add(Args &&... args)
Adds a new component to the application.
void run()
Runs the application with the registered components.
static ConsoleApplication & get_instance()
Retrieves the singleton instance of the application.
void init()
Initializes the application and its components. This method initializes all components in the manager...
void stop()
Stops the application's main loop.
static ServiceLocator & get_instance()
Retrieves the singleton instance of the ServiceLocator.
< Utility modules and helpers.
std::shared_ptr< Component > add(Args &&... args)
Adds a new component to the application. Creates a new instance of the specified component type and a...
void run()
Runs the application. Processes all components in the application's main loop.
void init()
Initializes the application. This function prepares the application and service locator for use.
void stop()
Stops the application. Stops the application's main loop and begins the shutdown process.