Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
Loading...
Searching...
No Matches
kcenon::logger::integration::thread_system_integration Class Reference

Stub implementation when thread_system is not available. More...

#include <thread_system_integration.h>

Collaboration diagram for kcenon::logger::integration::thread_system_integration:
Collaboration graph

Static Public Member Functions

static void enable () noexcept
 No-op when thread_system is not available.
 
static void disable () noexcept
 No-op when thread_system is not available.
 
static constexpr bool is_enabled () noexcept
 Always returns false when thread_system is not available.
 
static constexpr async_backend_type get_backend () noexcept
 Always returns standalone when thread_system is not available.
 
static bool submit_task (std::function< void()>) noexcept
 Always returns false when thread_system is not available.
 
static std::string get_backend_name () noexcept
 Always returns "standalone" when thread_system is not available.
 

Private Member Functions

 thread_system_integration ()=delete
 
 ~thread_system_integration ()=delete
 
 thread_system_integration (const thread_system_integration &)=delete
 
thread_system_integrationoperator= (const thread_system_integration &)=delete
 

Detailed Description

Stub implementation when thread_system is not available.

This stub provides the same interface as the full implementation but all thread_pool-related operations return false or no-op. This allows code to be written once and compile regardless of whether thread_system is available.

Note
Available even when LOGGER_HAS_THREAD_SYSTEM is not defined
Since
1.4.0

Definition at line 260 of file thread_system_integration.h.

Constructor & Destructor Documentation

◆ thread_system_integration() [1/2]

kcenon::logger::integration::thread_system_integration::thread_system_integration ( )
privatedelete

◆ ~thread_system_integration()

kcenon::logger::integration::thread_system_integration::~thread_system_integration ( )
privatedelete

◆ thread_system_integration() [2/2]

kcenon::logger::integration::thread_system_integration::thread_system_integration ( const thread_system_integration & )
privatedelete

Member Function Documentation

◆ disable()

static void kcenon::logger::integration::thread_system_integration::disable ( )
inlinestaticnoexcept

No-op when thread_system is not available.

Definition at line 272 of file thread_system_integration.h.

272 {
273 // No-op: thread_system not available
274 }

◆ enable()

static void kcenon::logger::integration::thread_system_integration::enable ( )
inlinestaticnoexcept

No-op when thread_system is not available.

Definition at line 265 of file thread_system_integration.h.

265 {
266 // No-op: thread_system not available
267 }

◆ get_backend()

static constexpr async_backend_type kcenon::logger::integration::thread_system_integration::get_backend ( )
inlinestaticnodiscardconstexprnoexcept

Always returns standalone when thread_system is not available.

Returns
async_backend_type::standalone

Definition at line 288 of file thread_system_integration.h.

288 {
290 }
@ standalone
Standalone backend using std::jthread.

◆ get_backend_name()

static std::string kcenon::logger::integration::thread_system_integration::get_backend_name ( )
inlinestaticnodiscardnoexcept

Always returns "standalone" when thread_system is not available.

Returns
"standalone"

Definition at line 305 of file thread_system_integration.h.

305 {
306 return "standalone";
307 }

◆ is_enabled()

static constexpr bool kcenon::logger::integration::thread_system_integration::is_enabled ( )
inlinestaticnodiscardconstexprnoexcept

Always returns false when thread_system is not available.

Returns
false (thread_pool backend not available)

Definition at line 280 of file thread_system_integration.h.

280 {
281 return false;
282 }

◆ operator=()

thread_system_integration & kcenon::logger::integration::thread_system_integration::operator= ( const thread_system_integration & )
privatedelete

◆ submit_task()

static bool kcenon::logger::integration::thread_system_integration::submit_task ( std::function< void()> )
inlinestaticnodiscardnoexcept

Always returns false when thread_system is not available.

Parameters
taskThe task (ignored)
Returns
false (task not submitted to thread_pool)

Definition at line 297 of file thread_system_integration.h.

297 {
298 return false;
299 }

The documentation for this class was generated from the following file: