forked from David-Haim/concurrencpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* corotuine-promises refactured * addition of derivable_executor * remove result_core_base::reset_consumer * supprot for timer_queue shutdown * support await_via, resolve_via, make_exceptional_result null reference exception * test helpers refactoring * result::await(_via)/result::resolve(_via) tests refactoring * result::when_any tests, coroutine-tests improvements
- Loading branch information
1 parent
1dc07c0
commit 3bf27dc
Showing
61 changed files
with
1,780 additions
and
3,229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef CONCURRENCPP_DERIVABLE_EXECUTOR_H | ||
#define CONCURRENCPP_DERIVABLE_EXECUTOR_H | ||
|
||
#include "executor.h" | ||
|
||
namespace concurrencpp { | ||
template<class concrete_executor_type> | ||
class derivable_executor : public executor { | ||
|
||
private: | ||
concrete_executor_type* self() noexcept { | ||
return static_cast<concrete_executor_type*>(this); | ||
} | ||
|
||
public: | ||
derivable_executor(std::string_view name) : executor(name) {} | ||
|
||
template<class callable_type, class ... argument_types> | ||
void post(callable_type&& callable, argument_types&& ... arguments) { | ||
return do_post(self(), std::forward<callable_type>(callable), std::forward<argument_types>(arguments)...); | ||
} | ||
|
||
template<class callable_type, class ... argument_types> | ||
auto submit(callable_type&& callable, argument_types&& ... arguments) { | ||
return do_submit(self(), std::forward<callable_type>(callable), std::forward<argument_types>(arguments)...); | ||
} | ||
|
||
template<class callable_type> | ||
void bulk_post(std::span<callable_type> callable_list) { | ||
return do_bulk_post(self(), callable_list); | ||
} | ||
|
||
template<class callable_type, class return_type = std::invoke_result_t<callable_type>> | ||
std::vector<concurrencpp::result<return_type>> bulk_submit(std::span<callable_type> callable_list) { | ||
return do_bulk_submit(self(), callable_list); | ||
} | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.