Skip to content

Commit ad0b273

Browse files
committed
Update vendor
1 parent 492651c commit ad0b273

File tree

6 files changed

+75
-3
lines changed

6 files changed

+75
-3
lines changed

Diff for: example-app/vendor/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
// pqrs::dispatcher v2.12
3+
// pqrs::dispatcher v2.13
44

55
// (C) Copyright Takayama Fumihiko 2018.
66
// Distributed under the Boost Software License, Version 1.0.

Diff for: example-app/vendor/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/timer.hpp

+24
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class timer final {
3535
}
3636
}
3737

38+
// First, `function` is called once, and then `function` is called every interval specified by `interval`.
3839
void start(std::function<void(void)> function,
3940
duration interval) {
4041
enabled_ = true;
@@ -62,6 +63,25 @@ class timer final {
6263
return enabled_;
6364
}
6465

66+
// Update the interval.
67+
// Any `function` call reserved before calling this method will be canceled, and the `function` will be called after `interval` duration.
68+
//
69+
// Special cases:.
70+
// - If `interval` == duration(0), this method works same as `stop`.
71+
// - If `interval` is same as the current interval, this method does nothing.
72+
void set_interval(duration interval) {
73+
if (interval == duration(0)) {
74+
stop();
75+
} else if (interval != interval_) {
76+
dispatcher_client_.enqueue_to_dispatcher([this, interval] {
77+
++current_function_id_;
78+
interval_ = interval;
79+
80+
enqueue(current_function_id_);
81+
});
82+
}
83+
}
84+
6585
private:
6686
// This method is executed in the dispatcher thread.
6787
void call_function(int function_id) {
@@ -79,6 +99,10 @@ class timer final {
7999
});
80100
}
81101

102+
enqueue(function_id);
103+
}
104+
105+
void enqueue(int function_id) {
82106
dispatcher_client_.enqueue_to_dispatcher(
83107
[this, function_id] {
84108
call_function(function_id);

Diff for: example/vendor/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
// pqrs::dispatcher v2.12
3+
// pqrs::dispatcher v2.13
44

55
// (C) Copyright Takayama Fumihiko 2018.
66
// Distributed under the Boost Software License, Version 1.0.

Diff for: example/vendor/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/timer.hpp

+24
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class timer final {
3535
}
3636
}
3737

38+
// First, `function` is called once, and then `function` is called every interval specified by `interval`.
3839
void start(std::function<void(void)> function,
3940
duration interval) {
4041
enabled_ = true;
@@ -62,6 +63,25 @@ class timer final {
6263
return enabled_;
6364
}
6465

66+
// Update the interval.
67+
// Any `function` call reserved before calling this method will be canceled, and the `function` will be called after `interval` duration.
68+
//
69+
// Special cases:.
70+
// - If `interval` == duration(0), this method works same as `stop`.
71+
// - If `interval` is same as the current interval, this method does nothing.
72+
void set_interval(duration interval) {
73+
if (interval == duration(0)) {
74+
stop();
75+
} else if (interval != interval_) {
76+
dispatcher_client_.enqueue_to_dispatcher([this, interval] {
77+
++current_function_id_;
78+
interval_ = interval;
79+
80+
enqueue(current_function_id_);
81+
});
82+
}
83+
}
84+
6585
private:
6686
// This method is executed in the dispatcher thread.
6787
void call_function(int function_id) {
@@ -79,6 +99,10 @@ class timer final {
7999
});
80100
}
81101

102+
enqueue(function_id);
103+
}
104+
105+
void enqueue(int function_id) {
82106
dispatcher_client_.enqueue_to_dispatcher(
83107
[this, function_id] {
84108
call_function(function_id);

Diff for: tests/vendor/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
// pqrs::dispatcher v2.12
3+
// pqrs::dispatcher v2.13
44

55
// (C) Copyright Takayama Fumihiko 2018.
66
// Distributed under the Boost Software License, Version 1.0.

Diff for: tests/vendor/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/timer.hpp

+24
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class timer final {
3535
}
3636
}
3737

38+
// First, `function` is called once, and then `function` is called every interval specified by `interval`.
3839
void start(std::function<void(void)> function,
3940
duration interval) {
4041
enabled_ = true;
@@ -62,6 +63,25 @@ class timer final {
6263
return enabled_;
6364
}
6465

66+
// Update the interval.
67+
// Any `function` call reserved before calling this method will be canceled, and the `function` will be called after `interval` duration.
68+
//
69+
// Special cases:.
70+
// - If `interval` == duration(0), this method works same as `stop`.
71+
// - If `interval` is same as the current interval, this method does nothing.
72+
void set_interval(duration interval) {
73+
if (interval == duration(0)) {
74+
stop();
75+
} else if (interval != interval_) {
76+
dispatcher_client_.enqueue_to_dispatcher([this, interval] {
77+
++current_function_id_;
78+
interval_ = interval;
79+
80+
enqueue(current_function_id_);
81+
});
82+
}
83+
}
84+
6585
private:
6686
// This method is executed in the dispatcher thread.
6787
void call_function(int function_id) {
@@ -79,6 +99,10 @@ class timer final {
7999
});
80100
}
81101

102+
enqueue(function_id);
103+
}
104+
105+
void enqueue(int function_id) {
82106
dispatcher_client_.enqueue_to_dispatcher(
83107
[this, function_id] {
84108
call_function(function_id);

0 commit comments

Comments
 (0)