CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Async.hpp File Reference
#include "CeresEngine/Foundation/Chrono.hpp"
#include "CeresEngine/Foundation/Exception.hpp"
#include <continuable/continuable.hpp>
#include <continuable/external/asio.hpp>

Go to the source code of this file.

Namespaces

namespace  CeresEngine
 

Typedefs

template<typename... Args>
using CeresEngine::Async = cti::continuable< Args... >
 Defines a non-copyable continuation type which uses the function2 backend for type erasure.
 
template<typename... Args>
using CeresEngine::Promise = cti::promise< Args... >
 Defines a non-copyable promise type which is using the function2 backend for type erasure.
 
template<typename... Args>
using CeresEngine::AsyncResult = cti::result< Args... >
 The result class can carry the three kinds of results an asynchronous operation possibly can return, it's implemented in a variant like data structure which is also specialized to hold arbitrary arguments.
 

Functions

template<typename... Args, typename Continuation >
constexpr auto CeresEngine::async (Continuation &&continuation)
 Creates an Async from a promise/callback taking function.
 
template<typename... Args>
auto CeresEngine::async_ready (Args &&... args)
 Returns a continuable_base with no result which instantly resolves the promise with no values.
 
template<typename... Args, typename Exception >
constexpr auto CeresEngine::async_except (Exception &&exception)
 Returns a continuable_base with the parameterized result which instantly resolves the promise with the given error type.
 
template<typename Mapper , typename... T>
decltype(autoCeresEngine::async_map (Mapper &&mapper, T &&... pack)
 Maps the pack with the given mapper.
 
template<typename... T>
constexpr decltype(autoCeresEngine::async_spread (T &&... args)
 Indicate that the result shall be spread across the parent container if possible.
 
template<typename Mapper , typename... T>
void CeresEngine::async_traverse (Mapper &&mapper, T &&... pack)
 Traverses the pack with the given visitor.
 
auto CeresEngine::wait ()
 Awaits (and blocks) until the continuation has finished running.
 
template<class Rep , class Period >
auto CeresEngine::wait (const TTimeInterval< Rep, Period > &timeout)
 Awaits (and blocks) until the continuation has finished running.
 
template<class Clock , class Duration >
auto CeresEngine::wait (const TDate< Clock, Duration > &timeout)
 Awaits (and blocks) until the continuation has finished running.
 

Variables

constexpr cti::use_continuable_raw_t CeresEngine::useContinuable {}
 Special value for instance of use_continuable_raw_t which doesn't perform remapping of asio error codes and rethrows the raw error code.