forward declaration
This commit is contained in:
parent
663df6278d
commit
4e7a371053
@ -1,18 +1,22 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <thread>
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <cstdint>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
#include "../details/async_log_msg.h"
|
#include "../details/async_log_msg.h"
|
||||||
#include "../details/mpmc_blocking_q.h"
|
|
||||||
#include "dist_sink.h"
|
#include "dist_sink.h"
|
||||||
|
|
||||||
// async_sink is a sink that sends log messages to a dist_sink in a separate thread using a queue.
|
// async_sink is a sink that sends log messages to a dist_sink in a separate thread using a queue.
|
||||||
// The worker thread dequeues the messages and sends them to the dist_sink to perform the actual logging.
|
// The worker thread dequeues the messages and sends them to the dist_sink to perform the actual logging.
|
||||||
// The worker thread is terminated when the async_sink is destroyed.
|
// The worker thread is terminated when the async_sink is destroyed.
|
||||||
|
|
||||||
|
namespace spdlog::details { // forward declaration
|
||||||
|
template <typename Mutex>
|
||||||
|
class mpmc_blocking_queue;
|
||||||
|
}
|
||||||
|
|
||||||
namespace spdlog {
|
namespace spdlog {
|
||||||
namespace sinks {
|
namespace sinks {
|
||||||
|
|
||||||
@ -54,7 +58,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void sink_it_(const details::log_msg &msg) override;
|
void sink_it_(const details::log_msg &msg) override;
|
||||||
void flush_() override;
|
void flush_() override;
|
||||||
void send_message_(const async_log_msg::type msg_type, const details::log_msg &msg);
|
void send_message_(async_log_msg::type msg_type, const details::log_msg &msg);
|
||||||
void worker_loop();
|
void worker_loop();
|
||||||
|
|
||||||
std::atomic<overflow_policy> overflow_policy_ = overflow_policy::block;
|
std::atomic<overflow_policy> overflow_policy_ = overflow_policy::block;
|
||||||
|
Loading…
Reference in New Issue
Block a user