foobar2000 SDK  2015-01-14
completion_notify.cpp
Go to the documentation of this file.
1 #include "foobar2000.h"
2 
3 namespace {
4  class main_thread_callback_myimpl : public main_thread_callback {
5  public:
6  void callback_run() {
7  m_notify->on_completion(m_code);
8  }
9 
10  main_thread_callback_myimpl(completion_notify_ptr p_notify,unsigned p_code) : m_notify(p_notify), m_code(p_code) {}
11  private:
12  completion_notify_ptr m_notify;
13  unsigned m_code;
14  };
15 }
16 
18  if (p_notify.is_valid()) {
20  }
21 }
22 
25 }
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Definition: service_impl.h:4
static void g_signal_completion_async(service_ptr_t< completion_notify > p_notify, unsigned p_code)
Helper. Checks for null ptr and calls on_completion_async when the ptr is not null.
bool is_valid() const
Definition: service.h:119
void on_completion_async(unsigned p_code)
Helper. Queues a notification, using main_thread_callback.
virtual void callback_run()=0
Gets called from main app thread. See main_thread_callback_manager description for more info...
Helper template used to easily access core services. Usage: static_api_ptr_t api; api->doso...
Definition: service.h:533
Callback object class for main_thread_callback_manager service.