Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
Loading...
Searching...
No Matches
thread_safe_writer.h File Reference

Thread-safe base class for writer implementations kcenon. More...

#include "base_writer.h"
#include <kcenon/logger/logger_export.h>
#include <mutex>
Include dependency graph for thread_safe_writer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  kcenon::logger::thread_safe_writer
 Base class providing automatic thread-safety for writer implementations. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::logger
 

Detailed Description

Thread-safe base class for writer implementations kcenon.

Since
1.3.0

This file defines the thread_safe_writer base class that provides automatic thread synchronization for writer implementations. Derived classes implement the protected *_impl() methods and get thread-safety for free.

Design pattern: Template Method Pattern

  • Base class handles synchronization in public methods
  • Derived classes implement logic in protected *_impl methods
  • Eliminates boilerplate mutex code from all writer implementations

Definition in file thread_safe_writer.h.