9 #ifndef CPPLOGGING_PROCESSORS_ASYNC_WAIT_FREE_PROCESSOR_H
10 #define CPPLOGGING_PROCESSORS_ASYNC_WAIT_FREE_PROCESSOR_H
45 explicit AsyncWaitFreeProcessor(
const std::shared_ptr<Layout>&
layout,
bool auto_start =
true,
size_t capacity = 8192,
bool discard =
false,
const std::function<
void ()>& on_thread_initialize = [](){},
const std::function<void ()>& on_thread_clenup = [](){});
54 bool Start()
override;
57 void Flush()
override;
63 std::function<void ()> _on_thread_initialize;
64 std::function<void ()> _on_thread_clenup;
66 bool EnqueueRecord(
bool discard,
Record& record);
67 void ProcessThread(
const std::function<
void ()>& on_thread_initialize,
const std::function<
void ()>& on_thread_clenup);
Asynchronous wait-free logging ring queue definition.
Asynchronous wait-free logging processor.
bool ProcessRecord(Record &record) override
Process the given logging record through all child filters, layouts and appenders.
AsyncWaitFreeProcessor(const AsyncWaitFreeProcessor &)=delete
AsyncWaitFreeProcessor(const std::shared_ptr< Layout > &layout, bool auto_start=true, size_t capacity=8192, bool discard=false, const std::function< void()> &on_thread_initialize=[](){}, const std::function< void()> &on_thread_clenup=[](){})
Initialize asynchronous processor with a given layout interface, overflow policy and buffer capacity.
void Flush() override
Flush the current logging processor.
bool Stop() override
Stop the logging processor.
AsyncWaitFreeProcessor(AsyncWaitFreeProcessor &&)=delete
AsyncWaitFreeProcessor & operator=(AsyncWaitFreeProcessor &&)=delete
AsyncWaitFreeProcessor & operator=(const AsyncWaitFreeProcessor &)=delete
bool Start() override
Start the logging processor.
virtual ~AsyncWaitFreeProcessor()
Asynchronous wait-free logging ring queue.
Logging processor interface.
std::shared_ptr< Layout > & layout() noexcept
Get the logging processor layout.
C++ Logging project definitions.
Logging processor interface definition.