Application Framework

Application Lifecycle

See Choosing an Application Design for the function-based, event-driven, procedural, command-style, and application-part designs supported by this lifecycle.

run() initializes the application, registers options, and parses the command line. After successful parsing it calls handleCommandLineOptions(values), forwards the values to prepared application parts, and calls main(). The hook receives non-null parsed values and does nothing by default. Help, version output, module overview, and parsing errors skip both the hook and main().

Override handleCommandLineOptions() to validate paths, apply configuration, or queue work that depends on parsed values while retaining the default main dispatch. That dispatch selects an option-module main function, then a function installed through setMainFn(), and otherwise starts registered parts and enters the main event loop. Override parseCommandLine() only to replace the parsing behavior itself. Exceptions from the hook use the same reporting and cleanup boundary as other lifecycle methods.

Application retains non-owning access to the original narrow or wide argv vector supplied to its constructor. After option parsing, every suffix reported as sensitive text is overwritten in place with one star per existing byte or code unit. The terminating null and native buffer size are preserved. Its converted CommandLineArguments list uses exactly five stars for each sensitive value. Masking occurs for successful parsing and parser or validator errors.

The native pointers must remain valid for the application lifetime. This cleanup only reduces secrets retained in process memory; it cannot retract command-line values already exposed through process listings, the shell, operating-system facilities, logs, or earlier application code.

Final application destruction flushes both standard output streams after log and terminal cleanup, even when no terminal was enabled. This drains writes queued on I/O workers before process teardown can discard them. Each stream is flushed independently using its configured timeout; a flush failure does not prevent cleanup of the other stream or escape the application destructor.

Terminal Output

enableTerminal(flags) creates and initializes an application-owned terminal with an initial size of 80×25. enableTerminal(size, flags) supplies an explicit size. Native backends detect the available screen; TerminalFlag::VirtualTty preserves the supplied dimensions and emits ANSI through stdout even when redirected. Repeated calls leave the enabled terminal and its settings unchanged.

Interactive and virtual terminals route Core’s standard output through the terminal with default colors and standard error in bright red. The application restores the screen and standard-stream routing during cleanup. Customize construction through createAndInitializeTerminal(size, flags) while preserving the requested settings. See Terminal Interface for virtual input and screen dimensions.

Service Ownership

The public application() function provides access to the current application and creates a temporary application when called before explicit construction. Construct your application before configuring its services so their setup follows a clear lifecycle.

Accepted background operations retain the services they need until their native work finishes, including after the application object is destroyed. This keeps protected-memory access and secure randomness associated with the originating application. It does not extend the lifetime of references to the public application object. Resource loaders and HTTP resource handlers retain their resource provider independently; see Text Documents and Rendering and HTTP Server.

Service Lifecycle

enableServiceLifecycle() lets the same executable run interactively, as a foreground POSIX daemon, or as a Windows own-process service. On Linux and macOS, SIGTERM and SIGINT request the regular graceful application shutdown. On Windows, the application connects to the Service Control Manager when launched as a service and otherwise continues as an interactive console application. SCM stop and shutdown controls and interactive Ctrl+C or Ctrl+Break requests use the same application-part and event-loop shutdown path.

Startup is reported as complete immediately before main work begins. A slow initializer can call reportStartupPending(expectedTime) before that point and publish genuine progress with additional calls. It must call reportStartupComplete() when the application is ready. The default application-part lifecycle automatically keeps startup pending until all automatically started parts reach the running state.

See Creating Services and Foreground Daemons for complete examples and lifecycle details.

Application Parts

Application parts are dependency-aware, one-shot components with dedicated event threads. The detached ApplicationPartManager owns their graph and runtime, while Application can provide the same manager as a lazy application service. See Building an Application from Parts for application integration, Designing Application Parts for part design and lifecycle guidance, and Running Application Parts Independently for standalone manager operation.

Identifiers and Registration

