foobar2000 SDK  2015-08-03
Public Member Functions | Static Public Member Functions
completion_notifyabstract

#include <completion_notify.h>

+ Inheritance diagram for completion_notify:

Public Member Functions

 FB2K_MAKE_SERVICE_INTERFACE (completion_notify, service_base)
 
virtual void on_completion (unsigned p_code)=0
 
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 ()
 

Static Public Member Functions

static void g_signal_completion_async (service_ptr_t< completion_notify > p_notify, unsigned p_code)
 

Additional Inherited Members

- Public Types inherited from service_base
typedef service_base t_interface
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Generic service for receiving notifications about async operation completion. Used by various other services.

Definition at line 4 of file completion_notify.h.

Member Function Documentation

completion_notify::FB2K_MAKE_SERVICE_INTERFACE ( completion_notify  ,
service_base   
)
void completion_notify::g_signal_completion_async ( service_ptr_t< completion_notify p_notify,
unsigned  p_code 
)
static

Helper. Checks for null ptr and calls on_completion_async when the ptr is not null.

Definition at line 17 of file completion_notify.cpp.

17  {
18  if (p_notify.is_valid()) {
20  }
21 }
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Definition: service_impl.h:4
bool is_valid() const
Definition: service.h:119
Helper template used to easily access core services. Usage: static_api_ptr_t<myclass> api; api->doso...
Definition: service.h:533
virtual void completion_notify::on_completion ( unsigned  p_code)
pure virtual

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.

Implemented in completion_notify_impl< t_receiver >, and completion_notify_dummy.

void completion_notify::on_completion_async ( unsigned  p_code)

Helper. Queues a notification, using main_thread_callback.

Definition at line 23 of file completion_notify.cpp.

23  {
25 }
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Definition: service_impl.h:4
Helper template used to easily access core services. Usage: static_api_ptr_t<myclass> api; api->doso...
Definition: service.h:533

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