Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
TaskDispatcherDelegate Class Referenceabstract

A class that defines the interface to the MIP SDK task dispatcher. More...

#include <src/api/mip/task_dispatcher_delegate.h>

Public Member Functions

virtual void CancelAllTasks ()=0
 Cancel all background tasks.
 
virtual bool CancelTask (const std::string &taskId)=0
 Cancel a background task.
 
virtual bool CancelTask (const std::string &taskId, const std::shared_ptr< void > &)
 Cancel a background task.
 
virtual void DispatchTask (const std::string &taskId, std::function< void()> task)=0
 Execute a task on a background thread.
 
virtual void DispatchTask (const std::string &taskId, std::function< void()> task, const std::shared_ptr< void > &)
 Execute a task on a background thread.
 
virtual void DispatchTask (const std::string &taskId, std::function< void()> task, int64_t delaySeconds)=0
 Execute a task on a background thread with the given delay.
 
virtual void DispatchTask (const std::string &taskId, std::function< void()> task, int64_t delaySeconds, const std::shared_ptr< void > &)
 Execute a task on a background thread with the given delay.
 
virtual void ExecuteTaskOnIndependentThread (const std::string &taskId, std::function< void()> task)=0
 Immediately execute a task on an independent thread.
 
virtual void ExecuteTaskOnIndependentThread (const std::string &taskId, std::function< void()> task, const std::shared_ptr< void > &)
 Immediately execute a task on an independent thread.
 

Detailed Description

A class that defines the interface to the MIP SDK task dispatcher.

Definition at line 48 of file task_dispatcher_delegate.h.

Member Function Documentation

◆ CancelAllTasks()

virtual void TaskDispatcherDelegate::CancelAllTasks ( )
pure virtual

Cancel all background tasks.

◆ CancelTask() [1/2]

virtual bool TaskDispatcherDelegate::CancelTask ( const std::string & taskId)
pure virtual

Cancel a background task.

Parameters
taskIdID of task to cancel
Returns
True if task was successfully cancelled, else false

Referenced by CancelTask().

◆ CancelTask() [2/2]

virtual bool TaskDispatcherDelegate::CancelTask ( const std::string & taskId,
const std::shared_ptr< void > &  )
inlinevirtual

Cancel a background task.

Parameters
taskIdID of task to cancel
loggerContextlogger context that should be used with the logger delegate for cancelation logging
Returns
True if task was successfully cancelled, else false

Definition at line 136 of file task_dispatcher_delegate.h.

136 {
137 return CancelTask(taskId);
138 }
virtual bool CancelTask(const std::string &taskId)=0
Cancel a background task.

References CancelTask().

◆ DispatchTask() [1/4]

virtual void TaskDispatcherDelegate::DispatchTask ( const std::string & taskId,
std::function< void()> task )
pure virtual

Execute a task on a background thread.

Parameters
taskIdID to uniquely identify a task
taskFunction to be executed

Referenced by DispatchTask(), and DispatchTask().

◆ DispatchTask() [2/4]

virtual void TaskDispatcherDelegate::DispatchTask ( const std::string & taskId,
std::function< void()> task,
const std::shared_ptr< void > &  )
inlinevirtual

Execute a task on a background thread.

Parameters
taskIdID to uniquely identify a task
taskFunction to be executed
loggerContextlogger context that should be used with the logger delegate before the task is run

Definition at line 65 of file task_dispatcher_delegate.h.

68 {
69 DispatchTask(taskId, task);
70 }
virtual void DispatchTask(const std::string &taskId, std::function< void()> task)=0
Execute a task on a background thread.

References DispatchTask().

◆ DispatchTask() [3/4]

virtual void TaskDispatcherDelegate::DispatchTask ( const std::string & taskId,
std::function< void()> task,
int64_t delaySeconds )
pure virtual

Execute a task on a background thread with the given delay.

Parameters
taskIdID to uniquely identify a task
taskFunction to be executed
delaySecondsDelay (in seconds) before executing task

◆ DispatchTask() [4/4]

virtual void TaskDispatcherDelegate::DispatchTask ( const std::string & taskId,
std::function< void()> task,
int64_t delaySeconds,
const std::shared_ptr< void > &  )
inlinevirtual

Execute a task on a background thread with the given delay.

Parameters
taskIdID to uniquely identify a task
taskFunction to be executed
delaySecondsDelay (in seconds) before executing task
loggerContextlogger context that should be used with the logger delegate before the task is run

Definition at line 89 of file task_dispatcher_delegate.h.

93 {
94 DispatchTask(taskId, task, delaySeconds);
95 }

References DispatchTask().

◆ ExecuteTaskOnIndependentThread() [1/2]

virtual void TaskDispatcherDelegate::ExecuteTaskOnIndependentThread ( const std::string & taskId,
std::function< void()> task )
pure virtual

Immediately execute a task on an independent thread.

Parameters
taskIdID to uniquely identify a task
taskFunction to be executed

Referenced by ExecuteTaskOnIndependentThread().

◆ ExecuteTaskOnIndependentThread() [2/2]

virtual void TaskDispatcherDelegate::ExecuteTaskOnIndependentThread ( const std::string & taskId,
std::function< void()> task,
const std::shared_ptr< void > &  )
inlinevirtual

Immediately execute a task on an independent thread.

Parameters
taskIdID to uniquely identify a task
taskFunction to be executed
loggerContextlogger context that should be used with the logger delegate before the task is run

Definition at line 112 of file task_dispatcher_delegate.h.

115 {
116 ExecuteTaskOnIndependentThread(taskId, task);
117 }
virtual void ExecuteTaskOnIndependentThread(const std::string &taskId, std::function< void()> task)=0
Immediately execute a task on an independent thread.

References ExecuteTaskOnIndependentThread().


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