ApplicationPartIdentifier stores a stable, case-sensitive name. A manager resolves identifiers by name, so separately created identifiers with identical names address the same registered part. The manager rejects invalid dependency graphs before constructing any part.

ApplicationPartIdentifierPtr and ApplicationPartIdentifierList provide the shared identifier and dependency list aliases. ApplicationPartPtr, ApplicationPartManagerPtr, ApplicationPartManagerAccessPtr, and ApplicationPartManagerAccessWeakPtr provide the corresponding ownership aliases.

Part Interfaces

ApplicationPart provides lifecycle hooks, command-line forwarding, the dedicated event target, and read-only manager access. Public service interfaces publish the same static identifier and can be combined with the implementation through ApplicationPartWithInterface.

Manager Access and Lifecycle

ApplicationPartManagerAccess provides thread-safe state, wait, and prepared-part lookup operations. The mutable manager interface adds registration, preparation, command-line forwarding, asynchronous lifecycle requests, callbacks, and ordered error retrieval.

Manager and part state callbacks execute on the manager’s control event source. Every started part receives a separate event thread. Dependencies gate startup and reverse the shutdown order. State observers are independent subscriptions. Retain the EventSubscription returned by events().addStateChanged() or events().addPartStateChanged() for as long as the observer shall remain active.

Compiled Resources

Application::resources() lazily creates the read-only compiled resource manager. The manager indexes statically linked descriptors on first access and caches decoded data and text independently. An application with no compiled descriptors receives an empty manager. See Compiling Resources into an Application or Library for CMake integration and lookup examples.

Logging

log() lazily creates the application-wide log manager, and logStream() returns its root stream. The application default routes information, warning, and error entries to its terminal-backed console writer. enableLastErrorDump() installs a retained-error writer that remains present across later configuration replacements. By default, final cleanup displays its nonempty snapshot only after a nonzero application exit code. Select LastErrorDumpMode::Always to display it after a successful run as well. The heading uses the application’s log.last_error_dump_title display-text entry. See Choosing a Logging Setup for routing, trace sections, and standalone managers.

Application-part shutdown timeout expiry is reported to the manager as ApplicationError and follows the configured part-error policy. The original error remains available through the manager’s error queue.

Interface

class Application

The core application framework.

You must create a single instance of this class or a derived class in your main() method.

Note

Important Information when using Erbsland Core under Windows in DLLs Be careful when creating a Windows application that static links Erbsland Core into DLLs that are used by the application. These DLLs do not automatically share the same Application instance. Create an exported not inlined method initializeMyDll(Application &app) in each DLL that used Erbsland Core, and call Application::linkWith(app) in this method. From main() call all these initialize...() methods of all DLLs that use Erbsland Core, just after creating the Application instance. Do not use application() or Application::instance() in static initialization in DLLs that link Erbsland Core.

Public Functions

Application()

Create an application without command line arguments.

Only create one instance, as the first action in your main() function.

Application(int argc, char *argv[])

Create an application from UTF-8 encoded command line arguments.

Only create one instance, as the first action in your main() function.

Application(int argc, wchar_t *argv[])

Create an application from wide command line arguments.

Only create one instance, as the first action in your main() function.

virtual ~Application()

Destroys the application after its lifecycle has completed.

void enableTerminal(cterm::TerminalFlags flags = {})

Enable advanced terminal output with automatic lifecycle and standard-stream routing.

See: Application Framework

Parameters:

flags – Terminal backend flags; ignored if the terminal is already enabled.

void enableTerminal(block::Size size, cterm::TerminalFlags flags = {})

Enable terminal output with an explicit initial screen size.

Parameters:
  • size – Initial size, retained when native detection is unavailable or virtual mode is selected.

  • flags – Terminal backend flags; repeated calls do not change an enabled terminal.

void enableServiceLifecycle()

Enable foreground-daemon and Windows service lifecycle integration.

Call this after construction and before run(). Repeated calls are ignored.

