The Base module provides small, reusable building blocks that higher-level components can inherit or depend on. Its primary purpose is to standardize common infrastructure concerns (most notably logging) without imposing additional runtime or architectural constraints.
The module is intentionally lightweight:
It relies on compile-time patterns where possible (e.g., CRTP).
It keeps ownership semantics explicit via std::shared_ptr.
It avoids coupling to external frameworks in its public API documentation.
Key types
The module currently centers around:
GBase : A CRTP base class that equips derived objects with a ready-to-use logger.
GOptions : The options/configuration mechanism used to initialize GLogger .
GBase responsibilities
GBase is designed to solve a recurring pattern in component implementations: ensuring that each component can emit consistent log messages with minimal boilerplate.
The derived class accesses the logger via the protected member log.
The derived class does not need to implement any logging bootstrapping logic.
Passing an empty logger channel name typically selects default behavior in the configured logging backend.
Examples
The examples below are included in the repository as reference implementations and are intentionally small. They are meant to be read alongside the header documentation.
Example: examples/test_gbase.cc
Demonstrates:
Constructing a derived type that creates its own logger from options.
Constructing a derived type that reuses a shared logger instance.
Emitting info, warning, and debug messages from derived code.
Non-goals
The Base module does not attempt to:
Provide a full application framework.
Hide ownership or lifetime rules behind implicit global state.
Wrap or re-document third-party libraries in its public documentation.
Files in this module
gbase.h : Defines GBase and the type-name demangling helper used for readable diagnostics.
gbaseDoxy.h : This documentation entry point and module landing page.
examples/test_gbase.cc : A small usage example demonstrating both logger construction modes.
Where to look next
Start with GBase to understand the base class contract and expected inheritance pattern.
Review GLogger for logging configuration and routing behavior.
Consult the examples to see typical construction patterns.