Class Startup
Defined in File startup.h
Class Documentation
-
class Startup
Declaration:
finalRegisters command-line options and performs one synchronous initialization.
The object is not synchronized or movable. Initialize on the platform owner; returned contexts retain their backend’s lifetime and thread requirements.
Public Functions
-
explicit Startup(StartupBackend backend, std::string description = "Cheryl application", StartupOptions configuration = {})
Register engine and backend options without constructing the context.
A missing backend factory is rejected; callback failures propagate.
- Parameters:
backend – Owned callbacks, with a required context factory.
description – Application description used by command-line help.
configuration – Initial defaults before command-line overrides.
-
void add_application_options(const OptionDefinitions &definitions)
Register application options before initialization.
Definitions run immediately; values bound to the parser must survive initialize(). Empty definitions or registration after initialization fail.
- Parameters:
definitions – Callback receiving the application’s option group.
-
StartupResult initialize(int argc, const char *const *argv)
Declaration:
[[nodiscard]]Parse, validate and construct a context once on the platform owner.
Command-line help/errors and invalid configuration return without a context. Reuse and malformed argument arrays are rejected; other backend failures propagate.
- Parameters:
argc – Positive argument count, including the executable name.
argv – Nonnull array of argc nonnull argument strings.
- Returns:
An owned context and runtime policy, or an exit code without a context.
-
explicit Startup(StartupBackend backend, std::string description = "Cheryl application", StartupOptions configuration = {})