void reportStartupPending(time::TimeDelta expectedRemainingTime)

Report that startup is still in progress.

This disables automatic readiness until reportStartupComplete() is called. Repeated calls report progress. Requires enabled service lifecycle support and startup that has not yet completed.

Parameters:

expectedRemainingTime – Positive expected time until startup completes.

void reportStartupComplete()

Report that application startup completed.

This operation is idempotent. Requires enabled service lifecycle support.

int run()

Run the default application lifecycle.

This is calling the application methods in the following order:

  • initialize()

  • registerCommandLineOptions()

  • parseCommandLine()

  • handleCommandLineOptions() (only after successful parsing)

  • main() (only after successful parsing)

  • cleanup() Exceptions thrown from callbacks in the automatically managed main event loop use the same boundary. If any err::Exception is thrown from one of these methods or callbacks, it will be handled by calling cleanup() first, then printing the error to stdErr() and exiting the application with an exit code of 1. In case of an core::ApplicationError, the exit code from the exception will be used. Any non-err::Exception propagates out of this method.

void setInitializeFn(InitializeFn initializeFn)

Set the function called by the default initialize() implementation.

Use this to customize initialization without deriving from Application. A derived initialize() override must call Application::initialize() to invoke this function.

void setMainFn(MainFn mainFn)

Override the main function.

Use this to set a custom main function without deriving from Application.

const options::OptionsPtr &options() const noexcept

Get the global options configuration.

void releaseOptions() noexcept

Release the option configuration to free memory after startup.

ApplicationInfo &info() noexcept

Get mutable application information.

const ApplicationInfo &info() const noexcept

Get application information.

const CommandLineArguments &commandLineArguments() const noexcept

Get the converted command line arguments.

const options::OptionValuesPtr &optionValues() const noexcept

Get the option values.

ApplicationPartManagerPtr partManager()

Access the lazily created application-part manager.

template<ApplicationPartClass T>
inline void registerPart()

Register an application-part class before run().

Template Parameters:

T – The concrete application-part class.

template<ApplicationPartInterface T>
inline std::shared_ptr<T> part()

Access a prepared application part through its interface.

Template Parameters:

T – The abstract part interface.

Returns:

The prepared part implementing T.

random::Random &random()

Get the shared random generator for non-security use.

random::Random &secureRandom()

Get the shared secure random generator.

cryptology::CryptologyConfiguration &cryptologyConfiguration()

Get the shared cryptology configuration, creating it on first use.

log::LogManager &log()

Access the lazily created application log manager.

The first access installs the default information, warning, and error console route.

Returns:

The application-owned manager, which remains valid until application cleanup.

const log::LogStreamPtr &logStream()

Access the root application log stream.

This method lazily creates the same manager as log().

Returns:

The root producer stream of the application log manager.

void enableLastErrorDump(LastErrorDumpMode mode = LastErrorDumpMode::OnFailure)

Enable retaining and conditionally displaying recent error entries during final application cleanup.

The writer remains persistent across later logging configuration replacements. Repeated calls update the display mode without installing another writer.

Parameters:

mode – Select whether a nonempty snapshot is displayed only after failure or after every run.

i18n::DisplayTextPtr displayText() const

Access the application display texts. The returned pointer is always non-null.

system::UserLookup &userLookup()

Get the shared user and group lookup service.

const resource::Resources &resources()

Access the lazily initialized compiled-resource manager.

const cterm::TerminalPtr &terminal() const

Access the application-shared terminal instance.

Must be enabled via enableTerminal().

const cterm::TerminalDocumentStyle &systemOutputStyle() const noexcept

Get the style used for application-rendered system output.

void setSystemOutputStyle(cterm::TerminalDocumentStyle style) noexcept

Set the style used for application-rendered system output.

event::EventsPtr events()

Access the target interface of the main event loop.

Use these events to post/schedule events and calls that shall run in the main thread.

event::EventRegistry &eventRegistry()

Access the event registry.

