remove unused methods from Task

This commit is contained in:
falsycat 2023-09-02 22:59:07 +09:00
parent bc7d6494cb
commit 98c03478ef
5 changed files with 0 additions and 27 deletions

View File

@ -163,7 +163,6 @@ class Context :
using TaskQueue::Push;
using TaskQueue::Wrap;
using TaskQueue::Exec;
using TaskQueue::ExecAnd;
Kind kind() const noexcept { return kind_; }

View File

@ -19,7 +19,6 @@
#include <vector>
#include "iface/common/exception.hh"
#include "iface/common/future.hh"
namespace nf7 {
@ -150,27 +149,6 @@ class TaskQueue : public std::enable_shared_from_this<TaskQueue<T>> {
};
}
// THREAD SAFE
template <typename R>
Future<R> ExecAnd(
std::function<R(Param)>&& f,
std::source_location loc = std::source_location::current()) noexcept {
return ExecAnd({}, std::move(f));
}
// THREAD SAFE
template <typename R>
Future<R> ExecAnd(
Future<R>::Completer&& cmp,
std::function<R(Param)>&& f,
std::source_location loc = std::source_location::current()) noexcept {
Future<R> future {cmp};
Push(Item { [f = std::move(f), cmp = std::move(cmp)](Param) mutable {
cmp.Exec(f);
}, loc});
return future;
}
// THREAD SAFE
void Exec(
std::function<void(Param)>&& f,
@ -202,7 +180,6 @@ class WrappedTaskQueue : public I {
using Inside::Wrap;
using Inside::Exec;
using Inside::ExecAnd;
private:
std::shared_ptr<Inside> q_;

View File

@ -128,7 +128,6 @@ TEST(WrappedTaskQueue, Push) {
// ensure all templates legal
(std::void_t<decltype(sut.Wrap([](auto){}))>) 0;
(std::void_t<decltype(sut.ExecAnd<uint32_t>([](auto){ return 0; }))>) 0;
(std::void_t<decltype(sut.Exec([](auto){}))>) 0;
}

View File

@ -17,7 +17,6 @@ class Concurrency :
using SyncTaskQueue::Push;
using SyncTaskQueue::Wrap;
using SyncTaskQueue::Exec;
using SyncTaskQueue::ExecAnd;
protected:
using SyncTaskQueue::shared_from_this;

View File

@ -17,7 +17,6 @@ class Parallelism :
using AsyncTaskQueue::Push;
using AsyncTaskQueue::Wrap;
using AsyncTaskQueue::Exec;
using AsyncTaskQueue::ExecAnd;
protected:
using AsyncTaskQueue::shared_from_this;