16#ifndef dealii_task_result_h
17#define dealii_task_result_h
268 operator=(const
Task<T> &t);
318 template <typename Callable>
396 template <typename T>
402 std::lock_guard<std::mutex> lock(other.mutex);
405 other.result_is_available =
false;
407 task = std::move(other.task);
411 other.task_result.reset();
416 template <
typename T>
427 template <
typename T>
439 std::lock_guard<std::mutex> lock(
mutex);
445 template <
typename T>
456 std::lock_guard<std::mutex> lock(other.mutex);
459 other.result_is_available =
false;
461 task = std::move(other.task);
465 other.task_result.reset();
472 template <
typename T>
473 template <
typename Callable>
486 std::lock_guard<std::mutex> lock(
mutex);
492 if (
task.has_value())
502 template <
typename T>
506 std::lock_guard<std::mutex> lock(
mutex);
517 ExcMessage(
"You cannot destroy a TaskResult object "
518 "while it is still waiting for its associated task "
519 "to finish. See the documentation of this class' "
520 "destructor for more information."));
525 template <
typename T>
530 ExcMessage(
"You can't join a TaskResult object that has not "
531 "been associated with a task."));
543 std::lock_guard<std::mutex> lock(
mutex);
563 template <
typename T>
573 else if (
task.has_value())
584 std::lock_guard<std::mutex> lock(
mutex);
599 template <
typename T>
605 "You can't ask for the result of a TaskResult object that "
606 "has not been associated with a task."));
TaskResult(const TaskResult< T > &)=delete
TaskResult & operator=(const TaskResult &)=delete
std::optional< Task< T > > task
std::optional< T > task_result
TaskResult(const Task< T > &task)
void try_emplace_task(const Callable &creator) const
std::atomic< bool > result_is_available
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_CXX20_REQUIRES(condition)
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
Task< RT > new_task(const std::function< RT()> &function)