event::ManagedEventThreadPtr createEventThread(const event::EventLoopOptions &options = {})

Create a managed event thread.

Parameters:

options – Capacity and default error policies, copied into the loop. The policies must be valid.

Returns:

The new, unstarted event thread.

void quit(unit::ExitCode exitCode = unit::ExitCode::success()) noexcept

Quit the main event loop, and the event loops of all registered threads.

Public Static Functions

static Application &instance()

Get the application instance.

static void linkWith(Application &app)

Link this application instance with another one.

Only call this method from initializeMyDll(Application &app) methods in DLLs that static link Erbsland Core to synchronize the singleton across DLL borders.

static unit::Version libraryVersion() noexcept

Get the build-time library version.

static text::String libraryVersionText() noexcept

Get the build-time library version text.

Application &erbsland::core::application()

Access the global application instance, creating a default one on first use.

class ApplicationError : public erbsland::err::RuntimeError

A generic application error that is meant to terminate a running application with the given message and exit code.

Public Functions

inline explicit ApplicationError(ApplicationErrorContext context, const std::exception_ptr &cause = {}) noexcept

Create an application error with the given context.

Parameters:
  • context – The context with error details.

  • cause – The diagnostic cause.

inline explicit ApplicationError(text::String title, text::String description, const unit::ExitCode exitCode, const std::exception_ptr &cause = {}) noexcept

Create an application error with the given title, description and exit-code.

Parameters:
  • title – The title for this error (what went wrong?).

  • description – A description of the error (why went it wrong?)

  • exitCode – The exit code to use when terminating the application.

  • cause – The diagnostic cause.

inline explicit ApplicationError(text::String title, text::String description, const std::exception_ptr &cause = {}) noexcept

Create an application error with the given title and exit-code.

Parameters:
  • title – The title for this error (what went wrong?).

  • description – A description of the error (why went it wrong?)

  • cause – The diagnostic cause.

inline explicit ApplicationError(text::String title, const unit::ExitCode exitCode, const std::exception_ptr &cause = {}) noexcept

Create an application error with the given title and exit-code.

Parameters:
  • title – The title for this error (what went wrong?).

  • exitCode – The exit code to use when terminating the application.

  • cause – The diagnostic cause.

inline explicit ApplicationError(text::String title, const std::exception_ptr &cause = {}) noexcept

Create an application error with the given title and cause.

Parameters:
  • title – The title for this error (what went wrong?).

  • cause – The diagnostic cause.

virtual err::DiagnosticConstPtr diagnostic() const override

Convert the error with all its details into a structured diagnostic.

inline const text::String &title() const noexcept

Get the title of the error.

inline const text::String &description() const noexcept

Get the description of the error.

inline const text::String &sourceName() const noexcept

Get the name of the source that caused the error.

inline const text::String &sourcePath() const noexcept

Get the path of the source that caused the error.

inline unit::CodeLocation codeLocation() const noexcept

Get the code location of the source that caused the error.

inline unit::ExitCode exitCode() const noexcept

Get the exit code to end the application.

inline const ApplicationErrorContext &context() const noexcept

Get the error context.

ApplicationError withTitle(text::String title, bool overwriteExisting = false) const noexcept

Add or replace the title of the error with a new one.

Parameters:
  • title – The new title to use when missing or to replace an existing one.

  • overwriteExisting – Whether to overwrite an existing title. true replaces any existing title.

Returns:

A new instance with the updated title

auto withDescription(text::String description, bool overwriteExisting = false) const noexcept -> ApplicationError

Add or replace the description of the error with a new one.

Parameters:
  • description – The new description to use when missing or to replace an existing one.

  • overwriteExisting – Whether to overwrite an existing description. true replaces any existing description.

Returns:

A new instance with the updated description

auto withSourceName(text::String sourceName, bool overwriteExisting = false) const noexcept -> ApplicationError

Add or replace the name of the source that caused the error with a new one.

