foobar2000 SDK  2015-08-03
Public Member Functions | Static Private Member Functions | Private Attributes
completion_notify_receiver

#include <completion_notify.h>

+ Inheritance diagram for completion_notify_receiver:

Public Member Functions

 ~completion_notify_receiver ()
 
completion_notify::ptr create_or_get_task (unsigned p_id)
 
completion_notify_ptr create_task (unsigned p_id)
 
bool have_task (unsigned p_id) const
 
virtual void on_task_completion (unsigned p_id, unsigned p_status)
 
void orphan_all_tasks ()
 
void orphan_task (unsigned p_id)
 

Static Private Member Functions

static void orphanfunc (unsigned, completion_notify_orphanable_nnptr p_item)
 

Private Attributes

pfc::map_t< unsigned, completion_notify_orphanable_nnptrm_tasks
 

Detailed Description

Helper base class for classes that manage nonblocking tasks and get notified back thru completion_notify interface.

Definition at line 62 of file completion_notify.h.

Constructor & Destructor Documentation

completion_notify_receiver::~completion_notify_receiver ( )

Definition at line 57 of file completion_notify.cpp.

57  {
59 }

Member Function Documentation

completion_notify::ptr completion_notify_receiver::create_or_get_task ( unsigned  p_id)

Definition at line 28 of file completion_notify.cpp.

28  {
30  if (!m_tasks.query(p_id,ptr)) {
31  ptr = completion_notify_create(this,p_id);
32  m_tasks.set(p_id,ptr);
33  }
34  return ptr;
35 }
service_nnptr_t< completion_notify_orphanable > completion_notify_create(t_receiver *p_receiver, unsigned p_taskid)
pfc::map_t< unsigned, completion_notify_orphanable_nnptr > m_tasks
completion_notify_ptr completion_notify_receiver::create_task ( unsigned  p_id)

Definition at line 37 of file completion_notify.cpp.

37  {
39  if (m_tasks.query(p_id,ptr)) ptr->orphan();
40  ptr = completion_notify_create(this,p_id);
41  m_tasks.set(p_id,ptr);
42  return ptr;
43 }
service_nnptr_t< completion_notify_orphanable > completion_notify_create(t_receiver *p_receiver, unsigned p_taskid)
pfc::map_t< unsigned, completion_notify_orphanable_nnptr > m_tasks
bool completion_notify_receiver::have_task ( unsigned  p_id) const

Definition at line 45 of file completion_notify.cpp.

45  {
46  return m_tasks.have_item(p_id);
47 }
pfc::map_t< unsigned, completion_notify_orphanable_nnptr > m_tasks
virtual void completion_notify_receiver::on_task_completion ( unsigned  p_id,
unsigned  p_status 
)
inlinevirtual

Reimplemented in CSimpleThread, and InPlaceEdit::CTableEditHelperV2.

Definition at line 71 of file completion_notify.h.

71 {}
void completion_notify_receiver::orphan_all_tasks ( )

Definition at line 61 of file completion_notify.cpp.

61  {
62  m_tasks.enumerate(orphanfunc);
63  m_tasks.remove_all();
64 }
static void orphanfunc(unsigned, completion_notify_orphanable_nnptr p_item)
pfc::map_t< unsigned, completion_notify_orphanable_nnptr > m_tasks
void completion_notify_receiver::orphan_task ( unsigned  p_id)

Definition at line 49 of file completion_notify.cpp.

49  {
51  if (m_tasks.query(p_id,ptr)) {
52  ptr->orphan();
53  m_tasks.remove(p_id);
54  }
55 }
pfc::map_t< unsigned, completion_notify_orphanable_nnptr > m_tasks
static void completion_notify_receiver::orphanfunc ( unsigned  ,
completion_notify_orphanable_nnptr  p_item 
)
inlinestaticprivate

Definition at line 73 of file completion_notify.h.

73 {p_item->orphan();}

Field Documentation

pfc::map_t<unsigned,completion_notify_orphanable_nnptr> completion_notify_receiver::m_tasks
private

Definition at line 74 of file completion_notify.h.


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