|
|
Go to the documentation of this file. 1 #ifndef FWCore_Concurrency_chain_first_h
2 #define FWCore_Concurrency_chain_first_h
27 #include <type_traits>
36 namespace waiting_task::detail {
38 template <
class,
class =
void>
43 std::void_t<decltype(std::declval<T&>()(
44 static_cast<std::exception_ptr const*>(nullptr), edm::WaitingTaskHolder()))>>
56 h.doneWaiting(std::current_exception());
65 template <
typename E,
typename F>
75 h.doneWaiting(std::current_exception());
101 template <
typename...
T>
104 template <
typename F>
107 template <
typename F>
111 template <
typename...
T>
120 template <
typename F>
124 template <
typename...
T>
136 template <
typename...
T>
148 template <
typename...
T>
157 template <
typename U>
171 template <
typename V>
180 template <
typename U,
typename...
T>
183 : l_(
std::
move(iL)), f_{std::forward<U>(iU)} {}
201 template <
typename V>
211 template <
typename U,
typename...
T>
214 : l_(
std::
move(iL)), f_{std::forward<U>(iU)}, condition_(iCondition) {}
217 : l_(
std::
move(iL)), f_{std::move<U>(iC.f_)}, condition_(iC.condition_) {}
227 return l_.lastTask(iV);
242 template <
typename V>
254 namespace waiting_task::chain {
259 template <
typename F>
260 [[nodiscard]] constexpr
auto first(
F&& iF) {
263 return WaitingTaskChain<F>(std::forward<F>(iF));
265 return WaitingTaskChain<AutoExceptionHandler<F>>(AutoExceptionHandler<F>(std::forward<F>(iF)));
276 template <
typename O>
277 [[nodiscard]] constexpr
auto then(O&& iO) {
280 return ThenAdaptor<O>(std::forward<O>(iO));
282 return ThenAdaptor<AutoExceptionHandler<O>>(AutoExceptionHandler<O>(std::forward<O>(iO)));
287 template <
typename O>
288 [[nodiscard]] constexpr
auto ifThen(
bool iValue, O&& iO) {
291 return ConditionalAdaptor<O>(iValue, std::forward<O>(iO));
293 return ConditionalAdaptor<AutoExceptionHandler<O>>(iValue, AutoExceptionHandler<O>(std::forward<O>(iO)));
306 template <
typename E>
friend auto operator|(WaitingTaskChain< Conditional< U >, T... > iChain, V &&iV)
edm::WaitingTaskHolder task_
WaitingTaskHolder lastTask(WaitingTaskHolder iV)
WaitingTaskChain< T... > l_
WaitingTaskChain< T... > l_
constexpr WaitingTaskChain(U &&iU, WaitingTaskChain< T... > iL)
constexpr auto first(F &&iF)
constexpr ThenAdaptor(F &&iF)
friend auto operator|(WaitingTaskChain< U > iChain, V &&iV)
WaitingTaskHolder lastTask(WaitingTaskHolder iV)
constexpr auto pipe(WaitingTaskChain< T... > &&iChain)
ExplicitExceptionHandler(E &&iE, F &&iF)
auto runLast(edm::WaitingTaskHolder iTask)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
void runLast(WaitingTaskHolder iV)
constexpr auto then(O &&iO)
constexpr ConditionalAdaptor(bool iCond, F &&iF)
RunLastAdaptor(edm::WaitingTaskHolder iT)
friend auto operator|(WaitingTaskChain< U, T... > iChain, V &&iV)
edm::WaitingTaskHolder task_
AutoExceptionHandler(F &&iF)
constexpr WaitingTaskChain(U &&iU)
auto lastTask(edm::WaitingTaskHolder iTask)
FunctorWaitingTask< F > * make_waiting_task(F f)
void operator()(std::exception_ptr const *iPtr, edm::WaitingTaskHolder h) noexcept
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t V
void runLast(WaitingTaskHolder iV)
WaitingTaskHolder lastTask(WaitingTaskHolder iV)
constexpr auto pipe(WaitingTaskChain< T... > iChain)
constexpr IfExceptionAdapter(E &&iE)
constexpr WaitingTaskChain(bool iCondition, U &&iU, WaitingTaskChain< T... > iL)
void operator()(std::exception_ptr const *iPtr, edm::WaitingTaskHolder h) noexcept
constexpr WaitingTaskChain(Conditional< U > iC, WaitingTaskChain< T... > iL)
constexpr void pipe(WaitingTaskChain< T... > &&iChain)
constexpr auto ifThen(bool iValue, O &&iO)
Only runs this task if the condition (which is known at the call time) is true. If false,...
LastTaskAdaptor(edm::WaitingTaskHolder iT)
constexpr auto pipe(WaitingTaskChain< T... > iChain)
constexpr auto else_(F &&iF)
void runLast(WaitingTaskHolder iH)
tbb::task_group * group() const noexcept
constexpr auto ifException(E &&iE)