foobar2000 SDK  2015-08-03
Public Member Functions | Data Fields | Protected Member Functions
ThreadUtils::CSingleThreadWrapper< TBase, processMsgs >::command

#include <ThreadUtils.h>

Public Member Functions

void execute (TBase &obj)
 
void rethrow () const
 

Data Fields

abort_callbackm_abort
 
HANDLE m_completionEvent
 
status m_status
 
pfc::string8 m_statusMsg
 

Protected Member Functions

 command ()
 
virtual ~command ()
 
virtual void executeImpl (TBase &)
 

Detailed Description

template<typename TBase, bool processMsgs = false>
class ThreadUtils::CSingleThreadWrapper< TBase, processMsgs >::command

Definition at line 178 of file ThreadUtils.h.

Constructor & Destructor Documentation

template<typename TBase , bool processMsgs = false>
ThreadUtils::CSingleThreadWrapper< TBase, processMsgs >::command::command ( )
inlineprotected
template<typename TBase , bool processMsgs = false>
virtual ThreadUtils::CSingleThreadWrapper< TBase, processMsgs >::command::~command ( )
inlineprotectedvirtual

Definition at line 182 of file ThreadUtils.h.

182 {}

Member Function Documentation

template<typename TBase , bool processMsgs = false>
void ThreadUtils::CSingleThreadWrapper< TBase, processMsgs >::command::execute ( TBase obj)
inline

Definition at line 184 of file ThreadUtils.h.

184  {
185  try {
186  executeImpl(obj);
187  m_status = success;
188  } catch(exception_aborted const & e) {
189  m_status = fail_abort; m_statusMsg = e.what();
190  } catch(exception_io_data const & e) {
191  m_status = fail_io_data; m_statusMsg = e.what();
192  } catch(exception_io const & e) {
193  m_status = fail_io; m_statusMsg = e.what();
194  } catch(std::exception const & e) {
195  m_status = fail; m_statusMsg = e.what();
196  }
197  SetEvent(m_completionEvent);
198  }
std::exception exception
Definition: primitives.h:193
template<typename TBase , bool processMsgs = false>
virtual void ThreadUtils::CSingleThreadWrapper< TBase, processMsgs >::command::executeImpl ( TBase )
inlineprotectedvirtual

Definition at line 181 of file ThreadUtils.h.

181 {}
template<typename TBase , bool processMsgs = false>
void ThreadUtils::CSingleThreadWrapper< TBase, processMsgs >::command::rethrow ( ) const
inline

Definition at line 199 of file ThreadUtils.h.

199  {
200  switch(m_status) {
201  case fail:
203  case fail_io:
204  throw exception_io(m_statusMsg);
205  case fail_io_data:
206  throw exception_io_data(m_statusMsg);
207  case fail_abort:
208  throw exception_aborted();
209  case success:
210  break;
211  default:
212  uBugCheck();
213  }
214  }
std::exception exception
Definition: primitives.h:193
PFC_NORETURN void SHARED_EXPORT uBugCheck()

Field Documentation

template<typename TBase , bool processMsgs = false>
abort_callback* ThreadUtils::CSingleThreadWrapper< TBase, processMsgs >::command::m_abort

Definition at line 218 of file ThreadUtils.h.

template<typename TBase , bool processMsgs = false>
HANDLE ThreadUtils::CSingleThreadWrapper< TBase, processMsgs >::command::m_completionEvent

Definition at line 217 of file ThreadUtils.h.

template<typename TBase , bool processMsgs = false>
status ThreadUtils::CSingleThreadWrapper< TBase, processMsgs >::command::m_status

Definition at line 215 of file ThreadUtils.h.

template<typename TBase , bool processMsgs = false>
pfc::string8 ThreadUtils::CSingleThreadWrapper< TBase, processMsgs >::command::m_statusMsg

Definition at line 216 of file ThreadUtils.h.


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