Consolix
Loading...
Searching...
No Matches
application_utils.hpp File Reference

Utility functions for managing application lifecycle and components. More...

Go to the source code of this file.

Namespaces

namespace  consolix
 < Utility modules and helpers.
 

Macros

#define _CONSOLIX_APPLICATION_UTILS_HPP_INCLUDED
 

Functions

void consolix::init ()
 Initializes the application. This function prepares the application and service locator for use.
 
template<typename InitAction>
void consolix::init (InitAction init_action)
 Initializes the application with a custom action. This function prepares the application and service locator, and executes a custom action during initialization.
 
template<typename Component, typename... Args>
std::shared_ptr< Component > consolix::add (Args &&... args)
 Adds a new component to the application. Creates a new instance of the specified component type and adds it to the application.
 
void consolix::add (std::shared_ptr< IAppComponent > component)
 Adds an existing component to the application. Registers a pre-existing component with the application.
 
void consolix::run ()
 Runs the application. Processes all components in the application's main loop.
 
template<typename IterationAction>
void consolix::run (IterationAction iteration_action)
 Runs the application with a custom loop action.
 
void consolix::stop ()
 Stops the application. Stops the application's main loop and begins the shutdown process.
 

Detailed Description

Utility functions for managing application lifecycle and components.

Example usage of application utilities.

// Add logo component to display the application logo at startup.
// Load configuration from a JSON file.
// Add the custom loop component.
// Start the application and run all components.
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.

Definition in file application_utils.hpp.

Macro Definition Documentation

◆ _CONSOLIX_APPLICATION_UTILS_HPP_INCLUDED

#define _CONSOLIX_APPLICATION_UTILS_HPP_INCLUDED

Definition at line 3 of file application_utils.hpp.