mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 08:46:44 +08:00
294 lines
19 KiB
HTML
294 lines
19 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
|
|
|
|
<meta charset="UTF-8" />
|
|
<title>Primitives 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">4.1.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 style="height: 0.9rem;" 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">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 style="height: 0.9rem;" 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>
|
|
Primitives <span class="m-thin">module</span></h1>
|
|
<p>provides basic tag types for creating a customized callbacks and continuations.</p>
|
|
<div class="m-block m-default">
|
|
<h3>Contents</h3>
|
|
<ul>
|
|
<li>
|
|
Reference
|
|
<ul>
|
|
<li><a href="#nested-classes">Classes</a></li>
|
|
<li><a href="#typedef-members">Typedefs</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<p>For the callback and the continuation <code>Args...</code> represents the asynchronous result:</p><pre class="m-code"><span class="k">template</span><span class="o"><</span><span class="k">typename</span><span class="p">...</span> <span class="n">Args</span><span class="o">></span>
|
|
<span class="k">struct</span> <span class="n">continuation</span> <span class="p">{</span>
|
|
<span class="kt">void</span> <span class="k">operator</span><span class="p">()</span> <span class="p">(</span><span class="n">callback</span><span class="o"><</span><span class="n">Args</span><span class="p">...</span><span class="o">></span><span class="p">);</span>
|
|
<span class="kt">bool</span> <span class="nf">operator</span><span class="p">()</span> <span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">is_ready_arg_t</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
|
|
<span class="n">result</span><span class="o"><</span><span class="n">Args</span><span class="p">...</span><span class="o">></span> <span class="k">operator</span><span class="p">()</span> <span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">unpack_arg_t</span><span class="p">);</span>
|
|
<span class="p">};</span></pre><pre class="m-code"><span class="k">template</span><span class="o"><</span><span class="k">typename</span><span class="p">...</span> <span class="n">Args</span><span class="o">></span>
|
|
<span class="k">struct</span> <span class="n">callback</span> <span class="p">{</span>
|
|
<span class="kt">void</span> <span class="k">operator</span><span class="p">()</span> <span class="p">(</span><span class="n">Args</span><span class="p">...)</span> <span class="o">&&</span><span class="p">;</span>
|
|
<span class="kt">void</span> <span class="nf">operator</span><span class="p">()</span> <span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">exception_arg_t</span><span class="p">,</span> <span class="n">cti</span><span class="o">::</span><span class="n">exception_t</span><span class="p">)</span> <span class="o">&&</span><span class="p">;</span>
|
|
<span class="p">};</span></pre>
|
|
<section id="nested-classes">
|
|
<h2><a href="#nested-classes">Classes</a></h2>
|
|
<dl class="m-dox">
|
|
<dt>
|
|
struct <a href="structcti_1_1is__ready__arg__t.html" class="m-dox">cti::is_ready_arg_t</a>
|
|
</dt>
|
|
<dd>Represents the tag type that is used to query the continuation for whether it resolves the callback instantly with its arguments without having side effects.</dd>
|
|
<dt>
|
|
struct <a href="structcti_1_1unpack__arg__t.html" class="m-dox">cti::unpack_arg_t</a>
|
|
</dt>
|
|
<dd>Represents the tag type that is used to unpack the result of a continuation.</dd>
|
|
<dt>
|
|
struct <a href="structcti_1_1exception__arg__t.html" class="m-dox">cti::exception_arg_t</a>
|
|
</dt>
|
|
<dd>Represents the tag type that is used to disambiguate the callback operator() in order to take the exception asynchronous chain.</dd>
|
|
</dl>
|
|
</section>
|
|
<section id="typedef-members">
|
|
<h2><a href="#typedef-members">Typedefs</a></h2>
|
|
<dl class="m-dox">
|
|
<dt>
|
|
<div class="m-dox-template">template<typename... Args></div>
|
|
using <a href="#ga0471bc4c43101c3f077c0601c617abce" class="m-dox">signature_arg_t</a> = detail::identity<Args...>
|
|
</dt>
|
|
<dd>Represents the tag type that is used to specify the signature hint of a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> or <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a>.</dd>
|
|
<dt>
|
|
using <a href="#ga2d717de3efb8ff74889a603bf141cbad" class="m-dox">query_arg_t</a> = unpack_arg_t <span class="m-label m-danger">deprecated</span>
|
|
</dt>
|
|
<dd>Represents the tag type that is used to unpack the result of a continuation.</dd>
|
|
<dt>
|
|
using <a href="#gab374e033adf83bc3883410b9857cca41" class="m-dox">dispatch_error_tag</a> = exception_arg_t <span class="m-label m-danger">deprecated</span>
|
|
</dt>
|
|
<dd>Represents the tag type that is used to disambiguate the callback operator() in order to take the exception asynchronous chain.</dd>
|
|
<dt>
|
|
using <a href="#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_t</a> = detail::types::exception_t
|
|
</dt>
|
|
<dd>Represents the type that is used as exception type.</dd>
|
|
<dt>
|
|
using <a href="#ga0220315293d1e2ebbda6be95fb3b2eeb" class="m-dox">error_type</a> = exception_t <span class="m-label m-danger">deprecated</span>
|
|
</dt>
|
|
<dd>Represents the type that is used as exception type.</dd>
|
|
<dt>
|
|
<div class="m-dox-template">template<typename T></div>
|
|
using <a href="#gadd542364566ec6cc22a4b92c47889443" class="m-dox">plain_t</a> = detail::types::plain_tag<T>
|
|
</dt>
|
|
<dd>Represents the type that is used to disable the special meaning of types which are returned by a asynchronous result handler. See cti::plain for details.</dd>
|
|
</dl>
|
|
</section>
|
|
<section>
|
|
<h2>Typedef documentation</h2>
|
|
<section class="m-dox-details" id="ga0471bc4c43101c3f077c0601c617abce"><div>
|
|
<h3>
|
|
<div class="m-dox-template">
|
|
template<typename... Args>
|
|
</div>
|
|
using <a href="#ga0471bc4c43101c3f077c0601c617abce" class="m-dox-self">signature_arg_t</a> = detail::identity<Args...>
|
|
</h3>
|
|
<p>Represents the tag type that is used to specify the signature hint of a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> or <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a>.</p>
|
|
<aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
|
</div></section>
|
|
<section class="m-dox-details" id="ga2d717de3efb8ff74889a603bf141cbad"><div>
|
|
<h3>
|
|
typedef unpack_arg_t <a href="#ga2d717de3efb8ff74889a603bf141cbad" class="m-dox-self">query_arg_t</a>
|
|
</h3>
|
|
<p>Represents the tag type that is used to unpack the result of a continuation.</p>
|
|
<aside class="m-note m-warning"><h4>Attention</h4><p>It's required that the query of <a href="structcti_1_1is__ready__arg__t.html" class="m-dox">is_<wbr />ready_<wbr />arg_<wbr />t</a> returns true, otherwise the behaviour when unpacking is unspecified.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside><aside class="m-note m-danger"><h4><a href="deprecated.html#_deprecated000001" class="m-dox">Deprecated</a></h4><p>The query_arg_t was deprecated because of its new naming <a href="structcti_1_1unpack__arg__t.html" class="m-dox">unpack_<wbr />arg_<wbr />t</a>.</p></aside>
|
|
</div></section>
|
|
<section class="m-dox-details" id="gab374e033adf83bc3883410b9857cca41"><div>
|
|
<h3>
|
|
typedef exception_arg_t <a href="#gab374e033adf83bc3883410b9857cca41" class="m-dox-self">dispatch_error_tag</a>
|
|
</h3>
|
|
<p>Represents the tag type that is used to disambiguate the callback operator() in order to take the exception asynchronous chain.</p>
|
|
<aside class="m-note m-info"><h4>Note</h4><p>see <a href="classcti_1_1continuable__base.html#ad4960d0794abb800f1dfd9a668900149" class="m-dox">continuable::<wbr />next</a> for details.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside><aside class="m-note m-danger"><h4><a href="deprecated.html#_deprecated000002" class="m-dox">Deprecated</a></h4><p>The dispatch_error_tag was deprecated in order to move closer to the types specified in the "A Unified Future" proposal especially regarding naming types similar.</p></aside>
|
|
</div></section>
|
|
<section class="m-dox-details" id="ga9fa0d3597f70a7b9e763639f0b30dee1"><div>
|
|
<h3>
|
|
using <a href="#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox-self">exception_t</a> = detail::types::exception_t
|
|
</h3>
|
|
<p>Represents the type that is used as exception type.</p>
|
|
<p>By default this type deduces to <code>std::exception_ptr</code>. If <code>CONTINUABLE_WITH_NO_EXCEPTIONS</code> is defined the type will be a <code>std::error_condition</code>. A custom error type may be set through defining <code>CONTINUABLE_WITH_CUSTOM_ERROR_TYPE</code>.</p><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
|
</div></section>
|
|
<section class="m-dox-details" id="ga0220315293d1e2ebbda6be95fb3b2eeb"><div>
|
|
<h3>
|
|
typedef exception_t <a href="#ga0220315293d1e2ebbda6be95fb3b2eeb" class="m-dox-self">error_type</a>
|
|
</h3>
|
|
<p>Represents the type that is used as exception type.</p>
|
|
<p>By default this type deduces to <code>std::exception_ptr</code>. If <code>CONTINUABLE_WITH_NO_EXCEPTIONS</code> is defined the type will be a <code>std::error_condition</code>. A custom error type may be set through defining <code>CONTINUABLE_WITH_CUSTOM_ERROR_TYPE</code>.</p><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside><aside class="m-note m-danger"><h4><a href="deprecated.html#_deprecated000003" class="m-dox">Deprecated</a></h4><p>The error_type was deprecated in order to move closer to the types specified in the "A Unified Future" proposal especially regarding naming types similar.</p></aside>
|
|
</div></section>
|
|
<section class="m-dox-details" id="gadd542364566ec6cc22a4b92c47889443"><div>
|
|
<h3>
|
|
<div class="m-dox-template">
|
|
template<typename T>
|
|
</div>
|
|
using <a href="#gadd542364566ec6cc22a4b92c47889443" class="m-dox-self">plain_t</a> = detail::types::plain_tag<T>
|
|
</h3>
|
|
<p>Represents the type that is used to disable the special meaning of types which are returned by a asynchronous result handler. See cti::plain for details.</p>
|
|
<aside class="m-note m-default"><h4>Since</h4><p>4.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">
|
|
<form>
|
|
<input type="search" name="q" id="search-input" placeholder="Loading …" disabled="disabled" autofocus="autofocus" autocomplete="off" spellcheck="false" />
|
|
</form>
|
|
<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">
|
|
<p class="m-noindent">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.</p>
|
|
<p class="m-noindent">Use <span class="m-label m-dim">↓</span>
|
|
/ <span class="m-label m-dim">↑</span> to navigate through the list,
|
|
<span class="m-label m-dim">Enter</span> to go.
|
|
<span class="m-label m-dim">Tab</span> autocompletes common prefix, you can
|
|
copy a link to the result using <span class="m-label m-dim">⌘</span>
|
|
<span class="m-label m-dim">L</span> while <span class="m-label m-dim">⌘</span>
|
|
<span class="m-label m-dim">M</span> produces a Markdown link.</p>
|
|
|
|
</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–2020
|
|
<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>
|