fix8  version 1.4.0
Open Source C++ FIX Framework
FIX8::f8_thread< T > Class Template Reference

Thread wrapper. Ctor provides T instance and specifies ptr to member to call or defaults to operator() More...

#include <thread.hpp>

Inheritance diagram for FIX8::f8_thread< T >:
FIX8::_f8_threadcore

Classes

class  _helper
 

Public Member Functions

 f8_thread (std::reference_wrapper< T > what, int(T::*method)()=&T::operator(), f8_thread_cancellation_token &(T::*cancellation_token_method)()=&T::cancellation_token)
 
virtual ~f8_thread ()
 Dtor. More...
 
int start ()
 
void request_stop ()
 
- Public Member Functions inherited from FIX8::_f8_threadcore
 _f8_threadcore ()
 
virtual ~_f8_threadcore ()
 Dtor. More...
 
virtual int join (int timeoutInMs=0)
 
int yield () const
 
thread_id_t get_threadid () const
 
bool operator== (const _f8_threadcore &that) const
 
bool operator!= (const _f8_threadcore &that) const
 
_f8_threadcoreoperator= (const _f8_threadcore &)=delete
 

Private Attributes

class FIX8::f8_thread::_helper _sub
 

Additional Inherited Members

- Static Public Member Functions inherited from FIX8::_f8_threadcore
static thread_id_t getid ()
 
- Protected Member Functions inherited from FIX8::_f8_threadcore
template<typename T >
int _start (void *sub)
 

Detailed Description

template<typename T>
class FIX8::f8_thread< T >

Thread wrapper. Ctor provides T instance and specifies ptr to member to call or defaults to operator()

Template Parameters
Tclass call thread entry functor

Definition at line 245 of file thread.hpp.

Constructor & Destructor Documentation

template<typename T>
FIX8::f8_thread< T >::f8_thread ( std::reference_wrapper< T >  what,
int(T::*)()  method = &T::operator(),
f8_thread_cancellation_token &(T::*)()  cancellation_token_method = &T::cancellation_token 
)
inline

Ctor. Reference to object, functor version.

Parameters
whatreference wrapper of class with entry point
methodreference to entry point method
cancellation_token_methodpointer to cancellation_token

Definition at line 280 of file thread.hpp.

282  : _sub(what, method, cancellation_token_method) {}
class FIX8::f8_thread::_helper _sub
template<typename T>
virtual FIX8::f8_thread< T >::~f8_thread ( )
inlinevirtual

Dtor.

Definition at line 285 of file thread.hpp.

285 {}

Member Function Documentation

template<typename T>
void FIX8::f8_thread< T >::request_stop ( )
inlinevirtual

request thread stop.

Returns
function result

Implements FIX8::_f8_threadcore.

Definition at line 293 of file thread.hpp.

Referenced by FIX8::AsyncSocket< f8String >::quit(), FIX8::FIXReader::quit(), FIX8::AsyncSocket< f8String >::request_stop(), FIX8::Timer< FIX8::Session >::stop(), FIX8::FIXReader::stop(), and FIX8::ReliableClientSession< T >::~ReliableClientSession().

class FIX8::f8_thread::_helper _sub
f8_thread_cancellation_token & cancellation_token()
Definition: thread.hpp:271
void request_stop()
Tell the thread to stop.
Definition: thread.hpp:219
template<typename T>
int FIX8::f8_thread< T >::start ( )
inlinevirtual

start thread.

Returns
function result

Implements FIX8::_f8_threadcore.

Definition at line 289 of file thread.hpp.

Referenced by FIX8::Logger::Logger(), FIX8::AsyncSocket< f8String >::start(), FIX8::Timer< FIX8::Session >::start(), FIX8::FIXReader::start(), and FIX8::ReliableClientSession< T >::start().

289 { return _start<_helper>(static_cast<void *>(&_sub)); }
class FIX8::f8_thread::_helper _sub

Member Data Documentation

template<typename T>
class FIX8::f8_thread::_helper FIX8::f8_thread< T >::_sub
private

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