CatapultServer  v0.5.0.1 (Elephant)
catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper > Class Template Reference

Wraps a callback with a timer using an implicit strand. More...

Public Member Functions

 BasicTimedCallback (TCallbackWrapper &wrapper, boost::asio::io_context &ioContext, const TCallback &callback, TCallbackArgs &&... timeoutArgs)
 
void setTimeout (const utils::TimeSpan &timeout)
 
void setTimeoutHandler (const TimeoutHandlerType &handler)
 
bool callback (const std::tuple< TCallbackArgs... > &args)
 

Private Member Functions

void handleTimedOut ()
 

Private Attributes

TCallbackWrapper & m_wrapper
 
TCallback m_callback
 
std::tuple< TCallbackArgs... > m_timeoutArgs
 
boost::asio::steady_timer m_timer
 
bool m_isCallbackInvoked
 
bool m_isTimedOut
 
TimeoutHandlerType m_timeoutHandler
 

Detailed Description

template<typename TCallback, typename... TCallbackArgs>
template<typename TCallbackWrapper>
class catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >

Wraps a callback with a timer using an implicit strand.

Constructor & Destructor Documentation

◆ BasicTimedCallback()

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::BasicTimedCallback ( TCallbackWrapper &  wrapper,
boost::asio::io_context &  ioContext,
const TCallback &  callback,
TCallbackArgs &&...  timeoutArgs 
)
inline

Member Function Documentation

◆ callback()

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
bool catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::callback ( const std::tuple< TCallbackArgs... > &  args)
inline
Here is the caller graph for this function:

◆ handleTimedOut()

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
void catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::handleTimedOut ( )
inlineprivate

◆ setTimeout()

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
void catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::setTimeout ( const utils::TimeSpan timeout)
inline

◆ setTimeoutHandler()

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
void catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::setTimeoutHandler ( const TimeoutHandlerType handler)
inline

Member Data Documentation

◆ m_callback

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
TCallback catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::m_callback
private

◆ m_isCallbackInvoked

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
bool catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::m_isCallbackInvoked
private

◆ m_isTimedOut

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
bool catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::m_isTimedOut
private

◆ m_timeoutArgs

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
std::tuple<TCallbackArgs...> catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::m_timeoutArgs
private

◆ m_timeoutHandler

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
TimeoutHandlerType catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::m_timeoutHandler
private

◆ m_timer

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
boost::asio::steady_timer catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::m_timer
private

◆ m_wrapper

template<typename TCallback , typename... TCallbackArgs>
template<typename TCallbackWrapper>
TCallbackWrapper& catapult::thread::StrandedTimedCallback< TCallback, TCallbackArgs >::BasicTimedCallback< TCallbackWrapper >::m_wrapper
private

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