AWS SDK for C++
AWS SDK for C++ Version 1.11.929
Main Page
Related Pages
Namespaces
Classes
Modules
Loading...
Searching...
No Matches
src
aws-cpp-sdk-core
include
aws
core
utils
threading
Executor.h
1
6
#pragma once
7
#if !defined(AWS_EXECUTOR_H)
8
#define AWS_EXECUTOR_H
9
10
#include <aws/core/Core_EXPORTS.h>
11
12
#include <functional>
13
14
namespace
Aws
15
{
16
namespace
Utils
17
{
18
namespace
Threading
19
{
24
class
AWS_CORE_API
Executor
25
{
26
public
:
27
virtual
~Executor
() =
default
;
28
32
template
<
class
Fn,
class
... Args>
33
bool
Submit
(Fn&& fn, Args&& ... args)
34
{
35
std::function<void()> callable{ std::bind(std::forward<Fn>(fn), std::forward<Args>(args)...) };
36
return
SubmitToThread(std::move(callable));
37
}
38
39
/* explicit _overload_ of the template function above to avoid template bloat */
40
bool
Submit
(std::function<
void
()>&& callable)
41
{
42
return
SubmitToThread(std::move(callable));
43
}
44
48
virtual
void
WaitUntilStopped
() {
return
; };
49
50
protected
:
54
virtual
bool
SubmitToThread
(std::function<
void
()>&&) = 0;
55
};
56
}
// namespace Threading
57
}
// namespace Utils
58
}
// namespace Aws
59
60
// TODO: remove on a next minor API bump from 1.11.x
61
#endif
// !defined(AWS_EXECUTOR_H)
62
#include <aws/core/utils/threading/DefaultExecutor.h>
63
#include <aws/core/utils/threading/PooledThreadExecutor.h>
Aws::Utils::Threading::Executor
Definition
Executor.h:25
Aws::Utils::Threading::Executor::Submit
bool Submit(Fn &&fn, Args &&... args)
Definition
Executor.h:33
Aws::Utils::Threading::Executor::Submit
bool Submit(std::function< void()> &&callable)
Definition
Executor.h:40
Aws::Utils::Threading::Executor::SubmitToThread
virtual bool SubmitToThread(std::function< void()> &&)=0
Aws::Utils::Threading::Executor::~Executor
virtual ~Executor()=default
Aws::Utils::Threading::Executor::WaitUntilStopped
virtual void WaitUntilStopped()
Definition
Executor.h:48
Aws
Definition
AmazonSerializableWebServiceRequest.h:16
Generated by
1.12.0
Privacy |
Site terms |
Cookie preferences