Commit e284ba05 authored by Xavier Thompson's avatar Xavier Thompson

Move scheduler to typon/core

parent 0d0826da
#ifndef TYPON_CONTINUATION_HPP_INCLUDED
#define TYPON_CONTINUATION_HPP_INCLUDED
#ifndef TYPON_CORE_CONTINUATION_HPP_INCLUDED
#define TYPON_CORE_CONTINUATION_HPP_INCLUDED
#include <atomic>
#include <coroutine>
......@@ -8,7 +8,7 @@
#include <limits>
namespace typon
namespace typon::core
{
struct coroutine_node
......
#ifndef TYPON_FORK_HPP_INCLUDED
#define TYPON_FORK_HPP_INCLUDED
#ifndef TYPON_CORE_FORK_HPP_INCLUDED
#define TYPON_CORE_FORK_HPP_INCLUDED
#include <coroutine>
#include <cstdint>
#include <typon/continuation.hpp>
#include <typon/future.hpp>
#include <typon/result.hpp>
#include <typon/scheduler.hpp>
#include <typon/core/continuation.hpp>
#include <typon/core/future.hpp>
#include <typon/core/result.hpp>
#include <typon/core/scheduler.hpp>
namespace typon
namespace typon::core
{
template <typename T = void>
......
#ifndef TYPON_FUTURE_HPP_INCLUDED
#define TYPON_FUTURE_HPP_INCLUDED
#ifndef TYPON_CORE_FUTURE_HPP_INCLUDED
#define TYPON_CORE_FUTURE_HPP_INCLUDED
#include <coroutine>
#include <memory>
......@@ -9,10 +9,10 @@
#include <typon/fundamental/meta.hpp>
#include <typon/fundamental/scope.hpp>
#include <typon/result.hpp>
#include <typon/core/result.hpp>
namespace typon
namespace typon::core
{
template <typename Promise>
......
#ifndef TYPON_JOIN_HPP_INCLUDED
#define TYPON_JOIN_HPP_INCLUDED
#ifndef TYPON_CORE_JOIN_HPP_INCLUDED
#define TYPON_CORE_JOIN_HPP_INCLUDED
#include <coroutine>
#include <utility>
#include <typon/continuation.hpp>
#include <typon/result.hpp>
#include <typon/core/continuation.hpp>
#include <typon/core/result.hpp>
namespace typon
namespace typon::core
{
struct [[nodiscard]] Sync {};
......
#ifndef TYPON_RESULT_HPP_INCLUDED
#define TYPON_RESULT_HPP_INCLUDED
#ifndef TYPON_CORE_RESULT_HPP_INCLUDED
#define TYPON_CORE_RESULT_HPP_INCLUDED
#include <exception>
......@@ -8,7 +8,7 @@
#include <utility>
namespace typon
namespace typon::core
{
template <typename T>
......
#ifndef TYPON_ROOT_HPP_INCLUDED
#define TYPON_ROOT_HPP_INCLUDED
#ifndef TYPON_CORE_ROOT_HPP_INCLUDED
#define TYPON_CORE_ROOT_HPP_INCLUDED
#include <atomic>
#include <coroutine>
#include <cstdint>
//
#include <typon/continuation.hpp>
#include <typon/result.hpp>
#include <typon/scheduler.hpp>
#include <typon/core/continuation.hpp>
#include <typon/core/result.hpp>
#include <typon/core/scheduler.hpp>
namespace typon
namespace typon::core
{
struct [[nodiscard]] Root
......
#ifndef TYPON_SCHEDULER_HPP_INCLUDED
#define TYPON_SCHEDULER_HPP_INCLUDED
#ifndef TYPON_CORE_SCHEDULER_HPP_INCLUDED
#define TYPON_CORE_SCHEDULER_HPP_INCLUDED
#include <atomic>
#include <cstdint>
......@@ -12,10 +12,10 @@
#include <typon/fundamental/optional.hpp>
#include <typon/fundamental/random.hpp>
#include <typon/continuation.hpp>
#include <typon/core/continuation.hpp>
namespace typon
namespace typon::core
{
struct Scheduler
......
#ifndef TYPON_TASK_HPP_INCLUDED
#define TYPON_TASK_HPP_INCLUDED
#ifndef TYPON_CORE_TASK_HPP_INCLUDED
#define TYPON_CORE_TASK_HPP_INCLUDED
#include <coroutine>
#include <utility>
#include <typon/result.hpp>
#include <typon/core/result.hpp>
namespace typon
namespace typon::core
{
template <typename T = void>
......
#ifndef TYPON_TYPON_HPP_INCLUDED
#define TYPON_TYPON_HPP_INCLUDED
#include <utility>
#include <typon/core/fork.hpp>
#include <typon/core/future.hpp>
#include <typon/core/join.hpp>
#include <typon/core/root.hpp>
#include <typon/core/task.hpp>
namespace typon
{
template <typename T>
using Future = core::Future<T>;
template <typename T>
using Join = core::Join<T>;
using Root = core::Root;
using Sync = core::Sync;
template <typename T>
using Task = core::Task<T>;
template <typename Task>
core::Fork<typename Task::promise_type::value_type> fork(Task task)
{
co_return co_await std::move(task);
}
}
#endif // TYPON_TYPON_HPP_INCLUDED
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment