From 573877a3f093a2df6eeb15db56a7a8615d621727 Mon Sep 17 00:00:00 2001 From: F1F88 <0xf1f88@gmail.com> Date: Wed, 11 Dec 2024 23:32:58 +0800 Subject: [PATCH] Abstract backend worker class --- include/spdlog/details/backend_worker.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/spdlog/details/backend_worker.h diff --git a/include/spdlog/details/backend_worker.h b/include/spdlog/details/backend_worker.h new file mode 100644 index 00000000..1bfeef43 --- /dev/null +++ b/include/spdlog/details/backend_worker.h @@ -0,0 +1,22 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + + +namespace spdlog { + +namespace details { + +class thread_pool; + +class backend_worker : public std::enable_shared_from_this { + friend class thread_pool; + +protected: + virtual void backend_sink_it_(const details::log_msg &msg) = 0; + virtual void backend_flush_() = 0; +}; + +} // namespace details +} // namespace spdlog