spdlog
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
spdlog::details::thread_pool Class Reference

Detailed Description

Definition at line 81 of file thread_pool.h.

#include <thread_pool.h>

Public Types

using item_type = async_msg
 
using q_type = details::mpmc_blocking_queue< item_type >
 

Public Member Functions

 thread_pool (size_t q_max_items, size_t threads_n, std::function< void()> on_thread_start)
 
 thread_pool (size_t q_max_items, size_t threads_n)
 
 ~thread_pool ()
 
 thread_pool (const thread_pool &)=delete
 
thread_pooloperator= (thread_pool &&)=delete
 
void post_log (async_logger_ptr &&worker_ptr, const details::log_msg &msg, async_overflow_policy overflow_policy)
 
void post_flush (async_logger_ptr &&worker_ptr, async_overflow_policy overflow_policy)
 
size_t overrun_counter ()
 
size_t queue_size ()
 

Private Member Functions

void post_async_msg_ (async_msg &&new_msg, async_overflow_policy overflow_policy)
 
void worker_loop_ ()
 
bool process_next_msg_ ()
 

Private Attributes

q_type q_
 
std::vector< std::threadthreads_
 

Member Typedef Documentation

◆ item_type

Definition at line 84 of file thread_pool.h.

◆ q_type

Definition at line 85 of file thread_pool.h.

Constructor & Destructor Documentation

◆ thread_pool() [1/3]

SPDLOG_INLINE spdlog::details::thread_pool::thread_pool ( size_t  q_max_items,
size_t  threads_n,
std::function< void()>  on_thread_start 
)

Definition at line 16 of file thread_pool-inl.h.

◆ thread_pool() [2/3]

SPDLOG_INLINE spdlog::details::thread_pool::thread_pool ( size_t  q_max_items,
size_t  threads_n 
)

Definition at line 33 of file thread_pool-inl.h.

◆ ~thread_pool()

SPDLOG_INLINE spdlog::details::thread_pool::~thread_pool ( )

Definition at line 38 of file thread_pool-inl.h.

◆ thread_pool() [3/3]

spdlog::details::thread_pool::thread_pool ( const thread_pool )
delete

Member Function Documentation

◆ operator=()

thread_pool & spdlog::details::thread_pool::operator= ( thread_pool &&  )
delete

◆ overrun_counter()

size_t SPDLOG_INLINE spdlog::details::thread_pool::overrun_counter ( )

Definition at line 66 of file thread_pool-inl.h.

◆ post_async_msg_()

void SPDLOG_INLINE spdlog::details::thread_pool::post_async_msg_ ( async_msg &&  new_msg,
async_overflow_policy  overflow_policy 
)
private

Definition at line 76 of file thread_pool-inl.h.

◆ post_flush()

void SPDLOG_INLINE spdlog::details::thread_pool::post_flush ( async_logger_ptr &&  worker_ptr,
async_overflow_policy  overflow_policy 
)

Definition at line 61 of file thread_pool-inl.h.

◆ post_log()

void SPDLOG_INLINE spdlog::details::thread_pool::post_log ( async_logger_ptr &&  worker_ptr,
const details::log_msg msg,
async_overflow_policy  overflow_policy 
)

Definition at line 55 of file thread_pool-inl.h.

◆ process_next_msg_()

bool SPDLOG_INLINE spdlog::details::thread_pool::process_next_msg_ ( )
private

Definition at line 96 of file thread_pool-inl.h.

◆ queue_size()

size_t SPDLOG_INLINE spdlog::details::thread_pool::queue_size ( )

Definition at line 71 of file thread_pool-inl.h.

◆ worker_loop_()

void SPDLOG_INLINE spdlog::details::thread_pool::worker_loop_ ( )
private

Definition at line 88 of file thread_pool-inl.h.

Member Data Documentation

◆ q_

q_type spdlog::details::thread_pool::q_
private

Definition at line 102 of file thread_pool.h.

◆ threads_

std::vector<std::thread> spdlog::details::thread_pool::threads_
private

Definition at line 104 of file thread_pool.h.


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