iberbox  2.1.2
task.h
Go to the documentation of this file.
1 
10 #ifndef TASK_H
11 #define TASK_H
12 
13 #include "iberbox/config.h"
14 #include "iberbox/ownership.h"
15 #include "utils.h"
16 
17 #ifdef USE_SCAPIX
18 #include <scapix/bridge/object.h>
19 #endif
20 
21 namespace iberbox {
22 
27 class TaskManager : public SharedOwnership
28 #ifdef USE_SCAPIX
29  , public scapix::bridge::object<TaskManager>
30 #endif
31 {
32 public:
36  TaskManager();
41  TaskManager(std::function<void()> fireNotificationsRequested);
45  virtual ~TaskManager();
46 
51  virtual void onFireNotificationsRequested();
56  virtual void fireNotifications();
62  virtual void runTask(std::function<void()> callback);
63 
64 protected:
65  CallbackQueue mCallbackQueue;
66  std::function<void()> mFireNotificationsRequested;
67 };
68 
69 #ifdef USE_SCAPIX
70 typedef std::shared_ptr<TaskManager> TaskManagerType;
71 #else
73 #endif
74 
75 }
76 
77 #endif // TASK_H
The iberbox namespace.
Definition: task.h:21
virtual void fireNotifications()
virtual void runTask(std::function< void()> callback)
Puts the callback in a queue so as to run it in order of request.
The Task Manager class.
Definition: task.h:27
virtual void onFireNotificationsRequested()
TaskManager()
Constructs a new Task Manager object.
virtual ~TaskManager()
Destroys the Task Manager object.
TaskManager * TaskManagerType
Definition: task.h:72