Logger System 0.1.3
High-performance C++20 thread-safe logging system with asynchronous capabilities
Loading...
Searching...
No Matches
thread_integration_detector.h
Go to the documentation of this file.
1// BSD 3-Clause License
2// Copyright (c) 2021-2025, 🍀☀🌕🌥 🌊
3// See the LICENSE file in the project root for full license information.
4
5#pragma once
6
28#if !defined(LOGGER_THREAD_INTEGRATION_DETECTED)
29#define LOGGER_THREAD_INTEGRATION_DETECTED
30
31// ============================================================================
32// IExecutor Interface Detection (Issue #253)
33// ============================================================================
34// IExecutor is the preferred abstraction layer from common_system.
35// When available, logger_system can accept any IExecutor implementation
36// without compile-time dependency on thread_system.
37
38#if !defined(LOGGER_HAS_IEXECUTOR)
39# if __has_include(<kcenon/common/interfaces/executor_interface.h>)
40# define LOGGER_HAS_IEXECUTOR 1
41# elif __has_include(<common/interfaces/executor_interface.h>)
42# define LOGGER_HAS_IEXECUTOR 1
43# else
44# define LOGGER_HAS_IEXECUTOR 0
45# endif
46#endif
47
48// ============================================================================
49// Legacy thread_system Integration Detection
50// ============================================================================
51// thread_system integration is now OPTIONAL (Issue #222)
52// USE_THREAD_SYSTEM is defined by CMake when LOGGER_USE_THREAD_SYSTEM=ON
53// and thread_system is found
54
55// Auto-detect thread_system availability via header presence
56// Note: thread_system v3.0+ uses common_system interfaces instead of
57// thread-specific logger_interface.h. Detection now uses umbrella headers.
58#if defined(USE_THREAD_SYSTEM)
59# if !defined(USE_THREAD_SYSTEM_INTEGRATION)
60# if __has_include(<kcenon/thread/thread_pool.h>)
61# define USE_THREAD_SYSTEM_INTEGRATION 1
62# endif
63# endif
64#endif
65
66// ============================================================================
67// Compile-time Detection Functions
68// ============================================================================
69
71
77constexpr bool has_iexecutor_interface() noexcept {
78#if LOGGER_HAS_IEXECUTOR
79 return true;
80#else
81 return false;
82#endif
83}
84
92constexpr bool has_any_executor_support() noexcept {
94}
95
96} // namespace kcenon::logger::detail
97
98#endif // LOGGER_THREAD_INTEGRATION_DETECTED
constexpr bool has_any_executor_support() noexcept
Compile-time constant indicating any async executor is available.
constexpr bool has_iexecutor_interface() noexcept
Compile-time constant indicating IExecutor interface availability.