mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 08:46:44 +08:00
259 lines
16 KiB
HTML
259 lines
16 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-115514125-1"></script>
|
|
<script>
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag(){dataLayer.push(arguments);}
|
|
gtag('js', new Date());
|
|
|
|
gtag('config', 'UA-115514125-1');
|
|
</script>
|
|
|
|
|
|
<meta charset="UTF-8" />
|
|
<title>Transforms module | Continuable</title>
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
|
|
|
|
<link rel="stylesheet" href="m-dark+doxygen.compiled.css" />
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
|
|
|
|
<link rel="stylesheet" href="base.css" />
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
|
|
|
|
<link rel="stylesheet" href="terminal.css" />
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
|
|
|
|
<link rel="stylesheet" href="atom-one-dark.css" />
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta name="theme-color" content="#23373B" />
|
|
</head>
|
|
<body>
|
|
<header><nav id="navigation">
|
|
<div class="m-container">
|
|
<div class="m-row">
|
|
<a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">Continuable <span class="m-thin">3.0.0</span></a>
|
|
<div class="m-col-t-4 m-hide-m m-text-right m-nopadr">
|
|
<a href="#search" class="m-dox-search-icon" title="Search" onclick="return showSearch()"><svg viewBox="0 0 16 16">
|
|
<path d="m6 0c-3.3144 0-6 2.6856-6 6 0 3.3144 2.6856 6 6 6 1.4858 0 2.8463-0.54083 3.8945-1.4355-0.0164 0.33797 0.14734 0.75854 0.5 1.1504l3.2227 3.7891c0.55185 0.6139 1.4517 0.66544 2.002 0.11524 0.55022-0.55022 0.49866-1.4501-0.11524-2.002l-3.7891-3.2246c-0.39184-0.35266-0.81242-0.51469-1.1504-0.5 0.89472-1.0482 1.4355-2.4088 1.4355-3.8945 0-3.3128-2.6856-5.998-6-5.998zm0 1.5625a4.4375 4.4375 0 0 1 4.4375 4.4375 4.4375 4.4375 0 0 1-4.4375 4.4375 4.4375 4.4375 0 0 1-4.4375-4.4375 4.4375 4.4375 0 0 1 4.4375-4.4375z"/>
|
|
</svg></a>
|
|
<a id="m-navbar-show" href="#navigation" title="Show navigation"></a>
|
|
<a id="m-navbar-hide" href="#" title="Hide navigation"></a>
|
|
</div>
|
|
<div id="m-navbar-collapse" class="m-col-t-12 m-show-m m-col-m-none m-right-m">
|
|
<div class="m-row">
|
|
<ol class="m-col-t-6 m-col-m-none">
|
|
<li>
|
|
<a href="tutorial.html">Tutorial</a>
|
|
<ol>
|
|
<li><a href="tutorial-creating-continuables.html">Creating continuables</a></li>
|
|
<li><a href="tutorial-chaining-continuables.html">Chaining continuables</a></li>
|
|
<li><a href="tutorial-connecting-continuables.html">Connecting continuables</a></li>
|
|
<li><a href="tutorial-transforming-continuables.html">Transforming continuables</a></li>
|
|
<li><a href="tutorial-awaiting-continuables.html">Awaiting continuables</a></li>
|
|
<li><a href="tutorial-promisify-continuables.html">Promisify functions</a></li>
|
|
</ol>
|
|
</li>
|
|
<li>
|
|
<a href="pages.html">Pages</a>
|
|
<ol>
|
|
<li><a href="installation.html">Installation</a></li>
|
|
<li><a href="tutorial.html">Tutorial</a></li>
|
|
<li><a href="configuration.html">Configuration</a></li>
|
|
<li><a href="changelog.html">Changelog</a></li>
|
|
</ol>
|
|
</li>
|
|
<li>
|
|
<a href="modules.html">Modules</a>
|
|
<ol>
|
|
<li><a href="group___base.html">Base</a></li>
|
|
<li><a href="group___connections.html">Connections</a></li>
|
|
<li><a href="group___promisify.html">Promisify</a></li>
|
|
<li><a href="group___testing.html">Testing</a></li>
|
|
<li><a href="group___types.html">Types</a></li>
|
|
<li><a href="group___transforms.html" id="m-navbar-current">Transforms</a></li>
|
|
<li><a href="group___traversal.html">Traversal</a></li>
|
|
</ol>
|
|
</li>
|
|
</ol>
|
|
<ol class="m-col-t-6 m-col-m-none" start="4">
|
|
<li>
|
|
<a href="namespacecti.html">cti</a>
|
|
<ol>
|
|
<li><a href="namespacecti_1_1transforms.html">cti::transforms</a></li>
|
|
<li><a href="classcti_1_1continuable__base.html">cti::continuable_base</a></li>
|
|
<li><a href="classcti_1_1promise__base.html">cti::promise_base</a></li>
|
|
</ol>
|
|
</li>
|
|
<li class="m-show-m"><a href="#search" class="m-dox-search-icon" title="Search" onclick="return showSearch()"><svg viewBox="0 0 16 16">
|
|
<path d="m6 0c-3.3144 0-6 2.6856-6 6 0 3.3144 2.6856 6 6 6 1.4858 0 2.8463-0.54083 3.8945-1.4355-0.0164 0.33797 0.14734 0.75854 0.5 1.1504l3.2227 3.7891c0.55185 0.6139 1.4517 0.66544 2.002 0.11524 0.55022-0.55022 0.49866-1.4501-0.11524-2.002l-3.7891-3.2246c-0.39184-0.35266-0.81242-0.51469-1.1504-0.5 0.89472-1.0482 1.4355-2.4088 1.4355-3.8945 0-3.3128-2.6856-5.998-6-5.998zm0 1.5625a4.4375 4.4375 0 0 1 4.4375 4.4375 4.4375 4.4375 0 0 1-4.4375 4.4375 4.4375 4.4375 0 0 1-4.4375-4.4375 4.4375 4.4375 0 0 1 4.4375-4.4375z"/>
|
|
</svg> Search</a></li>
|
|
</ol>
|
|
<ol class="m-col-t-6 m-col-m-none">
|
|
<li>
|
|
<a href="https://github.com/Naios/continuable" aria-label="View source on Github"><i class="fa fa-github"></i> Code</a>
|
|
</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav></header>
|
|
<main><article>
|
|
<div class="m-container m-container-inflatable">
|
|
<div class="m-row">
|
|
<div class="m-col-l-10 m-push-l-1">
|
|
<h1>
|
|
Transforms <span class="m-thin">module</span></h1>
|
|
<p>provides utilities to convert <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />bases</a> to other types such as (<code>std::future</code>).</p>
|
|
<div class="m-block m-default">
|
|
<h3>Contents</h3>
|
|
<ul>
|
|
<li>
|
|
Reference
|
|
<ul>
|
|
<li><a href="#namespaces">Namespaces</a></li>
|
|
<li><a href="#typedef-members">Typedefs</a></li>
|
|
<li><a href="#func-members">Functions</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<section id="namespaces">
|
|
<h2><a href="#namespaces">Namespaces</a></h3>
|
|
<dl class="m-dox">
|
|
<dt>namespace <a href="namespacecti_1_1transforms.html" class="m-dox">cti::transforms</a></dt>
|
|
<dd>The namespace transforms declares callable objects that transform any <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> to an object or to a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> itself.</dd>
|
|
</dl>
|
|
</section>
|
|
<section id="typedef-members">
|
|
<h2><a href="#typedef-members">Typedefs</a></h3>
|
|
<dl class="m-dox">
|
|
<dt>
|
|
<div class="m-dox-template">template<typename T></div>
|
|
using <a href="#gad64ab92505da9dbc999ecc6f964d47c2" class="m-dox">transform</a> = detail::types::transform<T>
|
|
</dt>
|
|
<dd>A callable tag object which marks a wrapped callable object as continuable transformation which enables some useful overloads.</dd>
|
|
</dl>
|
|
</section>
|
|
<section id="func-members">
|
|
<h2><a href="#func-members">Functions</a></h3>
|
|
<dl class="m-dox">
|
|
<dt>
|
|
<div class="m-dox-template">template<typename T></div>
|
|
<span class="m-dox-wrap-bumper">auto <a href="#ga2383cf2e4cf7d8d43efeb25f790be006" class="m-dox">make_transform</a>(</span><span class="m-dox-wrap">T&& callable) -> auto</span>
|
|
</dt>
|
|
<dd>Wraps the given callable object into a transform class.</dd>
|
|
<dt>
|
|
<span class="m-dox-wrap-bumper">auto <a href="#gac698fd2486d980302cbd956fdeafdfde" class="m-dox">futurize</a>(</span><span class="m-dox-wrap">) -> auto</span>
|
|
</dt>
|
|
<dd>Returns a transform that if applied to a continuable, it will start the continuation chain and returns the asynchronous result as <code>std::future<...></code>.</dd>
|
|
<dt>
|
|
<span class="m-dox-wrap-bumper">auto <a href="#ga9b0b1ba047ea018c7f211ea14c6d2a64" class="m-dox">flatten</a>(</span><span class="m-dox-wrap">) -> auto</span>
|
|
</dt>
|
|
<dd>Returns a transform that if applied to a continuable, it will ignores all error which ocured until the point the transform was applied.</dd>
|
|
</dl>
|
|
</section>
|
|
<section>
|
|
<h2>Typedef documentation</h2>
|
|
<section class="m-dox-details" id="gad64ab92505da9dbc999ecc6f964d47c2"><div>
|
|
<h3>
|
|
<div class="m-dox-template">
|
|
template<typename T>
|
|
</div>
|
|
using <a href="#gad64ab92505da9dbc999ecc6f964d47c2" class="m-dox-self">transform</a> = detail::types::transform<T>
|
|
</h3>
|
|
<p>A callable tag object which marks a wrapped callable object as continuable transformation which enables some useful overloads.</p>
|
|
<aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
|
</div></section>
|
|
</section>
|
|
<section>
|
|
<h2>Function documentation</h2>
|
|
<section class="m-dox-details" id="ga2383cf2e4cf7d8d43efeb25f790be006"><div>
|
|
<h3>
|
|
<div class="m-dox-template">
|
|
template<typename T>
|
|
</div>
|
|
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga2383cf2e4cf7d8d43efeb25f790be006" class="m-dox-self">make_transform</a>(</span><span class="m-dox-wrap">T&& callable)</span></span>
|
|
</h3>
|
|
<p>Wraps the given callable object into a transform class.</p>
|
|
<aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
|
</div></section>
|
|
<section class="m-dox-details" id="gac698fd2486d980302cbd956fdeafdfde"><div>
|
|
<h3>
|
|
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#gac698fd2486d980302cbd956fdeafdfde" class="m-dox-self">futurize</a>(</span><span class="m-dox-wrap">)</span></span>
|
|
</h3>
|
|
<p>Returns a transform that if applied to a continuable, it will start the continuation chain and returns the asynchronous result as <code>std::future<...></code>.</p>
|
|
<table class="m-table m-fullwidth m-flat">
|
|
<tfoot>
|
|
<tr>
|
|
<th style="width: 1%">Returns</th>
|
|
<td><p>Returns a <code>std::future<...></code> which becomes ready as soon as the the continuation chain has finished. The signature of the future depends on the result type:</p><table class="m-table"><thead><tr><th>Continuation type</th><th>Return type</th></tr></thead><tbody><tr><td><code><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with <></code></td><td><code>std::future<void></code></td></tr><tr><td><code><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with <Arg></code></td><td><code>std::future<Arg></code></td></tr><tr><td><code><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with <Args...></code></td><td><code>std::future<std::tuple<Args...>></code></td></tr></tbody></table></td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
<aside class="m-note m-warning"><h4>Attention</h4><p>If exceptions are used, exceptions that are thrown, are forwarded to the returned future. If there are no exceptions supported, you shall not pass any errors to the end of the asynchronous call chain! Otherwise this will yield a trap that causes application exit.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>2.0.0</p></aside>
|
|
</div></section>
|
|
<section class="m-dox-details" id="ga9b0b1ba047ea018c7f211ea14c6d2a64"><div>
|
|
<h3>
|
|
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga9b0b1ba047ea018c7f211ea14c6d2a64" class="m-dox-self">flatten</a>(</span><span class="m-dox-wrap">)</span></span>
|
|
</h3>
|
|
<p>Returns a transform that if applied to a continuable, it will ignores all error which ocured until the point the transform was applied.</p>
|
|
<table class="m-table m-fullwidth m-flat">
|
|
<tfoot>
|
|
<tr>
|
|
<th style="width: 1%">Returns</th>
|
|
<td>Returns a continuable with the same signature as applied to.</td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
<aside class="m-note m-warning"><h4>Attention</h4><p>This can be used to create a continuable which doesn't resolve the continuation on errors.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>2.0.0</p></aside>
|
|
</div></section>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</article></main>
|
|
<div class="m-dox-search" id="search">
|
|
<a href="#!" onclick="return hideSearch()"></a>
|
|
<div class="m-container">
|
|
<div class="m-row">
|
|
<div class="m-col-m-8 m-push-m-2">
|
|
<div class="m-dox-search-header m-text m-small">
|
|
<div><span class="m-label m-default">Tab</span> / <span class="m-label m-default">T</span> to search, <span class="m-label m-default">Esc</span> to close</div>
|
|
<div id="search-symbolcount">…</div>
|
|
</div>
|
|
<div class="m-dox-search-content">
|
|
<input type="search" id="search-input" placeholder="Loading …" disabled="disabled" autofocus="autofocus" />
|
|
<noscript class="m-text m-danger m-text-center">Unlike everything else in the docs, the search functionality <em>requires</em> JavaScript.</noscript>
|
|
<div id="search-help" class="m-text m-dim m-text-center">
|
|
Search for symbols, directories, files, pages or modules. You can omit any
|
|
prefix from the symbol or file path; adding a <code>:</code> or <code>/</code>
|
|
suffix lists all members of given symbol or directory. Navigate through the
|
|
list using <span class="m-label m-dim">↓</span> and
|
|
<span class="m-label m-dim">↑</span>, press
|
|
<span class="m-label m-dim">Enter</span> to go.
|
|
</div>
|
|
<div id="search-notfound" class="m-text m-warning m-text-center">Sorry, nothing was found.</div>
|
|
<ul id="search-results"></ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="search.js"></script>
|
|
<script src="searchdata.js" async="async"></script>
|
|
<footer><nav>
|
|
<div class="m-container">
|
|
<div class="m-row">
|
|
<div class="m-col-l-10 m-push-l-1">
|
|
<b><a href="https://github.com/Naios/continuable">continuable</a></b> - C++14 allocation aware futures</br>Copyright 2015–2018 <a href="https://github.com/Naios">Denis Blank</a>. Contact the author via <a href="mailto:denis.blank@outlook.com">e-mail</a>.</br>Powered by <a href="http://doxygen.org/">Doxygen</a> and <a href="http://mcss.mosra.cz/">m.css</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav></footer>
|
|
</body>
|
|
</html> |