Consolix
Loading...
Searching...
No Matches
CustomLoop Class Referencefinal

Custom loop component for the main application logic. More...

Inheritance diagram for CustomLoop:
consolix::BaseLoopComponent consolix::IAppComponent consolix::IShutdownable

Public Member Functions

virtual ~CustomLoop ()=default
 
bool on_once () override
 Called once at the start of the loop.
 
void on_loop () override
 Called repeatedly during the execution loop.
 
void on_shutdown (int signal) override
 Called during application shutdown.
 
- Public Member Functions inherited from consolix::BaseLoopComponent
 BaseLoopComponent ()=default
 Constructs a BaseLoopComponent.
 
virtual ~BaseLoopComponent ()=default
 Destroys the BaseLoopComponent.
 
- Public Member Functions inherited from consolix::IAppComponent
virtual ~IAppComponent ()=default
 Virtual destructor for polymorphic usage.
 
- Public Member Functions inherited from consolix::IShutdownable
virtual ~IShutdownable ()=default
 Virtual destructor for polymorphic use.
 

Additional Inherited Members

- Protected Member Functions inherited from consolix::BaseLoopComponent
bool initialize () override final
 Initializes the component.
 
bool is_initialized () const override final
 Checks if the component has been initialized.
 
void process () override final
 Executes the loop logic for the component.
 
void shutdown (int signal) override final
 Shuts down the component.
 

Detailed Description

Custom loop component for the main application logic.

This component handles application-specific logic in three stages:

  • Initialization (on_once).
  • Repeated execution (on_loop).
  • Graceful shutdown (on_shutdown).
Examples
example_application_main_loop.cpp.

Definition at line 26 of file example_application_main_loop.cpp.

Constructor & Destructor Documentation

◆ ~CustomLoop()

virtual CustomLoop::~CustomLoop ( )
virtualdefault

Member Function Documentation

◆ on_loop()

void CustomLoop::on_loop ( )
inlineoverridevirtual

Called repeatedly during the execution loop.

Implements consolix::BaseLoopComponent.

Examples
example_application_main_loop.cpp.

Definition at line 55 of file example_application_main_loop.cpp.

◆ on_once()

bool CustomLoop::on_once ( )
inlineoverridevirtual

Called once at the start of the loop.

Implements consolix::BaseLoopComponent.

Examples
example_application_main_loop.cpp.

Definition at line 32 of file example_application_main_loop.cpp.

◆ on_shutdown()

void CustomLoop::on_shutdown ( int signal)
inlineoverridevirtual

Called during application shutdown.

Parameters
signalThe shutdown signal.

Implements consolix::BaseLoopComponent.

Examples
example_application_main_loop.cpp.

Definition at line 74 of file example_application_main_loop.cpp.


The documentation for this class was generated from the following file: