AWS IoT Device SDK C++ v2
1.45.1
AWS IoT Device SDK C++ v2
Toggle main menu visibility
Loading...
Searching...
No Matches
crt
aws-crt-cpp
include
aws
crt
io
EventLoopGroup.h
Go to the documentation of this file.
1
#pragma once
6
#include <
aws/crt/Types.h
>
7
8
#include <aws/io/event_loop.h>
9
10
#include <chrono>
11
#include <functional>
12
#include <memory>
13
14
namespace
Aws
15
{
16
namespace
Crt
17
{
18
namespace
Io
19
{
24
enum class
TaskStatus
25
{
26
RunReady
,
27
Canceled
,
28
};
29
34
class
AWS_CRT_CPP_API
ScheduledTask
final
35
{
36
public
:
37
ScheduledTask
() noexcept = default;
38
39
void
Cancel
() noexcept;
40
41
private:
42
class
Impl
;
43
44
explicit
ScheduledTask
(
std
::shared_ptr<
Impl
> impl) noexcept;
45
46
std
::shared_ptr<
Impl
> m_impl;
47
48
friend class
EventLoop
;
49
};
50
56
class
AWS_CRT_CPP_API
EventLoop final
57
{
58
public
:
62
explicit
operator
bool() const noexcept {
return
m_loop !=
nullptr
; }
63
69
ScheduledTask
Schedule(
70
std::function<
void
(
TaskStatus
)> &&task,
71
std::chrono::nanoseconds run_in)
noexcept
;
72
73
private
:
74
explicit
EventLoop
(aws_event_loop *loop)
noexcept
;
75
76
aws_event_loop *m_loop;
77
78
friend
class
ClientBootstrap
;
79
};
80
97
class
AWS_CRT_CPP_API
EventLoopGroup
final
98
{
99
public
:
105
EventLoopGroup
(uint16_t threadCount = 0,
Allocator
*allocator =
ApiAllocator
())
noexcept
;
112
EventLoopGroup
(uint16_t cpuGroup, uint16_t threadCount,
Allocator
*allocator =
ApiAllocator
())
noexcept
;
113
~EventLoopGroup
();
114
EventLoopGroup
(
const
EventLoopGroup
&) =
delete
;
115
EventLoopGroup
(
EventLoopGroup
&&) noexcept;
116
EventLoopGroup
&operator=(const
EventLoopGroup
&) = delete;
117
EventLoopGroup
&operator=(
EventLoopGroup
&&) noexcept;
118
122
operator
bool
() const;
123
127
int
LastError
() const;
128
130
aws_event_loop_group *GetUnderlyingHandle() noexcept;
131
132
private:
133
aws_event_loop_group *m_eventLoopGroup;
134
int
m_lastError;
135
};
136
}
// namespace Io
137
138
}
// namespace Crt
139
}
// namespace Aws
Types.h
Aws::Crt::Io::EventLoopGroup::LastError
int LastError() const
Definition
EventLoopGroup.cpp:61
Aws::Crt::Io::EventLoopGroup::EventLoopGroup
EventLoopGroup(uint16_t threadCount=0, Allocator *allocator=ApiAllocator()) noexcept
Definition
EventLoopGroup.cpp:18
Aws::Crt::Io::EventLoopGroup::EventLoopGroup
EventLoopGroup(const EventLoopGroup &)=delete
Aws::Crt::Io::EventLoop
Definition
EventLoopGroup.h:57
Aws::Crt::Io::EventLoop::ClientBootstrap
friend class ClientBootstrap
Definition
EventLoopGroup.h:78
Aws::Crt::Io::ScheduledTask::Impl
Definition
EventLoopGroup.cpp:82
Aws::Crt::Io::ScheduledTask
Definition
EventLoopGroup.h:35
Aws::Crt::Io::ScheduledTask::Cancel
void Cancel() noexcept
Definition
EventLoopGroup.cpp:148
Aws::Crt::Io::ScheduledTask::ScheduledTask
ScheduledTask() noexcept=default
Aws::Crt::Io::ScheduledTask::EventLoop
friend class EventLoop
Definition
EventLoopGroup.h:48
AWS_CRT_CPP_API
#define AWS_CRT_CPP_API
Definition
Exports.h:36
Aws::Crt::Io
Definition
Credentials.h:23
Aws::Crt::Io::TaskStatus
TaskStatus
Definition
EventLoopGroup.h:25
Aws::Crt::Io::TaskStatus::Canceled
@ Canceled
Definition
EventLoopGroup.h:27
Aws::Crt::Io::TaskStatus::RunReady
@ RunReady
Definition
EventLoopGroup.h:26
Aws::Crt
Definition
Allocator.h:13
Aws::Crt::ApiAllocator
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition
Allocator.cpp:24
Aws::Crt::Allocator
aws_allocator Allocator
Definition
Allocator.h:14
Aws
Definition
Allocator.h:11
std
Definition
StringView.h:862
Generated by
1.17.0