|
| constexpr | source_location (const char *file=__builtin_FILE(), const char *function=__builtin_FUNCTION(), int line=__builtin_LINE()) noexcept |
| |
| constexpr const char * | file_name () const noexcept |
| |
| constexpr const char * | function_name () const noexcept |
| |
| constexpr int | line () const noexcept |
| |
| constexpr int | column () const noexcept |
| |
| static constexpr source_location | current (const char *file=__builtin_FILE(), const char *function=__builtin_FUNCTION(), int line=__builtin_LINE()) noexcept |
| |
| | CircularBuffer ()=default |
| |
| bool | push (const T &value, bool overwrite=false) |
| | Push a value to the buffer.
|
| |
| bool | push (T &&value, bool overwrite=false) |
| |
| std::optional< T > | pop () |
| | Pop a value from the buffer.
|
| |
| bool | empty () const |
| |
| bool | full () const |
| |
| std::size_t | size () const |
| |
| constexpr std::size_t | capacity () const |
| |
| void | advance (std::size_t &index) noexcept |
| |
| bool | is_full_locked () const noexcept |
| |
| std::optional< T > | pop_locked () |
| |
| void | operator() (T *ptr) const noexcept |
| |
| | ObjectPool (std::size_t growth=32) |
| |
| template<typename... Args> |
| std::unique_ptr< T, std::function< void(T *)> > | acquire (bool *reused, Args &&... args) |
| | Acquire an object constructed with the provided arguments.
|
| |
| template<typename... Args> |
| std::unique_ptr< T, std::function< void(T *)> > | acquire (Args &&... args) |
| |
| void | release (T *ptr) noexcept |
| | Return raw storage to the pool (destructor already run).
|
| |
| void | reserve (std::size_t count) |
| | Add count additional blocks to the pool.
|
| |
| void | clear () |
| | Destroy all cached instances and release memory.
|
| |
| std::size_t | available () const |
| |
| void | allocate_block_unlocked (std::size_t count) |
| |
| | config_entry ()=default |
| |
| | config_entry (std::string k, config_value v, std::string desc="", bool req=false) |
| |
| virtual | ~IConfigLoader ()=default |
| |
| virtual bool | load ()=0 |
| | Load configuration from source.
|
| |
| virtual std::optional< config_value > | get (const std::string &key) const =0 |
| | Get a configuration value.
|
| |
| virtual bool | has (const std::string &key) const =0 |
| | Check if a key exists.
|
| |
| bool | has_errors () const |
| |
| bool | has_option (const std::string &name) const |
| |
| std::optional< std::string > | get_option (const std::string &name) const |
| |
| | CliConfigParser ()=default |
| |
| void | add_option (const cli_option &opt) |
| | Add an option definition.
|
| |
| cli_parse_result | parse (int argc, const char *const *argv) const |
| | Parse command-line arguments.
|
| |
| constexpr | source_location (const char *file=__builtin_FILE(), const char *function=__builtin_FUNCTION(), int line=__builtin_LINE()) noexcept |
| |
| constexpr const char * | file_name () const noexcept |
| |
| constexpr const char * | function_name () const noexcept |
| |
| constexpr int | line () const noexcept |
| |
| constexpr int | column () const noexcept |
| |
| static constexpr source_location | current (const char *file=__builtin_FILE(), const char *function=__builtin_FUNCTION(), int line=__builtin_LINE()) noexcept |
| |
| | error_info () |
| |
| | error_info (const std::string &msg) |
| | Construct with message only.
|
| |
| | error_info (int c, const std::string &msg, const std::string &mod="") |
| | Construct with code, message and optional module.
|
| |
| | error_info (int c, const std::string &msg, const std::string &mod, const std::string &det) |
| | Construct with code, message, module and details.
|
| |
| template<typename Enum , typename std::enable_if_t< std::is_enum_v< Enum >, int > = 0> |
| | error_info (Enum c, std::string msg, std::string mod="", std::optional< std::string > det=std::nullopt) |
| | Construct from strongly-typed enum error codes.
|
| |
| bool | operator== (const error_info &other) const |
| |
| bool | operator!= (const error_info &other) const |
| |
| | Result (const T &value) |
| |
| | Result (T &&value) |
| |
| | Result (const error_info &error) |
| |
| | Result (error_info &&error) |
| |
| | Result ()=delete |
| |
| | Result (const Result &)=default |
| |
| | Result (Result &&)=default |
| |
| Result & | operator= (const Result &)=default |
| |
| Result & | operator= (Result &&)=default |
| |
| template<typename U = T> |
| static Result< T > | ok (U &&value) |
| |
| static Result< T > | err (const error_info &error) |
| |
| static Result< T > | err (error_info &&error) |
| |
| static Result< T > | err (int code, const std::string &message, const std::string &module="") |
| |
| static Result< T > | uninitialized () |
| |
| bool | is_ok () const |
| |
| bool | is_err () const |
| |
| const T & | unwrap () const |
| |
| T & | unwrap () |
| |
| T | unwrap_or (T default_value) const |
| |
| T | value_or (T default_value) const |
| |
| const T & | value () const |
| |
| T & | value () |
| |
| const error_info & | error () const |
| |
| template<typename F > |
| auto | map (F &&func) const -> Result< decltype(func(std::declval< T >()))> |
| |
| template<typename F > |
| auto | and_then (F &&func) const -> decltype(func(std::declval< T >())) |
| |
| template<typename F > |
| Result< T > | or_else (F &&func) const |
| |
| | Optional () |
| |
| | Optional (const T &value) |
| |
| | Optional (T &&value) |
| |
| | Optional (std::nullopt_t) |
| |
| bool | has_value () const |
| |
| bool | is_some () const |
| |
| bool | is_none () const |
| |
| const T & | value () const |
| |
| T & | value () |
| |
| const T & | unwrap () const |
| |
| T | unwrap_or (T default_value) const |
| |
| template<typename F > |
| auto | map (F &&func) const -> Optional< decltype(func(std::declval< T >()))> |
| |
| template<typename T > |
| Optional< T > | kcenon::common::Some (T value) |
| | Create an Optional with value.
|
| |
| template<typename T > |
| Optional< T > | kcenon::common::None () |
| | Create an empty Optional.
|
| |
| VoidResult | kcenon::common::ok () |
| | Create a successful void result.
|
| |
| VoidResult | kcenon::common::err (const error_info &error) |
| | Factory function to create error VoidResult.
|
| |
| VoidResult | kcenon::common::err (int code, const std::string &message, const std::string &module="") |
| | Factory function to create error VoidResult.
|
| |
| template<typename T > |
| Result< T > | kcenon::common::ok (T value) |
| | Create a successful result.
|
| |
| template<typename T > |
| Result< T > | kcenon::common::make_error (int code, const std::string &message, const std::string &module="") |
| | Create an error result with code and message.
|
| |
| template<typename T > |
| Result< T > | kcenon::common::make_error (int code, const std::string &message, const std::string &module, const std::string &details) |
| | Create an error result with details.
|
| |
| template<typename T > |
| Result< T > | kcenon::common::make_error (const error_info &err) |
| | Create an error result from existing error_info.
|
| |
| static error_info | map_unknown_exception (const std::string &module="") |
| |
| static error_info | map_generic_exception (const std::exception &e, const std::string &module="") |
| |
| template<typename T , typename F > |
| Result< T > | kcenon::common::try_catch (F &&func, const std::string &module="") |
| | Convert exception to Result with automatic error code mapping.
|
| |
| template<typename F > |
| VoidResult | kcenon::common::try_catch_void (F &&func, const std::string &module="") |
| | Convert exception to VoidResult with automatic error code mapping.
|
| |
| virtual | ~IJob ()=default |
| |
| virtual VoidResult | execute ()=0 |
| | Execute the job.
|
| |
| virtual std::string | get_name () const |
| | Get the name of the job.
|
| |
| virtual int | get_priority () const |
| | Get the priority of the job.
|
| |
| virtual | ~IExecutor ()=default |
| |
| virtual Result< std::future< void > > | execute (std::unique_ptr< IJob > &&job)=0 |
| | Execute a job with Result-based error handling.
|
| |
| virtual Result< std::future< void > > | execute_delayed (std::unique_ptr< IJob > &&job, std::chrono::milliseconds delay)=0 |
| | Execute a job with delay.
|
| |
| virtual size_t | worker_count () const =0 |
| | Get the number of worker threads.
|
| |
| virtual bool | is_running () const =0 |
| | Check if the executor is running.
|
| |
| virtual size_t | pending_tasks () const =0 |
| | Get the number of pending tasks.
|
| |
| virtual void | shutdown (bool wait_for_completion=true)=0 |
| | Shutdown the executor gracefully.
|
| |
| virtual | ~IExecutorProvider ()=default |
| |
| virtual std::shared_ptr< IExecutor > | get_executor ()=0 |
| |
| virtual std::shared_ptr< IExecutor > | create_executor (size_t worker_count)=0 |
| |
| virtual | ~IThreadPool ()=default |
| |
| virtual VoidResult | resize (size_t new_size)=0 |
| |
| virtual size_t | min_workers () const |
| |
| virtual size_t | max_workers () const |
| |
| virtual VoidResult | set_queue_capacity (size_t capacity)=0 |
| |
| virtual size_t | get_queue_capacity () const =0 |
| |
| virtual bool | is_queue_full () const =0 |
| |
| virtual size_t | clear_pending_tasks ()=0 |
| |
| virtual VoidResult | start ()=0 |
| |
| virtual VoidResult | stop (bool wait_for_completion=true)=0 |
| |
| virtual VoidResult | pause ()=0 |
| |
| virtual VoidResult | resume ()=0 |
| |
| virtual bool | is_paused () const =0 |
| |
| virtual size_t | active_tasks () const =0 |
| |
| virtual size_t | idle_workers () const =0 |
| |
| virtual size_t | completed_tasks () const |
| |
| virtual size_t | failed_tasks () const |
| |
| virtual | ~IThreadPoolProvider ()=default |
| |
| virtual std::shared_ptr< IThreadPool > | get_thread_pool ()=0 |
| |
| virtual Result< std::shared_ptr< IThreadPool > > | create_thread_pool (size_t worker_count, size_t queue_capacity=0)=0 |
| |
| virtual | ~IDatabase ()=default |
| |
| virtual | ~IServiceContainer ()=default |
| |
| template<typename Interface , typename Factory > |
| void | register_factory (Factory &&factory) |
| | Register a service with a factory function.
|
| |
| template<typename Interface > |
| void | register_singleton (std::shared_ptr< Interface > instance) |
| | Register a singleton instance.
|
| |
| template<typename Interface > |
| std::shared_ptr< Interface > | resolve () |
| | Resolve a service by interface type.
|
| |
| template<typename Interface > |
| bool | has () const |
| | Check if a service is registered.
|
| |
| virtual void | register_impl (std::type_index type, std::any factory)=0 |
| |
| virtual void | register_singleton_impl (std::type_index type, std::any instance)=0 |
| |
| virtual std::any | resolve_impl (std::type_index type)=0 |
| |
| virtual bool | has_impl (std::type_index type) const =0 |
| |
| | ServiceContainer ()=default |
| |
| void | register_impl (std::type_index type, std::any factory) override |
| |
| void | register_singleton_impl (std::type_index type, std::any instance) override |
| |
| std::any | resolve_impl (std::type_index type) override |
| |
| bool | has_impl (std::type_index type) const override |
| |
| virtual | ~IBootstrapper ()=default |
| |
| virtual bool | initialize ()=0 |
| | Initialize the system.
|
| |
| virtual void | shutdown ()=0 |
| | Shutdown the system.
|
| |
| virtual bool | is_initialized () const =0 |
| | Check if the system is initialized.
|
| |
| | log_entry (log_level lvl=log_level::info, const std::string &msg="") |
| |
| static log_entry | create (log_level lvl, std::string_view msg, const source_location &loc=source_location::current()) |
| |
| virtual | ~ILogger ()=default |
| |
| virtual VoidResult | log (log_level level, const std::string &message)=0 |
| |
| virtual VoidResult | log (log_level level, std::string_view message, const source_location &loc=source_location::current()) |
| |
| virtual VoidResult | log (const log_entry &entry)=0 |
| |
| virtual bool | is_enabled (log_level level) const =0 |
| |
| virtual VoidResult | set_level (log_level level)=0 |
| |
| virtual log_level | get_level () const =0 |
| |
| virtual VoidResult | flush ()=0 |
| |
| virtual | ~ILoggerProvider ()=default |
| |
| virtual std::shared_ptr< ILogger > | get_logger ()=0 |
| |
| virtual std::shared_ptr< ILogger > | create_logger (const std::string &name)=0 |
| |
| | logger_config ()=default |
| |
| | logger_config (log_level level, const std::string &fmt="") |
| |
| virtual | ~ILoggerRegistry ()=default |
| |
| virtual VoidResult | register_logger (const std::string &name, std::shared_ptr< ILogger > logger)=0 |
| |
| virtual std::shared_ptr< ILogger > | get_logger (const std::string &name)=0 |
| |
| virtual VoidResult | unregister_logger (const std::string &name)=0 |
| |
| virtual std::shared_ptr< ILogger > | get_default_logger ()=0 |
| |
| virtual VoidResult | set_default_logger (std::shared_ptr< ILogger > logger)=0 |
| |
| std::string | kcenon::common::interfaces::to_string (log_level level) |
| | Convert log level to string.
|
| |
| log_level | kcenon::common::interfaces::from_string (const std::string &str) |
| | Parse log level from string (case-insensitive)
|
| |
| void | kcenon::common::logging::log_trace (std::shared_ptr< interfaces::ILogger > logger, std::string_view message) |
| | Log a trace message.
|
| |
| void | kcenon::common::logging::log_debug (std::shared_ptr< interfaces::ILogger > logger, std::string_view message) |
| | Log a debug message.
|
| |
| void | kcenon::common::logging::log_info (std::shared_ptr< interfaces::ILogger > logger, std::string_view message) |
| | Log an info message.
|
| |
| void | kcenon::common::logging::log_warning (std::shared_ptr< interfaces::ILogger > logger, std::string_view message) |
| | Log a warning message.
|
| |
| void | kcenon::common::logging::log_error (std::shared_ptr< interfaces::ILogger > logger, std::string_view message) |
| | Log an error message.
|
| |
| void | kcenon::common::logging::log_critical (std::shared_ptr< interfaces::ILogger > logger, std::string_view message) |
| | Log a critical message.
|
| |
| | ConsoleLogger (interfaces::log_level level=interfaces::log_level::info) |
| |
| VoidResult | log (interfaces::log_level level, const std::string &message) override |
| | Log a message with specified level.
|
| |
| VoidResult | log (const interfaces::log_entry &entry) override |
| | Log a structured entry.
|
| |
| bool | is_enabled (interfaces::log_level level) const override |
| | Check if logging is enabled for the specified level.
|
| |
| VoidResult | set_level (interfaces::log_level level) override |
| | Set the minimum log level.
|
| |
| interfaces::log_level | get_level () const override |
| | Get the current minimum log level.
|
| |
| VoidResult | flush () override |
| | Flush any buffered log messages.
|
| |
| std::shared_ptr< interfaces::ILogger > | kcenon::common::logging::make_console_logger (interfaces::log_level level=interfaces::log_level::info) |
| | Create a console logger.
|
| |
| std::string_view | kcenon::common::error::get_error_message (int code) |
| | Get human-readable error message for error code.
|
| |
| std::string_view | kcenon::common::error::get_category_name (int code) |
| | Get category name for error code.
|
| |
| | SimpleEventBus () |
| |
| | ~SimpleEventBus () |
| |
| void | start () |
| | Start the event bus.
|
| |
| void | stop () |
| | Stop the event bus.
|
| |
| bool | is_running () const |
| | Check if the event bus is running.
|
| |
| template<typename Event > |
| uint64_t | subscribe (std::function< void(const Event &)> handler) |
| | Subscribe to events of a specific type.
|
| |
| void | unsubscribe (uint64_t subscription_id) |
| | Unsubscribe from events.
|
| |
| template<typename Event > |
| void | publish (const Event &event) |
| | Publish an event to all subscribers.
|
| |
| template<typename Event > |
| size_t | subscriber_count () const |
| | Get the number of subscribers for an event type.
|
| |
| void | clear () |
| | Clear all subscriptions.
|
| |