6 #ifndef KAGOME_APP_STATE_MANAGER 7 #define KAGOME_APP_STATE_MANAGER 11 #include <condition_variable> 60 std::condition_variable
cv_;
71 #endif // KAGOME_APP_STATE_MANAGER static std::weak_ptr< AppStateManager > wp_to_myself
std::queue< OnLaunch > launch_
~AppStateManagerImpl() override
void run() override
Start application life cycle.
std::function< bool()> OnLaunch
static void shuttingDownSignalsHandler(int)
AppStateManagerImpl & operator=(AppStateManagerImpl const &)=delete
State state() const override
Get current stage.
std::condition_variable cv_
void atShutdown(OnShutdown &&cb) override
Execute.
void atPrepare(OnPrepare &&cb) override
Execute.
std::shared_ptr< soralog::Logger > Logger
std::queue< OnPrepare > prepare_
std::atomic_bool shutdown_requested_
void atLaunch(OnLaunch &&cb) override
Execute.
void shutdown() override
Initiate shutting down (at any time)
std::atomic< State > state_
std::function< bool()> OnPrepare
void doPrepare() override
void doShutdown() override
std::queue< OnShutdown > shutdown_
std::recursive_mutex mutex_
std::function< void()> OnShutdown