Consolix
Loading...
Searching...
No Matches
consolix::IShutdownable Class Referenceabstract

Interface for components supporting shutdown logic. More...

#include <IShutdownable.hpp>

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

Public Member Functions

virtual ~IShutdownable ()=default
 Virtual destructor for polymorphic use.

Protected Member Functions

virtual void shutdown (int signal)=0
 Handles shutdown logic for the component.

Friends

class AppComponentManager
 Grants access to the AppComponentManager class.

Detailed Description

Interface for components supporting shutdown logic.

This interface defines a method for handling shutdown events, which is particularly useful for releasing resources, saving state, or performing cleanup operations when a termination signal is received. The callback runs during the application's normal shutdown path rather than directly from a POSIX signal handler. Access to the shutdown method is restricted to the AppComponentManager class.

Definition at line 19 of file IShutdownable.hpp.

Constructor & Destructor Documentation

◆ ~IShutdownable()

virtual consolix::IShutdownable::~IShutdownable ( )
virtualdefault

Virtual destructor for polymorphic use.

Member Function Documentation

◆ shutdown()

virtual void consolix::IShutdownable::shutdown ( int signal)
protectedpure virtual

Handles shutdown logic for the component.

This method is called when the application enters shutdown. Derived components should implement this method to perform necessary cleanup or save state before termination. On POSIX, a signal may trigger this shutdown, but the callback itself still runs later in normal application code.

Parameters
signalThe shutdown signal (e.g., SIGINT or SIGTERM).

Implemented in consolix::BaseLoopComponent, and consolix::LoopComponent.

◆ AppComponentManager

friend class AppComponentManager
friend

Grants access to the AppComponentManager class.

Definition at line 20 of file IShutdownable.hpp.


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