diff --git a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher.hpp b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher.hpp index 77efa94d4..f3c97bcce 100644 --- a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher.hpp +++ b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher.hpp @@ -1,10 +1,10 @@ #pragma once -// pqrs::dispatcher v2.11 +// pqrs::dispatcher v2.12 // (C) Copyright Takayama Fumihiko 2018. // Distributed under the Boost Software License, Version 1.0. -// (See http://www.boost.org/LICENSE_1_0.txt) +// (See https://www.boost.org/LICENSE_1_0.txt) #include "dispatcher/dispatcher.hpp" #include "dispatcher/object_id.hpp" diff --git a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/dispatcher.hpp b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/dispatcher.hpp index b9e037b83..789092034 100644 --- a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/dispatcher.hpp +++ b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/dispatcher.hpp @@ -2,7 +2,7 @@ // (C) Copyright Takayama Fumihiko 2018. // Distributed under the Boost Software License, Version 1.0. -// (See http://www.boost.org/LICENSE_1_0.txt) +// (See https://www.boost.org/LICENSE_1_0.txt) // `pqrs::dispatcher::dispatcher` can be used safely in a multi-threaded environment. diff --git a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/dispatcher_client.hpp b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/dispatcher_client.hpp index 644be366d..a012a5504 100644 --- a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/dispatcher_client.hpp +++ b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/dispatcher_client.hpp @@ -2,7 +2,7 @@ // (C) Copyright Takayama Fumihiko 2018. // Distributed under the Boost Software License, Version 1.0. -// (See http://www.boost.org/LICENSE_1_0.txt) +// (See https://www.boost.org/LICENSE_1_0.txt) // `pqrs::dispatcher::extra::dispatcher_client` can be used safely in a multi-threaded environment. diff --git a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/shared_dispatcher.hpp b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/shared_dispatcher.hpp index b30d2a64e..0d8c06558 100644 --- a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/shared_dispatcher.hpp +++ b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/shared_dispatcher.hpp @@ -2,7 +2,7 @@ // (C) Copyright Takayama Fumihiko 2018. // Distributed under the Boost Software License, Version 1.0. -// (See http://www.boost.org/LICENSE_1_0.txt) +// (See https://www.boost.org/LICENSE_1_0.txt) // `pqrs::dispatcher::extra::shared_dispatcher` can be used safely in a multi-threaded environment. diff --git a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/timer.hpp b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/timer.hpp index 2c8c969fc..fcdd79e0d 100644 --- a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/timer.hpp +++ b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/extra/timer.hpp @@ -2,11 +2,12 @@ // (C) Copyright Takayama Fumihiko 2018. // Distributed under the Boost Software License, Version 1.0. -// (See http://www.boost.org/LICENSE_1_0.txt) +// (See https://www.boost.org/LICENSE_1_0.txt) // `pqrs::dispatcher::extra::timer` can be used safely in a multi-threaded environment. #include "dispatcher_client.hpp" +#include namespace pqrs { namespace dispatcher { @@ -23,7 +24,8 @@ class timer final { public: timer(dispatcher_client& dispatcher_client) : dispatcher_client_(dispatcher_client), current_function_id_(0), - interval_(0) { + interval_(0), + enabled_(false) { } ~timer(void) { @@ -35,6 +37,8 @@ class timer final { void start(std::function function, duration interval) { + enabled_ = true; + dispatcher_client_.enqueue_to_dispatcher([this, function, interval] { ++current_function_id_; function_ = function; @@ -45,6 +49,8 @@ class timer final { } void stop(void) { + enabled_ = false; + dispatcher_client_.enqueue_to_dispatcher([this] { ++current_function_id_; function_ = nullptr; @@ -52,6 +58,10 @@ class timer final { }); } + bool enabled(void) const { + return enabled_; + } + private: // This method is executed in the dispatcher thread. void call_function(int function_id) { @@ -80,6 +90,8 @@ class timer final { int current_function_id_; std::function function_; duration interval_; + + std::atomic enabled_; }; } // namespace extra } // namespace dispatcher diff --git a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/object_id.hpp b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/object_id.hpp index 8dfe6cfc0..b80ac6c3f 100644 --- a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/object_id.hpp +++ b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/object_id.hpp @@ -2,7 +2,7 @@ // (C) Copyright Takayama Fumihiko 2018. // Distributed under the Boost Software License, Version 1.0. -// (See http://www.boost.org/LICENSE_1_0.txt) +// (See https://www.boost.org/LICENSE_1_0.txt) // `pqrs::dispatcher::object_id` can be used safely in a multi-threaded environment. diff --git a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/time_source.hpp b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/time_source.hpp index 8b140af9b..b4ef370e6 100644 --- a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/time_source.hpp +++ b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/time_source.hpp @@ -2,7 +2,7 @@ // (C) Copyright Takayama Fumihiko 2018. // Distributed under the Boost Software License, Version 1.0. -// (See http://www.boost.org/LICENSE_1_0.txt) +// (See https://www.boost.org/LICENSE_1_0.txt) // `pqrs::dispatcher::hardware_time_source` can be used safely in a multi-threaded environment. // `pqrs::dispatcher::pseudo_time_source` can be used safely in a multi-threaded environment. diff --git a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/types.hpp b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/types.hpp index a246c1c3b..0db6bb9d8 100644 --- a/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/types.hpp +++ b/src/vendor/cget/cget/pkg/pqrs-org__cpp-dispatcher/install/include/pqrs/dispatcher/types.hpp @@ -2,7 +2,7 @@ // (C) Copyright Takayama Fumihiko 2018. // Distributed under the Boost Software License, Version 1.0. -// (See http://www.boost.org/LICENSE_1_0.txt) +// (See https://www.boost.org/LICENSE_1_0.txt) #include