Parameters:
  • sourceName – The new source name to use when missing or to replace an existing one.

  • overwriteExisting – Whether to overwrite an existing source name. true replaces any existing source name.

Returns:

A new instance with the updated source name

auto withSourcePath(text::String sourcePath, bool overwriteExisting = false) const noexcept -> ApplicationError

Add or replace the path of the source that caused the error with a new one.

Parameters:
  • sourcePath – The new source path to use when missing or to replace an existing one.

  • overwriteExisting – Whether to overwrite an existing source path. true replaces any existing source path.

Returns:

A new instance with the updated source path

auto withCodeLocation(unit::CodeLocation codeLocation, bool overwriteExisting = false) const noexcept -> ApplicationError

Add or replace the code location of the source that caused the error with a new one.

Parameters:
  • codeLocation – The new code location to use when missing or to replace an existing one.

  • overwriteExisting – Whether to overwrite an existing code location. true replaces any existing code location.

Returns:

A new instance with the updated code location

auto withExitCode(unit::ExitCode exitCode, bool overwriteExisting = false) const noexcept -> ApplicationError

Add or replace the exit code to end the application with a new one.

Parameters:
  • exitCode – The new exit code to use when missing or to replace an existing one.

  • overwriteExisting – Whether to overwrite an existing exit code. true replaces any existing exit code.

Returns:

A new instance with the updated exit code

class ApplicationInfo

Optional application metadata used by command line rendering.

Public Functions

inline const text::String &applicationName() const noexcept

Get the application name.

inline void setApplicationName(text::String applicationName)

Set the application name.

inline const unit::Version &applicationVersion() const noexcept

Get the application version.

inline void setApplicationVersion(unit::Version applicationVersion) noexcept

Set the application version.

inline const text::String &authorName() const noexcept

Get the author or organization name.

inline void setAuthorName(text::String authorName)

Set the author or organization name.

inline const text::String &copyrightLine() const noexcept

Get the copyright line.

inline void setCopyrightLine(text::String copyrightLine)

Set the copyright line.

inline const text::String &licenseText() const noexcept

Get the license text.

inline void setLicenseText(text::String licenseText)

Set the license text.

class ApplicationPart : public erbsland::core::ApplicationPartCommandLine

Base class for an independently managed application component.

Lifecycle hooks run on the part’s dedicated event thread except automaticStart(), which runs on the manager control event source, and the command-line hooks, which run synchronously on their caller’s thread.

See: Application Framework

Subclassed by erbsland::core::ApplicationPartWithInterface< T >

Public Functions

inline ApplicationPartState state() const noexcept

Get the current lifecycle state.

ApplicationPartManagerAccess &partManager() const

Access the manager-local part registry.

The part must have been prepared by a manager.

event::EventsPtr events() const

Access this part’s event target.

The part must have started.

virtual void registerCommandLineOptions(const options::OptionsPtr &options) override

Register this part’s command-line options.

Parameters:

options – The shared application option definitions.

virtual void parseCommandLine(const options::OptionValuesPtr &values) override

Receive successfully parsed command-line values.

Parameters:

values – The parsed option values.

Public Static Functions

static inline ApplicationPartIdentifierList dependencies()

Return an empty dependency list.

using erbsland::core::ApplicationPartErrorHandler = std::function<ApplicationPartErrorAction(ApplicationPartIdentifierPtr identifier, std::exception_ptr error)>

A callback deciding how a manager handles a part failure.

using erbsland::core::ApplicationPartManagerStateChangedFn = std::function<void(ApplicationPartManagerState state)>

A callback observing manager state transitions.

using erbsland::core::ApplicationPartStateChangedFn = std::function<void(ApplicationPartIdentifierPtr identifier, ApplicationPartState state)>

A callback observing part state transitions.

class ApplicationPartCommandLine

Command-line lifecycle hooks implemented by application parts.

Subclassed by erbsland::core::ApplicationPart

Public Functions

