foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
completion_notify_impl< t_receiver >

#include <completion_notify.h>

+ Inheritance diagram for completion_notify_impl< t_receiver >:

Public Member Functions

void on_completion (unsigned p_code)
 
void orphan ()
 
void setup (t_receiver *p_receiver, unsigned p_task_id)
 
- Public Member Functions inherited from completion_notify
 FB2K_MAKE_SERVICE_INTERFACE (completion_notify, service_base)
 
void on_completion_async (unsigned p_code)
 
- Public Member Functions inherited from service_base
template<typename outPtr_t >
bool cast (outPtr_t &outPtr)
 
virtual int service_add_ref ()=0 throw ()
 
virtual bool service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid)
 
template<class T >
bool service_query_t (service_ptr_t< T > &p_out)
 
virtual int service_release ()=0 throw ()
 

Private Attributes

t_receiver * m_receiver
 
unsigned m_taskid
 

Additional Inherited Members

- Public Types inherited from service_base
typedef service_base t_interface
 
- Static Public Member Functions inherited from completion_notify
static void g_signal_completion_async (service_ptr_t< completion_notify > p_notify, unsigned p_code)
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

template<typename t_receiver>
class completion_notify_impl< t_receiver >

Helper implementation. IMPLEMENTATION WARNING: If process being completed creates a window taking caller's window as parent, you must not destroy the parent window inside on_task_completion(). If you need to do so, use PostMessage() or main_thread_callback to delay the deletion.

Definition at line 35 of file completion_notify.h.

Member Function Documentation

template<typename t_receiver >
void completion_notify_impl< t_receiver >::on_completion ( unsigned  p_code)
inlinevirtual

Called when an async operation has been completed. Note that on_completion is always called from main thread. You can use on_completion_async() helper if you need to signal completion while your context is in another thread.
IMPLEMENTATION WARNING: If process being completed creates a window taking caller's window as parent, you must not destroy the parent window inside on_completion(). If you need to do so, use PostMessage() or main_thread_callback to delay the deletion.

Parameters
p_codeContext-specific status code. Possible values depend on the operation being performed.

Implements completion_notify.

Definition at line 37 of file completion_notify.h.

37  {
38  if (m_receiver != NULL) {
39  m_receiver->on_task_completion(m_taskid,p_code);
40  }
41  }
template<typename t_receiver >
void completion_notify_impl< t_receiver >::orphan ( )
inlinevirtual

Implements completion_notify_orphanable.

Definition at line 43 of file completion_notify.h.

43 {m_receiver = NULL; m_taskid = 0;}
template<typename t_receiver >
void completion_notify_impl< t_receiver >::setup ( t_receiver *  p_receiver,
unsigned  p_task_id 
)
inline

Definition at line 42 of file completion_notify.h.

42 {m_receiver = p_receiver; m_taskid = p_task_id;}

Field Documentation

template<typename t_receiver >
t_receiver* completion_notify_impl< t_receiver >::m_receiver
private

Definition at line 45 of file completion_notify.h.

template<typename t_receiver >
unsigned completion_notify_impl< t_receiver >::m_taskid
private

Definition at line 46 of file completion_notify.h.


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