foobar2000 SDK  2015-08-03
Public Member Functions
main_thread_callback_managerabstract

#include <main_thread_callback.h>

+ Inheritance diagram for main_thread_callback_manager:

Public Member Functions

virtual void add_callback (service_ptr_t< main_thread_callback > p_callback)=0
 
 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (main_thread_callback_manager)
 
- 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 ()
 

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

Allows you to queue a callback object to be called from main app thread. This is commonly used to trigger main-thread-only API calls from worker threads.
This can be also used from main app thread, to avoid race conditions when trying to use APIs that dispatch global callbacks from inside some other global callback, or using message loops / modal dialogs inside global callbacks.

Definition at line 18 of file main_thread_callback.h.

Member Function Documentation

virtual void main_thread_callback_manager::add_callback ( service_ptr_t< main_thread_callback p_callback)
pure virtual

Queues a callback object. This can be called from any thread, implementation ensures multithread safety. Implementation will call p_callback->callback_run() once later. To get it called repeatedly, you would need to add your callback again.

main_thread_callback_manager::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( main_thread_callback_manager  )

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