virtual void registerCommandLineOptions(const options::OptionsPtr &options) = 0

Register this part’s command-line options.

Parameters:

options – The shared application option definitions.

virtual void parseCommandLine(const options::OptionValuesPtr &values) = 0

Receive successfully parsed command-line values.

Parameters:

values – The parsed option values.

enum class erbsland::core::ApplicationPartErrorAction : uint8_t

The manager action after an application-part failure.

Values:

enumerator Continue

Stop the failed branch and keep unrelated parts running.

enumerator StopAll

Stop every part and finish the manager in Failed state.

class ApplicationPartIdentifier

A stable, named identifier for an application part.

Identifier names are authoritative. Implementations may cache manager-local lookup information without exposing mutable state through this interface.

See: Application Framework

Subclassed by erbsland::core::impl::ApplicationPartIdentifier

Public Functions

virtual const text::String &name() const noexcept = 0

Get the stable identifier name.

inline text::String toString() const noexcept

Convert this identifier to text.

Public Static Functions

static ApplicationPartIdentifierPtr create(text::String name)

Create an application-part identifier.

Parameters:

name – A non-empty ASCII reverse-domain token of at most 200 characters using letters, digits, ., _, and -.

Returns:

A new identifier with no manager-local cache.

class ApplicationPartManager : public erbsland::core::ApplicationPartManagerAccess

A detached manager for dependency-aware application parts.

See: Application Framework

Subclassed by erbsland::core::impl::ApplicationPartManager

Public Functions

template<ApplicationPartClass T>
inline void registerPart()

Defer registration of an application-part class.

Must be called before preparation starts.

Template Parameters:

T – The concrete application-part class.

virtual void prepare() = 0

Validate registrations, construct all parts, and enter Ready.

virtual void registerCommandLineOptions(const options::OptionsPtr &options) = 0

Forward command-line option registration to prepared parts.

Parameters:

options – The shared option definitions.

virtual void parseCommandLine(const options::OptionValuesPtr &values) = 0

Forward successfully parsed command-line values to prepared parts.

Parameters:

values – The parsed option values.

virtual void start() = 0

Begin initial automatic startup asynchronously.

virtual void start(const ApplicationPartIdentifierPtr &identifier) = 0

Start a part and its inactive dependency closure asynchronously.

Parameters:

identifier – The part to start.

virtual void stop(const ApplicationPartIdentifierPtr &identifier) = 0

Stop a part and its active dependent closure asynchronously.

Parameters:

identifier – The part to stop.

virtual void stop() = 0

Stop all parts asynchronously.

virtual ApplicationPartManagerEventEditor &events() noexcept = 0

Access the stable manager-owned lifecycle event editor.

virtual void setErrorHandler(ApplicationPartErrorHandler handler) = 0

Set the part-error policy callback.

virtual bool hasError() const noexcept = 0

Test whether an error is queued.

virtual std::exception_ptr takeError() noexcept = 0

Take the oldest queued error.

Public Static Functions

static ApplicationPartManagerPtr create(event::EventsPtr controlEvents = {})

Create a detached application-part manager.

If controlEvents is null, the manager creates and owns a dedicated control event thread.

Parameters:

controlEvents – Optional externally owned control event target.

Returns:

A new application-part manager.

class ApplicationPartManagerAccess

Thread-safe read and wait access to an application-part manager.

See: Application Framework

Subclassed by erbsland::core::ApplicationPartManager

Public Functions

virtual ApplicationPartManagerState state() const noexcept = 0

Get the manager lifecycle state.

virtual auto partState(const ApplicationPartIdentifierPtr &identifier) const -> ApplicationPartState = 0

Get one part’s lifecycle state.

The manager must be prepared.

Parameters:

identifier – The part identifier to resolve by name. Must identify a registered part.

Returns:

The current part state.

virtual bool waitForRunning() = 0

Wait until the manager runs or reaches a terminal state.

Returns:

true if Running was reached; false for terminal failure or shutdown.

