Consolix
Toggle main menu visibility
Loading...
Searching...
No Matches
application_utils.hpp
Go to the documentation of this file.
1
#pragma once
2
#ifndef _CONSOLIX_APPLICATION_UTILS_HPP_INCLUDED
3
#define _CONSOLIX_APPLICATION_UTILS_HPP_INCLUDED
4
23
24
namespace
consolix
{
25
28
inline
void
init
() {
29
ServiceLocator::get_instance
();
30
ConsoleApplication::get_instance
().
init
();
31
}
32
37
template
<
typename
InitAction>
38
inline
void
init
(InitAction init_action) {
39
ServiceLocator::get_instance
();
40
ConsoleApplication::get_instance
().
init
(init_action);
41
}
42
49
template
<
typename
Component,
typename
... Args>
50
inline
std::shared_ptr<Component>
add
(Args&&... args) {
51
return
ConsoleApplication::get_instance
().
add
<Component>(std::forward<Args>(args)...);
52
}
53
57
inline
void
add
(std::shared_ptr<IAppComponent> component) {
58
ConsoleApplication::get_instance
().
add
(std::move(component));
59
}
60
63
inline
void
run
() {
64
ConsoleApplication::get_instance
().
run
();
65
}
66
72
template
<
typename
IterationAction>
73
inline
void
run
(IterationAction iteration_action) {
74
ConsoleApplication::get_instance
().
run
(iteration_action);
75
}
76
79
inline
void
stop
() {
80
ConsoleApplication::get_instance
().
stop
();
81
}
82
83
};
// namespace consolix
84
85
#endif
// _CONSOLIX_APPLICATION_UTILS_HPP_INCLUDED
consolix::ConsoleApplication::add
std::shared_ptr< Component > add(Args &&... args)
Adds a new component to the application.
Definition
ConsoleApplication.hpp:41
consolix::ConsoleApplication::run
void run()
Runs the application with the registered components.
Definition
ConsoleApplication.hpp:82
consolix::ConsoleApplication::get_instance
static ConsoleApplication & get_instance()
Retrieves the singleton instance of the application.
Definition
ConsoleApplication.hpp:30
consolix::ConsoleApplication::init
void init()
Initializes the application and its components. This method initializes all components in the manager...
Definition
ConsoleApplication.hpp:53
consolix::ConsoleApplication::stop
void stop()
Stops the application's main loop.
Definition
ConsoleApplication.hpp:103
consolix::ServiceLocator::get_instance
static ServiceLocator & get_instance()
Retrieves the singleton instance of the ServiceLocator.
Definition
ServiceLocator.hpp:34
consolix
< Utility modules and helpers.
Definition
BaseLoopComponent.hpp:13
consolix::add
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...
Definition
application_utils.hpp:50
consolix::run
void run()
Runs the application. Processes all components in the application's main loop.
Definition
application_utils.hpp:63
consolix::init
void init()
Initializes the application. This function prepares the application and service locator for use.
Definition
application_utils.hpp:28
consolix::stop
void stop()
Stops the application. Stops the application's main loop and begins the shutdown process.
Definition
application_utils.hpp:79
include
consolix
core
application_utils.hpp
Generated by
1.17.0