From 3caa4f5ab7b99bddf0ff2f5c8e81624966dfc879 Mon Sep 17 00:00:00 2001 From: falsycat Date: Sun, 30 Jul 2023 00:02:46 +0900 Subject: [PATCH] expose Task::shared_from_this() to child classes --- iface/common/task.hh | 2 +- iface/subsys/concurrency.hh | 3 +++ iface/subsys/parallelism.hh | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/iface/common/task.hh b/iface/common/task.hh index c073b50..e9cb12e 100644 --- a/iface/common/task.hh +++ b/iface/common/task.hh @@ -178,7 +178,7 @@ class TaskQueue : public std::enable_shared_from_this> { Push(Item {std::move(f), loc}); } - private: + protected: using std::enable_shared_from_this>::shared_from_this; }; diff --git a/iface/subsys/concurrency.hh b/iface/subsys/concurrency.hh index 2f88d3f..8d56917 100644 --- a/iface/subsys/concurrency.hh +++ b/iface/subsys/concurrency.hh @@ -18,6 +18,9 @@ class Concurrency : using SyncTaskQueue::Wrap; using SyncTaskQueue::Exec; using SyncTaskQueue::ExecAnd; + + protected: + using SyncTaskQueue::shared_from_this; }; } // namespace nf7::subsys diff --git a/iface/subsys/parallelism.hh b/iface/subsys/parallelism.hh index c88b8c8..b1c5e9f 100644 --- a/iface/subsys/parallelism.hh +++ b/iface/subsys/parallelism.hh @@ -18,6 +18,9 @@ class Parallelism : using AsyncTaskQueue::Wrap; using AsyncTaskQueue::Exec; using AsyncTaskQueue::ExecAnd; + + protected: + using AsyncTaskQueue::shared_from_this; }; } // namespace nf7::subsys