virtual bool waitForStopped() = 0

Wait until the manager stops or fails.

Returns:

true for Stopped; false for Failed.

virtual bool waitForRunning(const ApplicationPartIdentifierPtr &identifier) = 0

Wait until one part runs or reaches a terminal state.

Parameters:

identifier – The part identifier to resolve by name.

Returns:

true if Running was reached; false for terminal failure or shutdown.

virtual bool waitForStopped(const ApplicationPartIdentifierPtr &identifier) = 0

Wait until one part stops or fails.

Parameters:

identifier – The part identifier to resolve by name.

Returns:

true for Stopped; false for Failed.

virtual ApplicationPartPtr part(const ApplicationPartIdentifierPtr &identifier) const = 0

Access one prepared part by identifier.

The manager must be prepared.

Parameters:

identifier – The part identifier to resolve by name. Must identify a registered part.

Returns:

The prepared application part.

template<ApplicationPartInterface T>
inline std::shared_ptr<T> part() const

Access one prepared part through its public interface.

The manager must be prepared, and the requested part must be registered and implement T.

Template Parameters:

T – The abstract part interface.

Returns:

The prepared part implementing T.

class ApplicationPartManagerEventEditor

Editor for application-part manager lifecycle observers.

The manager owns this stable editor. Each added callback remains active while its returned subscription is retained.

Subclassed by erbsland::core::impl::ApplicationPartManager

Public Functions

virtual auto addStateChanged(ApplicationPartManagerStateChangedFn callback) -> event::EventSubscription = 0

Add a manager-state observer.

Parameters:

callback – The callback invoked for later manager-state transitions.

Returns:

A subscription retaining the observer.

virtual auto addPartStateChanged(ApplicationPartStateChangedFn callback) -> event::EventSubscription = 0

Add a part-state observer.

Parameters:

callback – The callback invoked for later part-state transitions.

Returns:

A subscription retaining the observer.

enum class erbsland::core::ApplicationPartManagerState : uint8_t

The lifecycle state of an application-part manager.

Values:

enumerator Uninitialized

Parts may still be registered.

enumerator Ready

The graph and all part instances are prepared.

enumerator Starting

Automatic startup is in progress.

enumerator Running

Automatic startup settled.

enumerator Stopping

Complete manager shutdown is in progress.

enumerator Stopped

The manager completed normal shutdown.

enumerator Failed

The manager completed shutdown after a fatal failure.

enum class erbsland::core::ApplicationPartState : uint8_t

The lifecycle state of an application part.

Values:

enumerator Uninitialized

The part was prepared but not started.

enumerator Starting

The part thread is running startup hooks.

enumerator Running

The part completed startup.

enumerator Stopping

The part is performing graceful shutdown.

enumerator Stopped

The part completed a normal one-shot lifecycle.

enumerator Failed

The part completed its lifecycle after a failure.

template<typename T>
concept ApplicationPartInterface
#include <erbsland/core/ApplicationPartTraits.hpp>

A public interface that identifies its application part.

template<typename T>
concept ApplicationPartClass
#include <erbsland/core/ApplicationPartTraits.hpp>

A concrete class that can be registered as an application part.

template<ApplicationPartInterface T>
class ApplicationPartWithInterface : public erbsland::core::ApplicationPart, public erbsland::core::T

An application-part base implementing one public interface.

Template Parameters:

T – The abstract part interface.

using erbsland::core::CommandLineArguments = text::StringList

A list of command line arguments.

using erbsland::core::InitializeFn = std::function<void()>

A initialize function override for an application.

enum class erbsland::core::LastErrorDumpMode : uint8_t

Select when an enabled retained-error snapshot is displayed during final application cleanup.

Values:

enumerator OnFailure

Display retained errors only after a nonzero application exit code.

enumerator Always

Display retained errors after every application run.

using erbsland::core::MainFn = std::function<unit::ExitCode()>

A main function override for an application.