|
Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
|
Combines multiple configuration strategies. More...
#include <composite_strategy.h>


Public Member Functions | |
| std::string | get_name () const override |
| Get the strategy name. | |
| void | apply (logger_config &config) const override |
| Apply this strategy to a logger configuration. | |
| bool | is_applicable () const override |
| Check if this strategy is applicable in the current context. | |
| composite_strategy & | add (std::unique_ptr< config_strategy_interface > strategy) |
| Add a strategy to the composite. | |
| template<typename Strategy , typename... Args> | |
| composite_strategy & | add (Args &&... args) |
| Add a strategy by constructing it in-place. | |
| composite_strategy & | clear () |
| Clear all strategies. | |
| std::size_t | size () const |
| Get the number of strategies. | |
| bool | empty () const |
| Check if composite is empty. | |
Public Member Functions inherited from kcenon::logger::config_strategy_interface | |
| virtual | ~config_strategy_interface ()=default |
| virtual int | priority () const |
| Get the strategy priority. | |
Private Attributes | |
| std::vector< std::unique_ptr< config_strategy_interface > > | strategies_ |
Combines multiple configuration strategies.
Stores multiple strategies and applies them in priority order. Strategies with higher priority values are applied first.
Definition at line 32 of file composite_strategy.h.
|
inline |
Add a strategy by constructing it in-place.
| Strategy | The strategy type to construct |
| Args | Constructor argument types |
| args | Constructor arguments |
Definition at line 86 of file composite_strategy.h.
References strategies_.
|
inline |
Add a strategy to the composite.
| strategy | The strategy to add |
Definition at line 71 of file composite_strategy.h.
References strategies_.
|
inlineoverridevirtual |
Apply this strategy to a logger configuration.
| config | The configuration to modify |
Modifies the provided configuration according to the strategy's rules. Changes are applied in-place.
Implements kcenon::logger::config_strategy_interface.
Definition at line 38 of file composite_strategy.h.
References strategies_.
|
inline |
Clear all strategies.
Definition at line 97 of file composite_strategy.h.
References clear(), and strategies_.
Referenced by clear().


|
inline |
Check if composite is empty.
Definition at line 114 of file composite_strategy.h.
References strategies_.
|
inlineoverridevirtual |
Get the strategy name.
Implements kcenon::logger::config_strategy_interface.
Definition at line 34 of file composite_strategy.h.
|
inlineoverridevirtual |
Check if this strategy is applicable in the current context.
Override to implement conditional strategy application (e.g., only apply in certain environments).
Reimplemented from kcenon::logger::config_strategy_interface.
Definition at line 58 of file composite_strategy.h.
References strategies_.
|
inline |
Get the number of strategies.
Definition at line 106 of file composite_strategy.h.
References strategies_.
|
private |
Definition at line 119 of file composite_strategy.h.
Referenced by add(), add(), apply(), clear(), empty(), is_applicable(), and size().