Chrysalis - CLO3D Extensions
Toggle main menu visibility
Loading...
Searching...
No Matches
TaskExecutor.h
Go to the documentation of this file.
1
#ifndef CHRYSALIS_TASKEXECUTOR_H
2
#define CHRYSALIS_TASKEXECUTOR_H
3
4
#include <memory>
5
#include <functional>
6
#include <shared_mutex>
7
#include <unordered_map>
8
9
#include "
BaseTask.h
"
10
#include "
CLO3DExtensionExport.h
"
11
12
namespace
CLO3D
{
13
class
CLO3D_EXTENSION
TaskExecutor
{
14
public
:
15
TaskExecutor
() =
default
;
16
17
TaskExecutor
(
const
TaskExecutor
&) =
delete
;
18
TaskExecutor
&
operator=
(
const
TaskExecutor
&) =
delete
;
19
20
void
wait
(
const
QString& task);
21
void
submit
(std::unique_ptr<BaseTask> task);
22
void
submit
(
23
std::unique_ptr<BaseTask> task,
24
const
std::function<
void
()>& onSuccess,
25
const
std::function<
void
(
const
BaseTaskException
&)>& onException = [](
const
BaseTaskException
&) ->
void
{}
26
);
27
private
:
28
std::shared_mutex mutex_;
29
std::unordered_map<std::string, std::unique_ptr<BaseTask>> tasks_{};
30
};
31
}
32
33
#endif
// CHRYSALIS_TASKEXECUTOR_H
BaseTask.h
CLO3DExtensionExport.h
CLO3D_EXTENSION
#define CLO3D_EXTENSION
Definition
CLO3DExtensionExport.h:12
CLO3D::BaseTaskException
Definition
BaseTaskException.h:12
CLO3D::TaskExecutor::TaskExecutor
TaskExecutor(const TaskExecutor &)=delete
CLO3D::TaskExecutor::TaskExecutor
TaskExecutor()=default
CLO3D::TaskExecutor::wait
void wait(const QString &task)
Definition
TaskExecutor.cpp:10
CLO3D::TaskExecutor::operator=
TaskExecutor & operator=(const TaskExecutor &)=delete
CLO3D::TaskExecutor::submit
void submit(std::unique_ptr< BaseTask > task)
Definition
TaskExecutor.cpp:21
CLO3D
Definition
BaseCommand.h:8
integrations
clo3d
include
TaskExecutor.h
Generated by
1.17.0