JayBeams  0.1
Another project to have fun coding.
Public Member Functions | Private Attributes | List of all members
jb::detail::thread_setup_wrapper< Callable > Struct Template Reference

Hold data to startup a thread in JayBeams. More...

#include <thread_setup_wrapper.hpp>

Public Member Functions

 thread_setup_wrapper (jb::thread_config const &config, Callable &&c)
 
virtual void operator() ()
 

Private Attributes

jb::thread_config config_
 
std::shared_ptr< Callable > callable_
 

Detailed Description

template<typename Callable>
struct jb::detail::thread_setup_wrapper< Callable >

Hold data to startup a thread in JayBeams.

We want to launch all threads using a common configuration function. To match the semantics of std::thread, we need to copy the thread functor and its parameters exactly once. This class wraps the relevant bits in a shared_ptr<> to avoid excessive copying.

Definition at line 22 of file thread_setup_wrapper.hpp.

Constructor & Destructor Documentation

◆ thread_setup_wrapper()

template<typename Callable>
jb::detail::thread_setup_wrapper< Callable >::thread_setup_wrapper ( jb::thread_config const &  config,
Callable &&  c 
)
inline

Definition at line 24 of file thread_setup_wrapper.hpp.

Member Function Documentation

◆ operator()()

template<typename Callable>
virtual void jb::detail::thread_setup_wrapper< Callable >::operator() ( )
inlinevirtual

Member Data Documentation

◆ callable_

template<typename Callable>
std::shared_ptr<Callable> jb::detail::thread_setup_wrapper< Callable >::callable_
private

Definition at line 43 of file thread_setup_wrapper.hpp.

◆ config_

template<typename Callable>
jb::thread_config jb::detail::thread_setup_wrapper< Callable >::config_
private

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