Summary
Implement a Bootstrapper to handle system initialization at the application level.
Tasks
1. SystemBootstrapper Class
class SystemBootstrapper {
public:
SystemBootstrapper& with_default_logger(LoggerFactory factory);
SystemBootstrapper& with_logger(std::string name, LoggerFactory factory);
SystemBootstrapper& on_initialize(std::function<void()> callback);
SystemBootstrapper& on_shutdown(std::function<void()> callback);
VoidResult initialize();
void shutdown();
};
2. Fluent API Design
3. RAII Support
Usage Example
SystemBootstrapper bootstrapper;
bootstrapper
.with_default_logger([] { return create_logger(); })
.with_logger("database", [] { return create_db_logger(); })
.on_initialize([] { LOG_INFO("System started"); })
.on_shutdown([] { LOG_INFO("System stopped"); });
auto result = bootstrapper.initialize();
Test Requirements
Related Milestone
Summary
Implement a Bootstrapper to handle system initialization at the application level.
Tasks
1. SystemBootstrapper Class
include/kcenon/common/bootstrap/system_bootstrapper.h2. Fluent API Design
3. RAII Support
Usage Example
SystemBootstrapper bootstrapper; bootstrapper .with_default_logger([] { return create_logger(); }) .with_logger("database", [] { return create_db_logger(); }) .on_initialize([] { LOG_INFO("System started"); }) .on_shutdown([] { LOG_INFO("System stopped"); }); auto result = bootstrapper.initialize();Test Requirements
Related Milestone