You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: example/vendor/cget/pkg/pqrs-org__cpp-osx-iokit_hid_manager/install/include/pqrs/osx/iokit_hid_manager.hpp
+1-13
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
#pragma once
2
2
3
-
// pqrs::osx::iokit_hid_manager v5.0
3
+
// pqrs::osx::iokit_hid_manager v6.0
4
4
5
5
// (C) Copyright Takayama Fumihiko 2018.
6
6
// Distributed under the Boost Software License, Version 1.0.
@@ -57,12 +57,6 @@ class iokit_hid_manager final : public dispatcher::extra::dispatcher_client {
Copy file name to clipboardExpand all lines: example/vendor/cget/pkg/pqrs-org__cpp-osx-iokit_service_monitor/install/include/pqrs/osx/iokit_service_monitor.hpp
+99-28
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
#pragma once
2
2
3
-
// pqrs::osx::iokit_service_monitor v5.0
3
+
// pqrs::osx::iokit_service_monitor v6.0
4
4
5
5
// (C) Copyright Takayama Fumihiko 2018.
6
6
// Distributed under the Boost Software License, Version 1.0.
7
-
// (See http://www.boost.org/LICENSE_1_0.txt)
7
+
// (See https://www.boost.org/LICENSE_1_0.txt)
8
8
9
9
// `pqrs::osx::iokit_service_monitor` can be used safely in a multi-threaded environment.
10
10
@@ -17,6 +17,7 @@
17
17
#include<pqrs/osx/iokit_registry_entry.hpp>
18
18
#include<pqrs/osx/iokit_types.hpp>
19
19
#include<pqrs/osx/kern_return.hpp>
20
+
#include<unordered_set>
20
21
21
22
namespacepqrs {
22
23
namespaceosx {
@@ -41,13 +42,16 @@ class iokit_service_monitor final : dispatcher::extra::dispatcher_client {
41
42
: dispatcher_client(weak_dispatcher),
42
43
run_loop_thread_(run_loop_thread),
43
44
matching_dictionary_(matching_dictionary),
44
-
notification_port_(nullptr) {
45
+
notification_port_(nullptr),
46
+
scan_timer_(*this) {
45
47
}
46
48
47
49
virtual~iokit_service_monitor(void) {
48
50
// dispatcher_client
49
51
50
-
detach_from_dispatcher();
52
+
detach_from_dispatcher([this] {
53
+
scan_timer_.stop();
54
+
});
51
55
52
56
// run_loop_thread
53
57
@@ -76,26 +80,6 @@ class iokit_service_monitor final : dispatcher::extra::dispatcher_client {
76
80
});
77
81
}
78
82
79
-
voidasync_invoke_service_matched(void) {
80
-
run_loop_thread_->enqueue(^{
81
-
if (*matching_dictionary_) {
82
-
io_iterator_t it = IO_OBJECT_NULL;
83
-
CFRetain(*matching_dictionary_);
84
-
kern_return r = IOServiceGetMatchingServices(type_safe::get(iokit_mach_port::null),
85
-
*matching_dictionary_,
86
-
&it);
87
-
if (!r) {
88
-
enqueue_to_dispatcher([this, r] {
89
-
error_occurred("IOServiceGetMatchingServices is failed.", r);
0 commit comments