mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Publish
This commit is contained in:
commit
94dc953ba9
205
annotated.html
Normal file
205
annotated.html
Normal file
@ -0,0 +1,205 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>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>Classes</h2>
|
||||
<ul class="m-dox">
|
||||
<li class="m-dox-collapsible">
|
||||
<a href="#" onclick="return toggle(this)">namespace</a> <a href="namespacecti.html" class="m-dox">cti</a> <span class="m-dox">Declares the continuable library namespace.</span>
|
||||
<ul class="m-dox">
|
||||
<li>namespace <a href="namespacecti_1_1transforms.html" class="m-dox">transforms</a> <span class="m-dox">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.</span></li>
|
||||
<li>struct <a href="structcti_1_1cancellation__result.html" class="m-dox">cancellation_result</a> <span class="m-dox">A class which is convertible to any <a href="classcti_1_1result.html" class="m-dox">result</a> and that definitely holds a default constructed exception which signals the cancellation of the asynchronous control flow.</span></li>
|
||||
<li>class <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_base</a> <span class="m-dox">The main class of the continuable library, it provides the functionality for chaining callbacks and continuations together to a unified hierarchy.</span></li>
|
||||
<li>struct <a href="structcti_1_1empty__result.html" class="m-dox">empty_result</a> <span class="m-dox">A class which is convertible to any <a href="classcti_1_1result.html" class="m-dox">result</a> and that definitely holds no value so the real result gets invalidated when this object is passed to it.</span></li>
|
||||
<li>struct <a href="structcti_1_1exception__arg__t.html" class="m-dox">exception_arg_t</a> <span class="m-dox">Represents the tag type that is used to disambiguate the callback operator() in order to take the exception asynchronous chain.</span></li>
|
||||
<li>class <a href="classcti_1_1exceptional__result.html" class="m-dox">exceptional_result</a> <span class="m-dox">A class which is convertible to any result and that holds an exception which is then passed to the converted result object.</span></li>
|
||||
<li>struct <a href="structcti_1_1is__ready__arg__t.html" class="m-dox">is_ready_arg_t</a> <span class="m-dox">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.</span></li>
|
||||
<li>class <a href="classcti_1_1promise__base.html" class="m-dox">promise_base</a> <span class="m-dox">The <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> makes it possible to resolve an asynchronous continuable through it's result or through an error type.</span></li>
|
||||
<li>class <a href="classcti_1_1promisify.html" class="m-dox">promisify</a> <span class="m-dox">Helper class for converting callback taking callable types into a a continuable. Various styles are supported.</span></li>
|
||||
<li>class <a href="classcti_1_1result.html" class="m-dox">result</a> <span class="m-dox">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.</span></li>
|
||||
<li>struct <a href="structcti_1_1unpack__arg__t.html" class="m-dox">unpack_arg_t</a> <span class="m-dox">Represents the tag type that is used to unpack the result of a continuation.</span></li>
|
||||
<li>struct <a href="structcti_1_1use__continuable__t.html" class="m-dox">use_continuable_t</a> <span class="m-dox">Type used as an ASIO completion token to specify an asynchronous operation that should return a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</span></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<script>
|
||||
function toggle(e) {
|
||||
e.parentElement.className = e.parentElement.className == 'm-dox-collapsible' ?
|
||||
'm-dox-expansible' : 'm-dox-collapsible';
|
||||
return false;
|
||||
}
|
||||
/* Collapse all nodes marked as such. Doing it via JS instead of directly in
|
||||
markup so disabling it doesn't harm usability. The list is somehow
|
||||
regenerated on every iteration and shrinks as I change the classes. It's not
|
||||
documented anywhere and I'm not sure if this is the same across browsers, so
|
||||
I am going backwards in that list to be sure. */
|
||||
var collapsed = document.getElementsByClassName("collapsed");
|
||||
for(var i = collapsed.length - 1; i >= 0; --i)
|
||||
collapsed[i].className = 'm-dox-expansible';
|
||||
</script>
|
||||
</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>
|
||||
96
atom-one-dark.css
Normal file
96
atom-one-dark.css
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
|
||||
Atom One Dark by Daniel Gamage
|
||||
Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
|
||||
|
||||
base: #282c34
|
||||
mono-1: #abb2bf
|
||||
mono-2: #818896
|
||||
mono-3: #5c6370
|
||||
hue-1: #56b6c2
|
||||
hue-2: #61aeee
|
||||
hue-3: #c678dd
|
||||
hue-4: #98c379
|
||||
hue-5: #e06c75
|
||||
hue-5-2: #be5046
|
||||
hue-6: #d19a66
|
||||
hue-6-2: #e6c07b
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
padding: 0.5em;
|
||||
color: #abb2bf;
|
||||
background: #282c34;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-quote {
|
||||
color: #5c6370;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-doctag,
|
||||
.hljs-keyword,
|
||||
.hljs-formula {
|
||||
color: #c678dd;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name,
|
||||
.hljs-selector-tag,
|
||||
.hljs-deletion,
|
||||
.hljs-subst {
|
||||
color: #e06c75;
|
||||
}
|
||||
|
||||
.hljs-literal {
|
||||
color: #56b6c2;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-regexp,
|
||||
.hljs-addition,
|
||||
.hljs-attribute,
|
||||
.hljs-meta-string {
|
||||
color: #98c379;
|
||||
}
|
||||
|
||||
.hljs-built_in,
|
||||
.hljs-class .hljs-title {
|
||||
color: #e6c07b;
|
||||
}
|
||||
|
||||
.hljs-attr,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-type,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo,
|
||||
.hljs-number {
|
||||
color: #d19a66;
|
||||
}
|
||||
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-link,
|
||||
.hljs-meta,
|
||||
.hljs-selector-id,
|
||||
.hljs-title {
|
||||
color: #61aeee;
|
||||
}
|
||||
|
||||
.hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.hljs-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
BIN
bgnoise.png
Normal file
BIN
bgnoise.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
216
changelog.html
Normal file
216
changelog.html
Normal file
File diff suppressed because one or more lines are too long
927
classcti_1_1continuable__base.html
Normal file
927
classcti_1_1continuable__base.html
Normal file
@ -0,0 +1,927 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::continuable_base class | 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" id="m-navbar-current">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>
|
||||
<div class="m-dox-template">template<typename Data, typename Annotation></div>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>continuable_base <span class="m-thin">class</span>
|
||||
</h1>
|
||||
<p>The main class of the continuable library, it provides the functionality for chaining callbacks and continuations together to a unified hierarchy.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Template parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">Data</td>
|
||||
<td>The internal data which is used to store the current continuation and intermediate lazy connection result.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Annotation</td>
|
||||
<td>The internal data used to store the current signature hint or strategy used for combining lazy connections.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#typeless-methods">Constructors, destructors, conversion operators</a></li>
|
||||
<li><a href="#pub-methods">Public functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>The most important method is the <a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">cti::<wbr />continuable_base::<wbr />then()</a> method, which allows to attach a callback to the continuable.</p><p>Use the continuable types defined in <code><a href="continuable_8hpp.html" class="m-dox">continuable/<wbr />continuable.hpp</a></code>, in order to use this class.</p><aside class="m-note m-info"><h4>Note</h4><p>Nearly all methods of the <a href="classcti_1_1continuable__base.html" class="m-dox">cti::<wbr />continuable_base</a> are required to be called as r-value. This is required because the continuable carries variables which are consumed when the object is transformed as part of a method call.</p></aside><aside class="m-note m-warning"><h4>Attention</h4><p>The <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects aren't intended to be stored. If you want to store a continuble_base you should always call the <a href="classcti_1_1continuable__base.html#a3c8d7fefc2f65fcd474c99d821809d24" class="m-dox">continuable_base::<wbr />freeze</a> method for disabling the invocation on destruction.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
<section id="typeless-methods">
|
||||
<h2><a href="#typeless-methods">Constructors, destructors, conversion operators</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper"><a href="#aaa60b403ed3408968d8ab37ef719e014" class="m-dox-self" name="aaa60b403ed3408968d8ab37ef719e014">continuable_base</a>(</span><span class="m-dox-wrap">Data data) <span class="m-label m-flat m-info">explicit</span> </span>
|
||||
</dt>
|
||||
<dd>Constructor accepting the data object while erasing the annotation.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename OtherData, std::enable_if_t<detail::base::can_accept_continuation<Data, Annotation, detail::traits::unrefcv_t<OtherData>>::value>* = nullptr></div>
|
||||
<span class="m-dox-wrap-bumper"><a href="#af7c1555516fde6cd26dcb0a885862937" class="m-dox-self" name="af7c1555516fde6cd26dcb0a885862937">continuable_base</a>(</span><span class="m-dox-wrap">OtherData&& data)</span>
|
||||
</dt>
|
||||
<dd>Constructor accepting any object convertible to the data object, while erasing the annotation.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename OData, std::enable_if_t<std::is_convertible<detail::traits::unrefcv_t<OData>, Data>::value>* = nullptr></div>
|
||||
<span class="m-dox-wrap-bumper"><a href="#a66a0a9b46ce1942df4d16344ff39e721" class="m-dox">continuable_base</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, Annotation>&& other)</span>
|
||||
</dt>
|
||||
<dd>Constructor taking the data of other <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects while erasing the hint.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename OData, typename OAnnotation></div>
|
||||
<span class="m-dox-wrap-bumper"><a href="#a8768c76d5d9bad19d820d9752faa337e" class="m-dox">continuable_base</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& other)</span>
|
||||
</dt>
|
||||
<dd>Constructor taking the data of other <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects while erasing the hint.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper"><a href="#ad52b8e48a62fa038d06faaca58295067" class="m-dox">~continuable_base</a>(</span><span class="m-dox-wrap">)</span>
|
||||
</dt>
|
||||
<dd>The destructor automatically invokes the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> if it wasn't consumed yet.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section id="pub-methods">
|
||||
<h2><a href="#pub-methods">Public functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename T, typename E = detail::types::this_thread_executor_tag></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">then</a>(</span><span class="m-dox-wrap">T&& callback,
|
||||
E&& executor = detail::types::this_thread_executor_tag{}) && -> auto</span>
|
||||
</dt>
|
||||
<dd>Main method of the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> to chain the current continuation with a new callback.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename OData, typename OAnnotation></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a302341be87c7991b4409b743d0d14a9d" class="m-dox">then</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& continuation) && -> auto</span>
|
||||
</dt>
|
||||
<dd>Additional overload of the <a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">continuable_base::<wbr />then()</a> method which is accepting a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> itself.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename T, typename E = detail::types::this_thread_executor_tag></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a7001122101ed32f729e39c53d6cb9c7f" class="m-dox">fail</a>(</span><span class="m-dox-wrap">T&& callback,
|
||||
E&& executor = detail::types::this_thread_executor_tag{}) && -> auto</span>
|
||||
</dt>
|
||||
<dd>Main method of the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> to catch exceptions and error codes in case the asynchronous control flow failed and was resolved through an error code or exception.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename OData, typename OAnnotation></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ac9da66a917e3d6901497d62eb67eaad0" class="m-dox">fail</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& continuation) && -> auto</span>
|
||||
</dt>
|
||||
<dd>Additional overload of the <a href="classcti_1_1continuable__base.html#a7001122101ed32f729e39c53d6cb9c7f" class="m-dox">continuable_base::<wbr />fail()</a> method which is accepting a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> itself.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename T, typename E = detail::types::this_thread_executor_tag></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ad4960d0794abb800f1dfd9a668900149" class="m-dox">next</a>(</span><span class="m-dox-wrap">T&& callback,
|
||||
E&& executor = detail::types::this_thread_executor_tag{}) && -> auto</span>
|
||||
</dt>
|
||||
<dd>A method which allows to use an overloaded callable for the error as well as the valid result path.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#af20fda227275f3c3492b5965e523278a" class="m-dox">as</a>(</span><span class="m-dox-wrap">) && -> auto</span>
|
||||
</dt>
|
||||
<dd>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> which will have its signature converted to the given Args.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#abcf4cf105aa17826bcc3c2278f6ea1b5" class="m-dox">apply</a>(</span><span class="m-dox-wrap">T&& transform) && -> auto</span>
|
||||
</dt>
|
||||
<dd>A method which allows to apply a callable object to this continuable.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ae2d35537ea76f421ba4aed86dd849f98" class="m-dox">operator|</a>(</span><span class="m-dox-wrap">T&& right) && -> auto</span>
|
||||
</dt>
|
||||
<dd>The pipe operator | is an alias for the <a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">continuable::<wbr />then</a> method.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename OData, typename OAnnotation></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ad5cbff40fcd03a6451eae06d310f1439" class="m-dox">operator&&</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& right) && -> auto</span>
|
||||
</dt>
|
||||
<dd>Invokes both <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects parallel and calls the callback with the result of both <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename OData, typename OAnnotation></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ada74584fb95bf00a50d05072e933c144" class="m-dox">operator||</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& right) && -> auto</span>
|
||||
</dt>
|
||||
<dd>Invokes both <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects parallel and calls the callback once with the first result available.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename OData, typename OAnnotation></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#abaaaf8a35827456fead299851268760e" class="m-dox">operator>></a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& right) && -> auto</span>
|
||||
</dt>
|
||||
<dd>Invokes both <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects sequential and calls the callback with the result of both <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#a26ca692e597ebd8beff7d58d8bf584f4" class="m-dox">done</a>(</span><span class="m-dox-wrap">) &&</span>
|
||||
</dt>
|
||||
<dd>Invokes the continuation chain manually even before the <a href="classcti_1_1continuable__base.html" class="m-dox">cti::<wbr />continuable_base</a> is destructed. This will release the object.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a1683400fcf7e5b0df8c236396bad6198" class="m-dox">finish</a>(</span><span class="m-dox-wrap">) && -> auto</span>
|
||||
</dt>
|
||||
<dd>Materializes the continuation expression template and finishes the current applied strategy such that the resulting continuable will always be a concrete type and Continuable::is_concrete holds.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#addf07360b93670a5105ae9d69062993e" class="m-dox">is_ready</a>(</span><span class="m-dox-wrap">) const -> bool <span class="m-label m-flat m-success">noexcept</span></span>
|
||||
</dt>
|
||||
<dd>Returns true when the continuable can provide its result immediately, and its lazy invocation would be side-effect free.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a7425eec5c30a65707f92e6d0017e21ed" class="m-dox">unpack</a>(</span><span class="m-dox-wrap">) && -> auto</span>
|
||||
</dt>
|
||||
<dd>Invalidates the continuable and returns its immediate invocation result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a1bd6ce7c083af5faf4b241ada8d6f5f7" class="m-dox">is_frozen</a>(</span><span class="m-dox-wrap">) const -> bool <span class="m-label m-flat m-success">noexcept</span></span>
|
||||
</dt>
|
||||
<dd>Predicate to check whether the <a href="classcti_1_1continuable__base.html" class="m-dox">cti::<wbr />continuable_base</a> is frozen or not.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a3c8d7fefc2f65fcd474c99d821809d24" class="m-dox">freeze</a>(</span><span class="m-dox-wrap">bool enabled = true) &noexcept -> <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>&</span>
|
||||
</dt>
|
||||
<dd>Prevents the automatic invocation of the continuation chain which happens on destruction of the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>. You may still invoke the chain through the <a href="classcti_1_1continuable__base.html#a26ca692e597ebd8beff7d58d8bf584f4" class="m-dox">continuable_base::<wbr />done</a> method.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a193e56e793fb40f56d6c6a942f605972" class="m-dox">freeze</a>(</span><span class="m-dox-wrap">bool enabled = true) &&noexcept -> <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>&&</span>
|
||||
</dt>
|
||||
<dd>Prevents the automatic invocation of the continuation chain which happens on destruction of the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>. You may still invoke the chain through the <a href="classcti_1_1continuable__base.html#a26ca692e597ebd8beff7d58d8bf584f4" class="m-dox">continuable_base::<wbr />done</a> method.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ac79b103d5c000a3a3d1b98d8adcf58e8" class="m-dox">operator co_await</a>(</span><span class="m-dox-wrap">) && -> auto</span>
|
||||
</dt>
|
||||
<dd>Implements the operator for awaiting on continuables using <code>co_await</code>.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Function documentation</h2>
|
||||
<section class="m-dox-details" id="a66a0a9b46ce1942df4d16344ff39e721"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename OData, std::enable_if_t<std::is_convertible<detail::traits::unrefcv_t<OData>, Data>::value>* = nullptr>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper"> cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a66a0a9b46ce1942df4d16344ff39e721" class="m-dox-self">continuable_base</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, Annotation>&& other)</span></span>
|
||||
</h3>
|
||||
<p>Constructor taking the data of other <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects while erasing the hint.</p>
|
||||
<p>This constructor makes it possible to replace the internal data object of the continuable by any object which is useful for type-erasure.</p>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a8768c76d5d9bad19d820d9752faa337e"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename OData, typename OAnnotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper"> cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a8768c76d5d9bad19d820d9752faa337e" class="m-dox-self">continuable_base</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& other)</span></span>
|
||||
</h3>
|
||||
<p>Constructor taking the data of other <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects while erasing the hint.</p>
|
||||
<p>This constructor makes it possible to replace the internal data object of the continuable by any object which is useful for type-erasure.</p>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ad52b8e48a62fa038d06faaca58295067"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper"> cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ad52b8e48a62fa038d06faaca58295067" class="m-dox-self">~continuable_base</a>(</span><span class="m-dox-wrap">)</span></span>
|
||||
</h3>
|
||||
<p>The destructor automatically invokes the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> if it wasn't consumed yet.</p>
|
||||
<p>In order to invoke the continuable early you may call the <a href="classcti_1_1continuable__base.html#a26ca692e597ebd8beff7d58d8bf584f4" class="m-dox">continuable_base::<wbr />done()</a> method.</p><p>The <a href="classcti_1_1continuable__base.html#a3c8d7fefc2f65fcd474c99d821809d24" class="m-dox">continuable_base::<wbr />freeze</a> method disables the automatic invocation on destruction without invalidating the object.</p><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="adf02030d7211ffc4610f3bcb13d2a149"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename T, typename E = detail::types::this_thread_executor_tag>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox-self">then</a>(</span><span class="m-dox-wrap">T&& callback,
|
||||
E&& executor = detail::types::this_thread_executor_tag{}) &&</span></span>
|
||||
</h3>
|
||||
<p>Main method of the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> to chain the current continuation with a new callback.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">callback</td>
|
||||
<td><p>The callback which is used to process the current asynchronous result on arrival. The callback is required to accept the current result at least partially (or nothing of the result).</p><pre class="m-code"><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">&&</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">atom</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// We use the whole result</span>
|
||||
<span class="p">});</span>
|
||||
|
||||
<span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">&&</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// We only use the result partially</span>
|
||||
<span class="p">});</span>
|
||||
|
||||
<span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">&&</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([]</span> <span class="p">{</span>
|
||||
<span class="c1">// We discard the result</span>
|
||||
<span class="p">});</span></pre></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>executor</td>
|
||||
<td><p>The optional executor which is used to dispatch the callback. The executor needs to accept callable objects callable through an <code>operator()</code> through its operator() itself. The executor can be move-only, but it's not required to. The default executor which is used when omitting the argument dispatches the callback on the current executing thread. Consider the example shown below:</p><pre class="m-code"><span class="k">auto</span> <span class="n">executor</span> <span class="o">=</span> <span class="p">[](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">work</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Dispatch the work here or forward it to an executor of</span>
|
||||
<span class="c1">// your choice.</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">forward</span><span class="o"><</span><span class="k">decltype</span><span class="p">(</span><span class="n">work</span><span class="p">)</span><span class="o">></span><span class="p">(</span><span class="n">work</span><span class="p">)();</span>
|
||||
<span class="p">};</span>
|
||||
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Do something...</span>
|
||||
<span class="p">},</span> <span class="n">executor</span><span class="p">);</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td><p>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with an asynchronous return type depending on the return value of the callback:</p><table class="m-table"><thead><tr><th>Callback returns</th><th>Resulting type</th></tr></thead><tbody><tr><td><code>void</code></td><td><code><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with <></code></td></tr><tr><td><code>Arg</code></td><td><code><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with <Arg></code></td></tr><tr><td><code>std::pair<First, Second></code></td><td><code><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with <First, Second></code></td></tr><tr><td><code>std::tuple<Args...></code></td><td><code><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with <Args...></code></td></tr><tr><td><code><a href="classcti_1_1result.html" class="m-dox">cti::<wbr />result</a><Args...></code></td><td><code><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with <Args...></code></td></tr><tr><td><code><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><Arg...></code></td><td><code><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with <Args...></code></td></tr></tbody></table><p>Which means the result type of the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is equal to the plain types the callback returns (<code>std::tuple</code> and <code>std::pair</code> arguments are unwrapped). A single <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> as argument is resolved and the result type is equal to the resolved <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>. A <a href="classcti_1_1result.html" class="m-dox">cti::<wbr />result</a> can be used to cancel the continuation or to transition to the exception handler. The special unwrapping of types can be disabled through wrapping such objects through a call to <a href="group___base.html#gacc7ae86f30e3c0331861ce7871e310dd" class="m-dox">cti::<wbr />make_plain</a>. Consider the following examples:</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([]</span> <span class="p">{</span> <span class="p">});</span> <span class="c1">// <void></span>
|
||||
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">a</span><span class="p">)</span> <span class="p">{</span> <span class="p">});</span> <span class="c1">// <int></span>
|
||||
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="n">std</span><span class="o">::</span><span class="n">make_pair</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span> <span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="kt">int</span> <span class="n">b</span><span class="p">)</span> <span class="p">{</span> <span class="p">});</span> <span class="c1">// <int, int></span>
|
||||
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">);</span> <span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="kt">int</span> <span class="n">b</span><span class="p">,</span> <span class="kt">int</span> <span class="n">c</span><span class="p">)</span> <span class="p">{</span> <span class="p">});</span> <span class="c1">// <int, int, int></span>
|
||||
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">);</span> <span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">atom</span><span class="p">)</span> <span class="p">{</span> <span class="p">});</span> <span class="c1">// <std::string></span>
|
||||
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"example.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">content</span><span class="p">)</span> <span class="o">-></span> <span class="n">result</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">rethrow</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_exception_ptr</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="p">{}));</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">([]</span> <span class="o">-></span> <span class="n">result</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">recover</span><span class="p">(</span><span class="s">"Hello World!"</span><span class="p">);</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">content</span><span class="p">)</span> <span class="o">-></span> <span class="n">result</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cancel</span><span class="p">();</span>
|
||||
<span class="p">})</span></pre></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a302341be87c7991b4409b743d0d14a9d"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename OData, typename OAnnotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a302341be87c7991b4409b743d0d14a9d" class="m-dox-self">then</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& continuation) &&</span></span>
|
||||
</h3>
|
||||
<p>Additional overload of the <a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">continuable_base::<wbr />then()</a> method which is accepting a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> itself.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">continuation</td>
|
||||
<td><p>A <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> reflecting the continuation which is used to continue the call hierarchy. The result of the current continuable is discarded and the given continuation is invoked as shown below.</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">atom</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> representing the next asynchronous result to continue within the asynchronous call hierarchy.</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a7001122101ed32f729e39c53d6cb9c7f"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename T, typename E = detail::types::this_thread_executor_tag>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a7001122101ed32f729e39c53d6cb9c7f" class="m-dox-self">fail</a>(</span><span class="m-dox-wrap">T&& callback,
|
||||
E&& executor = detail::types::this_thread_executor_tag{}) &&</span></span>
|
||||
</h3>
|
||||
<p>Main method of the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> to catch exceptions and error codes in case the asynchronous control flow failed and was resolved through an error code or exception.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">callback</td>
|
||||
<td>The callback which is used to process the current asynchronous error result on arrival. In case the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is using exceptions, the usage is as shown below:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>executor</td>
|
||||
<td>The optional executor which is used to dispatch the callback. See the description in <code>then</code> above.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with an asynchronous return type depending on the previous result type.</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">)</span> <span class="p">{</span> <span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">exception_ptr</span> <span class="n">ep</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Check whether the exception_ptr is valid (not default constructed)</span>
|
||||
<span class="c1">// if bool(ep) == false this means that the operation was cancelled</span>
|
||||
<span class="c1">// by the user or application (promise.set_canceled() or</span>
|
||||
<span class="c1">// make_cancelling_continuable()).</span>
|
||||
<span class="k">if</span> <span class="p">(</span><span class="n">ep</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Handle the error here</span>
|
||||
<span class="k">try</span> <span class="p">{</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">rethrow_exception</span><span class="p">(</span><span class="n">ep</span><span class="p">);</span>
|
||||
<span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="o">&</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">e</span><span class="p">.</span><span class="n">what</span><span class="p">();</span> <span class="c1">// Handle the exception</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">});</span></pre><p>In case exceptions are disabled, <code>std::error_condition</code> is used as error result instead of <code>std::exception_ptr</code>.</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">)</span> <span class="p">{</span> <span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">error_condition</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">error</span><span class="p">.</span><span class="n">message</span><span class="p">();</span> <span class="c1">// Handle the error here</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-warning"><h4>Attention</h4><p>The given exception type exception_t can be passed to the handler in a default constructed state<br /><code>bool(e) == false</code>. This always means that the operation was cancelled by the user, possibly through:</p><ul><li><a href="classcti_1_1promise__base.html#aed6c513624ac46d265a4d0695aef8820" class="m-dox">promise_base::<wbr />set_canceled</a></li><li><a href="group___base.html#ga7f0646a26ba7ee4ce1ac42caeef3caa1" class="m-dox">make_<wbr />cancelling_<wbr />continuable</a></li><li><a href="classcti_1_1result.html#abc877a55b134ed2c6b227f257b9c2f0f" class="m-dox">result::<wbr />set_canceled</a></li><li><a href="group___base.html#ga3c1710e55aab586d267f96a02f6cd014" class="m-dox">cancel<br /></a> In that case the exception can be ignored safely (but it is recommended not to proceed, although it is possible to recover from the cancellation).</li></ul></aside><aside class="m-note m-default"><h4>Since</h4><p>2.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ac9da66a917e3d6901497d62eb67eaad0"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename OData, typename OAnnotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ac9da66a917e3d6901497d62eb67eaad0" class="m-dox-self">fail</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& continuation) &&</span></span>
|
||||
</h3>
|
||||
<p>Additional overload of the <a href="classcti_1_1continuable__base.html#a7001122101ed32f729e39c53d6cb9c7f" class="m-dox">continuable_base::<wbr />fail()</a> method which is accepting a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> itself.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">continuation</td>
|
||||
<td><p>A <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> reflecting the continuation which is used to continue the call hierarchy on errors. The result of the current continuable is discarded and the given continuation is invoked as shown below.</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with an asynchronous return type depending on the previous result type.</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>2.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ad4960d0794abb800f1dfd9a668900149"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename T, typename E = detail::types::this_thread_executor_tag>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ad4960d0794abb800f1dfd9a668900149" class="m-dox-self">next</a>(</span><span class="m-dox-wrap">T&& callback,
|
||||
E&& executor = detail::types::this_thread_executor_tag{}) &&</span></span>
|
||||
</h3>
|
||||
<p>A method which allows to use an overloaded callable for the error as well as the valid result path.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">callback</td>
|
||||
<td>The callback which is used to process the current asynchronous result and error on arrival.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>executor</td>
|
||||
<td>The optional executor which is used to dispatch the callback. See the description in <code>then</code> above.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with an asynchronous return type depending on the current result type.</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<pre class="m-code"><span class="k">struct</span> <span class="n">my_callable</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">std</span><span class="o">::</span><span class="n">string</span> <span class="n">result</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</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">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="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="c1">// Will receive errors and results</span>
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">next</span><span class="p">(</span><span class="n">my_callable</span><span class="p">{});</span></pre><aside class="m-note m-default"><h4>Since</h4><p>2.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="af20fda227275f3c3492b5965e523278a"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename... Args>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#af20fda227275f3c3492b5965e523278a" class="m-dox-self">as</a>(</span><span class="m-dox-wrap">) &&</span></span>
|
||||
</h3>
|
||||
<p>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> which will have its signature converted to the given Args.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="width: 1%">Returns</th>
|
||||
<td>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with an asynchronous return type matching the given Args.</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<p>A signature can only be converted if it can be partially applied from the previous one as shown below: <code class="m-code"><span class="n">continuable</span><span class="o"><</span><span class="kt">long</span><span class="o">></span> <span class="n">c</span> <span class="o">=</span> <span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">).</span><span class="n">as</span><span class="o"><</span><span class="kt">long</span><span class="o">></span><span class="p">();</span></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="abcf4cf105aa17826bcc3c2278f6ea1b5"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename T>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#abcf4cf105aa17826bcc3c2278f6ea1b5" class="m-dox-self">apply</a>(</span><span class="m-dox-wrap">T&& transform) &&</span></span>
|
||||
</h3>
|
||||
<p>A method which allows to apply a callable object to this continuable.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">transform</td>
|
||||
<td>A callable objects that transforms a continuable to a different object.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td>Returns the result of the given transform when this continuable is passed into it.</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ae2d35537ea76f421ba4aed86dd849f98"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename T>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ae2d35537ea76f421ba4aed86dd849f98" class="m-dox-self">operator|</a>(</span><span class="m-dox-wrap">T&& right) &&</span></span>
|
||||
</h3>
|
||||
<p>The pipe operator | is an alias for the <a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">continuable::<wbr />then</a> method.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">right</td>
|
||||
<td>The argument on the right-hand side to connect.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td>See the corresponding <a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">continuable_base::<wbr />then</a> method for the explanation of the return type.</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>2.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ad5cbff40fcd03a6451eae06d310f1439"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename OData, typename OAnnotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ad5cbff40fcd03a6451eae06d310f1439" class="m-dox-self">operator&&</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& right) &&</span></span>
|
||||
</h3>
|
||||
<p>Invokes both <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects parallel and calls the callback with the result of both <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">right</td>
|
||||
<td>The continuable on the right-hand side to connect.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td><p>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with a result type matching the result of the left <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> combined with the right <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>. The returned <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> will be in an intermediate lazy state, further calls to its <a href="classcti_1_1continuable__base.html#ad5cbff40fcd03a6451eae06d310f1439" class="m-dox">continuable_base::<wbr />operator &&</a> will add other <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects to the current invocation chain.</p><pre class="m-code"><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">&&</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">atom</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span>
|
||||
|
||||
<span class="k">auto</span> <span class="n">request</span> <span class="o">=</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">&&</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">);</span>
|
||||
<span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">request</span><span class="p">)</span> <span class="o">&&</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"travis-ci.org"</span><span class="p">))</span>
|
||||
<span class="c1">// All three requests are invoked in parallel although we added</span>
|
||||
<span class="c1">// the request to "travis-ci.org" last.</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">atom</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">travis</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-info"><h4>Note</h4><p>The <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects are invoked all at onve, because the <code>all</code> strategy tries to resolve the continuations as fast as possible. Sequential invocation is also supported through the <a href="classcti_1_1continuable__base.html#abaaaf8a35827456fead299851268760e" class="m-dox">continuable_base::<wbr />operator>></a> method.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ada74584fb95bf00a50d05072e933c144"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename OData, typename OAnnotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ada74584fb95bf00a50d05072e933c144" class="m-dox-self">operator||</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& right) &&</span></span>
|
||||
</h3>
|
||||
<p>Invokes both <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects parallel and calls the callback once with the first result available.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">right</td>
|
||||
<td>The continuable on the right-hand side to connect. The right continuable is required to have the same result as the left connected <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td><p>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with a result type matching the combined result which of all connected <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects. The returned <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> will be in an intermediate lazy state, further calls to its <a href="classcti_1_1continuable__base.html#ada74584fb95bf00a50d05072e933c144" class="m-dox">continuable_base::<wbr />operator ||</a> will add other <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects to the current invocation chain.</p><pre class="m-code"><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">||</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github_or_atom</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span>
|
||||
|
||||
<span class="p">(</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="sc">'A'</span><span class="p">)</span> <span class="o">||</span> <span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">29</span><span class="p">,</span> <span class="sc">'B'</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="kt">char</span> <span class="n">b</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-info"><h4>Note</h4><p>The <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects are invoked all at once, however, the callback is only called once with the first result or exception which becomes available.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="abaaaf8a35827456fead299851268760e"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
template<typename OData, typename OAnnotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#abaaaf8a35827456fead299851268760e" class="m-dox-self">operator>></a>(</span><span class="m-dox-wrap"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><OData, OAnnotation>&& right) &&</span></span>
|
||||
</h3>
|
||||
<p>Invokes both <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects sequential and calls the callback with the result of both <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">right</td>
|
||||
<td>The continuable on the right-hand side to connect.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td><p>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with a result type matching the result of the left <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> combined with the right <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p><pre class="m-code"><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">>></span> <span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">atom</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// The callback is called with the result of both requests,</span>
|
||||
<span class="c1">// however, the request to atom was started after the request</span>
|
||||
<span class="c1">// to github was finished.</span>
|
||||
<span class="p">});</span></pre></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-info"><h4>Note</h4><p>The <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects are invoked sequential one after the previous one was finished. Parallel invocation is also supported through the <a href="classcti_1_1continuable__base.html#ad5cbff40fcd03a6451eae06d310f1439" class="m-dox">continuable_base::<wbr />operator &&</a> method.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a26ca692e597ebd8beff7d58d8bf584f4"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">void cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a26ca692e597ebd8beff7d58d8bf584f4" class="m-dox-self">done</a>(</span><span class="m-dox-wrap">) &&</span></span>
|
||||
</h3>
|
||||
<p>Invokes the continuation chain manually even before the <a href="classcti_1_1continuable__base.html" class="m-dox">cti::<wbr />continuable_base</a> is destructed. This will release the object.</p>
|
||||
<aside class="m-note m-default"><h4>See also</h4><p><a href="classcti_1_1continuable__base.html#ad52b8e48a62fa038d06faaca58295067" class="m-dox">continuable_base::<wbr />~continuable_base()</a> for further details about the continuation invocation on destruction.</p></aside><aside class="m-note m-warning"><h4>Attention</h4><p>This method will trigger an assertion if the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> was released already.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a1683400fcf7e5b0df8c236396bad6198"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a1683400fcf7e5b0df8c236396bad6198" class="m-dox-self">finish</a>(</span><span class="m-dox-wrap">) &&</span></span>
|
||||
</h3>
|
||||
<p>Materializes the continuation expression template and finishes the current applied strategy such that the resulting continuable will always be a concrete type and Continuable::is_concrete holds.</p>
|
||||
<p>This can be used in the case where we are chaining continuations lazily through a strategy, for instance when applying operators for expressing connections and then want to return a materialized <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> which uses the strategy respectively.</p><pre class="m-code"><span class="k">auto</span> <span class="nf">do_both</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="p">(</span><span class="n">wait</span><span class="p">(</span><span class="mi">10</span><span class="n">s</span><span class="p">)</span> <span class="o">||</span> <span class="n">wait_key_pressed</span><span class="p">(</span><span class="n">KEY_SPACE</span><span class="p">)).</span><span class="n">finish</span><span class="p">();</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="c1">// Without a call to finish() this would lead to</span>
|
||||
<span class="c1">// an unintended evaluation strategy:</span>
|
||||
<span class="n">do_both</span><span class="p">()</span> <span class="o">||</span> <span class="n">wait</span><span class="p">(</span><span class="mi">5</span><span class="n">s</span><span class="p">);</span></pre><aside class="m-note m-info"><h4>Note</h4><p>When using a type erased <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> such as <code>continuable<...></code> this method doesn't need to be called since the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is materialized automatically on conversion.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="addf07360b93670a5105ae9d69062993e"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">bool cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#addf07360b93670a5105ae9d69062993e" class="m-dox-self">is_ready</a>(</span><span class="m-dox-wrap">) const <span class="m-label m-success">noexcept</span></span></span>
|
||||
</h3>
|
||||
<p>Returns true when the continuable can provide its result immediately, and its lazy invocation would be side-effect free.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a7425eec5c30a65707f92e6d0017e21ed"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a7425eec5c30a65707f92e6d0017e21ed" class="m-dox-self">unpack</a>(</span><span class="m-dox-wrap">) &&</span></span>
|
||||
</h3>
|
||||
<p>Invalidates the continuable and returns its immediate invocation result.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="width: 1%">Returns</th>
|
||||
<td>A result<Args...> where Args... represent the current asynchronous parameters or the currently stored exception.</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<p>This method can be used to specialize the asynchronous control flow based on whether the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is_ready at every time, which is true for a continuable created through the following functions:</p><ul><li>make_ready_continuable</li><li>make_exceptional_continuable</li></ul><aside class="m-note m-warning"><h4>Attention</h4><p>unpack requires that <a href="classcti_1_1continuable__base.html#addf07360b93670a5105ae9d69062993e" class="m-dox">continuable_base::<wbr />is_ready</a> returned true in a previous check, otherwise its behaviour is unspecified.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a1bd6ce7c083af5faf4b241ada8d6f5f7"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">bool cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a1bd6ce7c083af5faf4b241ada8d6f5f7" class="m-dox-self">is_frozen</a>(</span><span class="m-dox-wrap">) const <span class="m-label m-success">noexcept</span></span></span>
|
||||
</h3>
|
||||
<p>Predicate to check whether the <a href="classcti_1_1continuable__base.html" class="m-dox">cti::<wbr />continuable_base</a> is frozen or not.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="width: 1%">Returns</th>
|
||||
<td>Returns true when the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is frozen.</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-default"><h4>See also</h4><p><a href="classcti_1_1continuable__base.html#a3c8d7fefc2f65fcd474c99d821809d24" class="m-dox">continuable_base::<wbr />freeze</a> for further details.</p></aside><aside class="m-note m-warning"><h4>Attention</h4><p>This method will trigger an assertion if the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> was released already.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a3c8d7fefc2f65fcd474c99d821809d24"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>& cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a3c8d7fefc2f65fcd474c99d821809d24" class="m-dox-self">freeze</a>(</span><span class="m-dox-wrap">bool enabled = true) &noexcept</span></span>
|
||||
</h3>
|
||||
<p>Prevents the automatic invocation of the continuation chain which happens on destruction of the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>. You may still invoke the chain through the <a href="classcti_1_1continuable__base.html#a26ca692e597ebd8beff7d58d8bf584f4" class="m-dox">continuable_base::<wbr />done</a> method.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">enabled</td>
|
||||
<td>Indicates whether the freeze is enabled or disabled.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>This is useful for storing a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> inside a continuation chain while storing it for further usage.</p><aside class="m-note m-default"><h4>See also</h4><p><a href="classcti_1_1continuable__base.html#ad52b8e48a62fa038d06faaca58295067" class="m-dox">continuable_base::<wbr />~continuable_base()</a> for further details about the continuation invocation on destruction.</p></aside><aside class="m-note m-warning"><h4>Attention</h4><p>This method will trigger an assertion if the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> was released already.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a193e56e793fb40f56d6c6a942f605972"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper"><a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>&& cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a193e56e793fb40f56d6c6a942f605972" class="m-dox-self">freeze</a>(</span><span class="m-dox-wrap">bool enabled = true) &&noexcept</span></span>
|
||||
</h3>
|
||||
<p>Prevents the automatic invocation of the continuation chain which happens on destruction of the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>. You may still invoke the chain through the <a href="classcti_1_1continuable__base.html#a26ca692e597ebd8beff7d58d8bf584f4" class="m-dox">continuable_base::<wbr />done</a> method.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">enabled</td>
|
||||
<td>Indicates whether the freeze is enabled or disabled.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>This is useful for storing a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> inside a continuation chain while storing it for further usage.</p><aside class="m-note m-default"><h4>See also</h4><p><a href="classcti_1_1continuable__base.html#ad52b8e48a62fa038d06faaca58295067" class="m-dox">continuable_base::<wbr />~continuable_base()</a> for further details about the continuation invocation on destruction.</p></aside><aside class="m-note m-warning"><h4>Attention</h4><p>This method will trigger an assertion if the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> was released already.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ac79b103d5c000a3a3d1b98d8adcf58e8"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Annotation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />continuable_base<Data, Annotation>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ac79b103d5c000a3a3d1b98d8adcf58e8" class="m-dox-self">operator co_await</a>(</span><span class="m-dox-wrap">) &&</span></span>
|
||||
</h3>
|
||||
<p>Implements the operator for awaiting on continuables using <code>co_await</code>.</p>
|
||||
<p>The operator is only enabled if <code>CONTINUABLE_HAS_EXPERIMENTAL_COROUTINE</code> is defined and the toolchain supports experimental coroutines.</p><p>The return type of the <code>co_await</code> expression is specified as following:</p><table class="m-table"><thead><tr><th>Continuation type</th><th>co_await returns</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>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>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::tuple<Args...></code></td></tr></tbody></table><p>When exceptions are used the usage is as intuitive as shown below:</p><pre class="m-code"><span class="c1">// Handling the exception isn't required and</span>
|
||||
<span class="c1">// the try catch clause may be omitted.</span>
|
||||
<span class="k">try</span> <span class="p">{</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">response</span> <span class="o">=</span> <span class="n">co_await</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">);</span>
|
||||
<span class="p">}</span> <span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="o">&</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">e</span><span class="p">.</span><span class="n">what</span><span class="p">();</span>
|
||||
<span class="p">}</span></pre><p>In case the library is configured to use error codes or a custom exception type the return type of the co_await expression is changed. The result is returned through a cti::result<...>.</p><table class="m-table"><thead><tr><th>Continuation type</th><th>co_await returns</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>result<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>result<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>result<Args...></code></td></tr></tbody></table><aside class="m-note m-info"><h4>Note</h4><p>Using <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> as return type for coroutines is supported. The coroutine is initially stopped and resumed when the continuation is requested in order to keep the lazy evaluation semantics of the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p><pre class="m-code"><span class="n">cti</span><span class="o">::</span><span class="n">continuable</span><span class="o"><></span> <span class="n">resolve_async_void</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="n">co_await</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">);</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="n">co_return</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">continuable</span><span class="o"><</span><span class="kt">int</span><span class="o">></span> <span class="n">resolve_async</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="n">co_await</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">);</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="n">co_return</span> <span class="mi">0</span><span class="p">;</span>
|
||||
<span class="p">}</span></pre><p>It's possible to return multiple return values from coroutines by wrapping those in a tuple like type:</p><pre class="m-code"><span class="n">cti</span><span class="o">::</span><span class="n">continuable</span><span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">resolve_async_multiple</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="n">co_await</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">);</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="n">co_return</span> <span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
|
||||
<span class="p">}</span></pre></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">
|
||||
<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>
|
||||
206
classcti_1_1exceptional__result.html
Normal file
206
classcti_1_1exceptional__result.html
Normal file
@ -0,0 +1,206 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::exceptional_result class | 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>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>exceptional_result <span class="m-thin">class</span>
|
||||
</h1>
|
||||
<p>A class which is convertible to any result and that holds an exception which is then passed to the converted result object.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#pub-methods">Public functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
<section id="pub-methods">
|
||||
<h2><a href="#pub-methods">Public functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#a80241803e25358f098b599c3a9f3e659" class="m-dox-self" name="a80241803e25358f098b599c3a9f3e659">set_exception</a>(</span><span class="m-dox-wrap"><a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> exception)</span>
|
||||
</dt>
|
||||
<dd>Sets an exception.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a0f30d323daf55c775d2584fa85defa5d" class="m-dox-self" name="a0f30d323daf55c775d2584fa85defa5d">get_exception</a>(</span><span class="m-dox-wrap">) &noexcept -> <a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a>&</span>
|
||||
</dt>
|
||||
<dd>Returns the contained exception.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a7b58efc8624d71a896e48ed060323205" class="m-dox-self" name="a7b58efc8624d71a896e48ed060323205">get_exception</a>(</span><span class="m-dox-wrap">) const &noexcept -> <a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> const &</span>
|
||||
</dt>
|
||||
<dd>Returns the contained exception.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#affca244f6d536d34c098e526e5b73f13" class="m-dox-self" name="affca244f6d536d34c098e526e5b73f13">get_exception</a>(</span><span class="m-dox-wrap">) &&noexcept -> <a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a>&&</span>
|
||||
</dt>
|
||||
<dd>Returns the contained exception.</dd>
|
||||
</dl>
|
||||
</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>
|
||||
370
classcti_1_1promise__base.html
Normal file
370
classcti_1_1promise__base.html
Normal file
@ -0,0 +1,370 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::promise_base class | 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" id="m-navbar-current">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>
|
||||
<div class="m-dox-template">template<typename Data, typename Hint></div>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>promise_base <span class="m-thin">class</span>
|
||||
</h1>
|
||||
<p>The <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> makes it possible to resolve an asynchronous continuable through it's result or through an error type.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#typeless-methods">Constructors, destructors, conversion operators</a></li>
|
||||
<li><a href="#pub-methods">Public functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>Use the promise type defined in <code>continuable/continuable_types.hpp</code>, in order to use this class.</p><p>If we want to resolve the <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> trough the call operator, and we want to resolve it through an exception, we must call it with a <a href="structcti_1_1exception__arg__t.html" class="m-dox">exception_<wbr />arg_<wbr />t</a> as first and the exception as second argument. Additionally the promise is resolveable only through its call operator when invoked as an r-value.</p><aside class="m-note m-default"><h4>Since</h4><p>2.0.0</p></aside>
|
||||
<section id="typeless-methods">
|
||||
<h2><a href="#typeless-methods">Constructors, destructors, conversion operators</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper"><a href="#a2885e8c4a6a8d2a3fc5833c0b6246a2e" class="m-dox-self" name="a2885e8c4a6a8d2a3fc5833c0b6246a2e">promise_base</a>(</span><span class="m-dox-wrap">) <span class="m-label m-flat m-info">defaulted</span> <span class="m-label m-flat m-info">explicit</span> </span>
|
||||
</dt>
|
||||
<dd>Constructor for constructing an empty promise.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper"><a href="#aef8b6fbfcc15572b829770f28324e4f0" class="m-dox-self" name="aef8b6fbfcc15572b829770f28324e4f0">promise_base</a>(</span><span class="m-dox-wrap">Data data) <span class="m-label m-flat m-info">explicit</span> </span>
|
||||
</dt>
|
||||
<dd>Constructor accepting the data object.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename OData, std::enable_if_t<std::is_convertible<detail::traits::unrefcv_t<OData>, Data>::value>* = nullptr></div>
|
||||
<span class="m-dox-wrap-bumper"><a href="#aa3fd45949359892e71aa0b10cf9fa1f5" class="m-dox-self" name="aa3fd45949359892e71aa0b10cf9fa1f5">promise_base</a>(</span><span class="m-dox-wrap">OData&& data)</span>
|
||||
</dt>
|
||||
<dd>Constructor accepting any object convertible to the data object.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper"><a href="#a463a4e8bbed77b485bf3e1658bf2aa19" class="m-dox">operator bool</a>(</span><span class="m-dox-wrap">) const <span class="m-label m-flat m-info">explicit</span> <span class="m-label m-flat m-success">noexcept</span></span>
|
||||
</dt>
|
||||
<dd>Returns true if the continuation is valid (non empty).</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section id="pub-methods">
|
||||
<h2><a href="#pub-methods">Public functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename OData, std::enable_if_t<std::is_convertible<detail::traits::unrefcv_t<OData>, Data>::value>* = nullptr></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ab212900670383825bcfb548f9c43eb9b" class="m-dox-self" name="ab212900670383825bcfb548f9c43eb9b">operator=</a>(</span><span class="m-dox-wrap">OData&& data) -> <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a>&</span>
|
||||
</dt>
|
||||
<dd>Assignment operator accepting any object convertible to the data object.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#a87d5dfa33e141e08abef9f2a83f87c78" class="m-dox">operator()</a>(</span><span class="m-dox-wrap">Args... args) &&noexcept</span>
|
||||
</dt>
|
||||
<dd>Resolves the continuation with the given values.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#adca9714bd11fcbaa4e9c145758feed8b" class="m-dox">operator()</a>(</span><span class="m-dox-wrap"><a href="structcti_1_1exception__arg__t.html" class="m-dox">exception_<wbr />arg_<wbr />t</a> tag,
|
||||
<a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> exception) &&noexcept</span>
|
||||
</dt>
|
||||
<dd>Resolves the continuation with the given exception.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#a223d666944a70441b3837b461b1094c7" class="m-dox">set_value</a>(</span><span class="m-dox-wrap">Args... args) <span class="m-label m-flat m-success">noexcept</span></span>
|
||||
</dt>
|
||||
<dd>Resolves the continuation with the given values.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#a449356e97645d44cf4194932cc2006d7" class="m-dox">set_exception</a>(</span><span class="m-dox-wrap"><a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> exception) <span class="m-label m-flat m-success">noexcept</span></span>
|
||||
</dt>
|
||||
<dd>Resolves the continuation with the given exception.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#aed6c513624ac46d265a4d0695aef8820" class="m-dox">set_canceled</a>(</span><span class="m-dox-wrap">) <span class="m-label m-flat m-success">noexcept</span></span>
|
||||
</dt>
|
||||
<dd>Resolves the continuation with the cancellation token which is represented by a default constructed exception_t.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Function documentation</h2>
|
||||
<section class="m-dox-details" id="a463a4e8bbed77b485bf3e1658bf2aa19"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Hint>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper"> cti::<wbr />promise_base<Data, Hint>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a463a4e8bbed77b485bf3e1658bf2aa19" class="m-dox-self">operator bool</a>(</span><span class="m-dox-wrap">) const <span class="m-label m-info">explicit</span> <span class="m-label m-success">noexcept</span></span></span>
|
||||
</h3>
|
||||
<p>Returns true if the continuation is valid (non empty).</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Exceptions</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">This</td>
|
||||
<td>method never throws an exception.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a87d5dfa33e141e08abef9f2a83f87c78"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Hint>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">void cti::<wbr />promise_base<Data, Hint>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a87d5dfa33e141e08abef9f2a83f87c78" class="m-dox-self">operator()</a>(</span><span class="m-dox-wrap">Args... args) &&noexcept</span></span>
|
||||
</h3>
|
||||
<p>Resolves the continuation with the given values.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Exceptions</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">This</td>
|
||||
<td>method never throws an exception.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<aside class="m-note m-warning"><h4>Attention</h4><p>This method may only be called once, when the promise is valid operator bool() returns true. Calling this method will invalidate the promise such that subsequent calls to operator bool() will return false. This behaviour is only consistent in <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> and non type erased promises may behave differently. Invoking an invalid <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> is undefined!</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="adca9714bd11fcbaa4e9c145758feed8b"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Hint>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">void cti::<wbr />promise_base<Data, Hint>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#adca9714bd11fcbaa4e9c145758feed8b" class="m-dox-self">operator()</a>(</span><span class="m-dox-wrap"><a href="structcti_1_1exception__arg__t.html" class="m-dox">exception_<wbr />arg_<wbr />t</a> tag,
|
||||
<a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> exception) &&noexcept</span></span>
|
||||
</h3>
|
||||
<p>Resolves the continuation with the given exception.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Exceptions</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">This</td>
|
||||
<td>method never throws an exception.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<aside class="m-note m-warning"><h4>Attention</h4><p>This method may only be called once, when the promise is valid operator bool() returns true. Calling this method will invalidate the promise such that subsequent calls to operator bool() will return false. This behaviour is only consistent in <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> and non type erased promises may behave differently. Invoking an invalid <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> is undefined!</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="a223d666944a70441b3837b461b1094c7"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Hint>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">void cti::<wbr />promise_base<Data, Hint>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a223d666944a70441b3837b461b1094c7" class="m-dox-self">set_value</a>(</span><span class="m-dox-wrap">Args... args) <span class="m-label m-success">noexcept</span></span></span>
|
||||
</h3>
|
||||
<p>Resolves the continuation with the given values.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Exceptions</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">This</td>
|
||||
<td>method never throws an exception.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<aside class="m-note m-warning"><h4>Attention</h4><p>This method may only be called once, when the promise is valid operator bool() returns true. Calling this method will invalidate the promise such that subsequent calls to operator bool() will return false. This behaviour is only consistent in <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> and non type erased promises may behave differently. Invoking an invalid <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> is undefined!</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="a449356e97645d44cf4194932cc2006d7"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Hint>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">void cti::<wbr />promise_base<Data, Hint>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a449356e97645d44cf4194932cc2006d7" class="m-dox-self">set_exception</a>(</span><span class="m-dox-wrap"><a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> exception) <span class="m-label m-success">noexcept</span></span></span>
|
||||
</h3>
|
||||
<p>Resolves the continuation with the given exception.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Exceptions</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">This</td>
|
||||
<td>method never throws an exception.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<aside class="m-note m-warning"><h4>Attention</h4><p>This method may only be called once, when the promise is valid operator bool() returns true. Calling this method will invalidate the promise such that subsequent calls to operator bool() will return false. This behaviour is only consistent in <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> and non type erased promises may behave differently. Invoking an invalid <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> is undefined!</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="aed6c513624ac46d265a4d0695aef8820"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Data, typename Hint>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">void cti::<wbr />promise_base<Data, Hint>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#aed6c513624ac46d265a4d0695aef8820" class="m-dox-self">set_canceled</a>(</span><span class="m-dox-wrap">) <span class="m-label m-success">noexcept</span></span></span>
|
||||
</h3>
|
||||
<p>Resolves the continuation with the cancellation token which is represented by a default constructed exception_t.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Exceptions</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">This</td>
|
||||
<td>method never throws an exception.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<aside class="m-note m-warning"><h4>Attention</h4><p>This method may only be called once, when the promise is valid operator bool() returns true. Calling this method will invalidate the promise such that subsequent calls to operator bool() will return false. This behaviour is only consistent in <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> and non type erased promises may behave differently. Invoking an invalid <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> is undefined!</p></aside><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>
|
||||
262
classcti_1_1promisify.html
Normal file
262
classcti_1_1promisify.html
Normal file
@ -0,0 +1,262 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::promisify class | 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>
|
||||
<div class="m-dox-template">template<typename... Result></div>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>promisify <span class="m-thin">class</span>
|
||||
</h1>
|
||||
<p>Helper class for converting callback taking callable types into a a continuable. Various styles are supported.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Template parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">Result</td>
|
||||
<td>The result of the converted continuable, this should align with the arguments that are passed to the callback.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#pub-static-methods">Public static functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul><li><code>from</code>: Converts callback taking callable types into continuables which pass an error code as first parameter and the rest of the result afterwards.</li></ul><aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
<section id="pub-static-methods">
|
||||
<h2><a href="#pub-static-methods">Public static functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Callable, typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">static auto <a href="#a28834d45efa0e6d2e22771cdd38e33a4" class="m-dox">from</a>(</span><span class="m-dox-wrap">Callable&& callable,
|
||||
Args && ... args) -> auto</span>
|
||||
</dt>
|
||||
<dd>Converts callback taking callable types into a continuable. This applies to calls which pass an error code as first parameter and the rest of the asynchronous result afterwards.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Resolver, typename Callable, typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">static auto <a href="#a544cd0fd6e3466b9c3c45079803d6b84" class="m-dox">with</a>(</span><span class="m-dox-wrap">Resolver&& resolver,
|
||||
Callable&& callable,
|
||||
Args && ... args) -> auto</span>
|
||||
</dt>
|
||||
<dd>Converts callback taking callable types into a continuable. This applies to calls which pass an error code as first parameter and the rest of the asynchronous result afterwards.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Function documentation</h2>
|
||||
<section class="m-dox-details" id="a28834d45efa0e6d2e22771cdd38e33a4"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Result>
|
||||
template<typename Callable, typename... Args>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">static auto cti::<wbr />promisify<Result>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a28834d45efa0e6d2e22771cdd38e33a4" class="m-dox-self">from</a>(</span><span class="m-dox-wrap">Callable&& callable,
|
||||
Args && ... args)</span></span>
|
||||
</h3>
|
||||
<p>Converts callback taking callable types into a continuable. This applies to calls which pass an error code as first parameter and the rest of the asynchronous result afterwards.</p>
|
||||
<p>See an example of how to promisify boost asio's async_resolve below:</p><pre class="m-code"><span class="k">auto</span> <span class="nf">async_resolve</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">host</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">service</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cti</span><span class="o">::</span><span class="n">promisify</span><span class="o"><</span><span class="n">asio</span><span class="o">::</span><span class="n">ip</span><span class="o">::</span><span class="n">udp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span><span class="o">>::</span><span class="n">from</span><span class="p">(</span>
|
||||
<span class="p">[</span><span class="o">&</span><span class="p">](</span><span class="k">auto</span><span class="o">&&</span><span class="p">...</span> <span class="n">args</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">resolver_</span><span class="p">.</span><span class="n">async_resolve</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">forward</span><span class="o"><</span><span class="k">decltype</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="o">></span><span class="p">(</span><span class="n">args</span><span class="p">)...);</span>
|
||||
<span class="p">},</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">host</span><span class="p">),</span> <span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">service</span><span class="p">));</span>
|
||||
<span class="p">}</span></pre><p>A given error variable is converted to the used error type. If this isn't possible you need to create a custom resolver callable object</p><aside class="m-note m-default"><h4>See also</h4><p><a href="classcti_1_1promisify.html#a544cd0fd6e3466b9c3c45079803d6b84" class="m-dox">with</a> for details.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a544cd0fd6e3466b9c3c45079803d6b84"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Result>
|
||||
template<typename Resolver, typename Callable, typename... Args>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">static auto cti::<wbr />promisify<Result>::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a544cd0fd6e3466b9c3c45079803d6b84" class="m-dox-self">with</a>(</span><span class="m-dox-wrap">Resolver&& resolver,
|
||||
Callable&& callable,
|
||||
Args && ... args)</span></span>
|
||||
</h3>
|
||||
<p>Converts callback taking callable types into a continuable. This applies to calls which pass an error code as first parameter and the rest of the asynchronous result afterwards.</p>
|
||||
<p>This modification of <a href="classcti_1_1promisify.html#a28834d45efa0e6d2e22771cdd38e33a4" class="m-dox">from</a> additionally takes a resolver callable object which is used to resolve the promise from the given result.</p><p>See an example of how to promisify boost asio's async_resolve below:</p><pre class="m-code"><span class="k">auto</span> <span class="nf">async_resolve</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">host</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">service</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cti</span><span class="o">::</span><span class="n">promisify</span><span class="o"><</span><span class="n">asio</span><span class="o">::</span><span class="n">ip</span><span class="o">::</span><span class="n">udp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span><span class="o">>::</span><span class="n">with</span><span class="p">(</span>
|
||||
<span class="p">[](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">,</span> <span class="k">auto</span><span class="o">&&</span> <span class="n">e</span><span class="p">,</span> <span class="k">auto</span><span class="o">&&</span><span class="p">...</span> <span class="n">args</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">if</span> <span class="p">(</span><span class="n">e</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_exception</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">forward</span><span class="o"><</span><span class="k">decltype</span><span class="p">(</span><span class="n">e</span><span class="p">)</span><span class="o">></span><span class="p">(</span><span class="n">e</span><span class="p">));</span>
|
||||
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">forward</span><span class="o"><</span><span class="k">decltype</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="o">></span><span class="p">(</span><span class="n">args</span><span class="p">)...);</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">},</span>
|
||||
<span class="p">[</span><span class="o">&</span><span class="p">](</span><span class="k">auto</span><span class="o">&&</span><span class="p">...</span> <span class="n">args</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">resolver_</span><span class="p">.</span><span class="n">async_resolve</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">forward</span><span class="o"><</span><span class="k">decltype</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="o">></span><span class="p">(</span><span class="n">args</span><span class="p">)...);</span>
|
||||
<span class="p">},</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">host</span><span class="p">),</span> <span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">service</span><span class="p">));</span>
|
||||
<span class="p">}</span></pre><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>
|
||||
290
classcti_1_1result.html
Normal file
290
classcti_1_1result.html
Normal file
@ -0,0 +1,290 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::result class | 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>
|
||||
<div class="m-dox-template">template<typename... T></div>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>result <span class="m-thin">class</span>
|
||||
</h1>
|
||||
<p>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.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#pub-static-methods">Public static functions</a></li>
|
||||
<li><a href="#typeless-methods">Constructors, destructors, conversion operators</a></li>
|
||||
<li><a href="#pub-methods">Public functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>The result can be in the following three states:</p><ul><li><em>no result</em>: If the operation didn't finish</li><li><em>a value</em>: If the operation finished successfully</li><li><em>an exception</em>: If the operation finished with an exception or was cancelled.</li></ul><p>The interface of the result object is similar to the one proposed in the <code>std::expected</code> proposal:</p><pre class="m-code"><span class="n">result</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">result</span> <span class="o">=</span> <span class="n">make_result</span><span class="p">(</span><span class="s">"Hello World!"</span><span class="p">);</span>
|
||||
<span class="kt">bool</span><span class="p">(</span><span class="n">result</span><span class="p">);</span>
|
||||
<span class="n">result</span><span class="p">.</span><span class="n">is_value</span><span class="p">();</span>
|
||||
<span class="n">result</span><span class="p">.</span><span class="n">is_exception</span><span class="p">();</span>
|
||||
<span class="o">*</span><span class="n">result</span><span class="p">;</span> <span class="c1">// Same as result.get_value()</span>
|
||||
<span class="n">result</span><span class="p">.</span><span class="n">get_value</span><span class="p">();</span>
|
||||
<span class="n">result</span><span class="p">.</span><span class="n">get_exception</span><span class="p">();</span></pre><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
<section id="pub-static-methods">
|
||||
<h2><a href="#pub-static-methods">Public static functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">static auto <a href="#a3fec8c9a771a88ce82bcf62d72054ee9" class="m-dox-self" name="a3fec8c9a771a88ce82bcf62d72054ee9">from</a>(</span><span class="m-dox-wrap">T... values) -> <a href="classcti_1_1result.html" class="m-dox">result</a></span>
|
||||
</dt>
|
||||
<dd>Creates a present result from the given values.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">static auto <a href="#ae8ea01cb58a4b7ebd2657e1fa8bc1f47" class="m-dox-self" name="ae8ea01cb58a4b7ebd2657e1fa8bc1f47">from</a>(</span><span class="m-dox-wrap"><a href="structcti_1_1exception__arg__t.html" class="m-dox">exception_<wbr />arg_<wbr />t</a>,
|
||||
<a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> exception) -> <a href="classcti_1_1result.html" class="m-dox">result</a></span>
|
||||
</dt>
|
||||
<dd>Creates a present result from the given exception.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">static auto <a href="#a1ccaa637372b2a8bc93416a4b5831c9f" class="m-dox-self" name="a1ccaa637372b2a8bc93416a4b5831c9f">empty</a>(</span><span class="m-dox-wrap">) -> <a href="classcti_1_1result.html" class="m-dox">result</a></span>
|
||||
</dt>
|
||||
<dd>Creates an empty result.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section id="typeless-methods">
|
||||
<h2><a href="#typeless-methods">Constructors, destructors, conversion operators</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper"><a href="#a50ce9290fc7df2746375bd4d469a523e" class="m-dox-self" name="a50ce9290fc7df2746375bd4d469a523e">operator bool</a>(</span><span class="m-dox-wrap">) const <span class="m-label m-flat m-info">explicit</span> <span class="m-label m-flat m-primary">constexpr</span> <span class="m-label m-flat m-success">noexcept</span></span>
|
||||
</dt>
|
||||
<dd>Returns true if the state of the result holds the result.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section id="pub-methods">
|
||||
<h2><a href="#pub-methods">Public functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#ac256601b1f89911bcd7610d72548e67c" class="m-dox-self" name="ac256601b1f89911bcd7610d72548e67c">set_empty</a>(</span><span class="m-dox-wrap">)</span>
|
||||
</dt>
|
||||
<dd>Set the result to an empty state.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#a09a414a12acc1c2cc369ab6cc50f699f" class="m-dox-self" name="a09a414a12acc1c2cc369ab6cc50f699f">set_value</a>(</span><span class="m-dox-wrap">T... values)</span>
|
||||
</dt>
|
||||
<dd>Set the result to a the state which holds the corresponding value.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#a9ae0d4961d609c8f8cda5697f4d9397c" class="m-dox-self" name="a9ae0d4961d609c8f8cda5697f4d9397c">set_exception</a>(</span><span class="m-dox-wrap"><a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> exception)</span>
|
||||
</dt>
|
||||
<dd>Set the result into a state which holds the corresponding exception.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#abc877a55b134ed2c6b227f257b9c2f0f" class="m-dox-self" name="abc877a55b134ed2c6b227f257b9c2f0f">set_canceled</a>(</span><span class="m-dox-wrap">)</span>
|
||||
</dt>
|
||||
<dd>Set the result into a state which holds the cancellation token.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a8f4ce49763a03ecfccb8411d6f9933cc" class="m-dox-self" name="a8f4ce49763a03ecfccb8411d6f9933cc">is_empty</a>(</span><span class="m-dox-wrap">) const -> bool <span class="m-label m-flat m-success">noexcept</span></span>
|
||||
</dt>
|
||||
<dd>Returns true if the state of the result is empty.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a7169738aaff8bcda05ac5fd6fab47fc0" class="m-dox-self" name="a7169738aaff8bcda05ac5fd6fab47fc0">is_value</a>(</span><span class="m-dox-wrap">) const -> bool <span class="m-label m-flat m-success">noexcept</span></span>
|
||||
</dt>
|
||||
<dd>Returns true if the state of the result holds the result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a930153aeeb5c1adee5790a03c7d1cf57" class="m-dox-self" name="a930153aeeb5c1adee5790a03c7d1cf57">is_exception</a>(</span><span class="m-dox-wrap">) const -> bool <span class="m-label m-flat m-success">noexcept</span></span>
|
||||
</dt>
|
||||
<dd>Returns true if the state of the result holds a present exception.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a694038a262d07a04614175c298ebdcc0" class="m-dox-self" name="a694038a262d07a04614175c298ebdcc0">get_value</a>(</span><span class="m-dox-wrap">) &noexcept -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the values of the result, if the result doesn't hold the value the behaviour is undefined but will assert in debug mode.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a2aa4b69c46fbac6f1566cde08d3f5efc" class="m-dox-self" name="a2aa4b69c46fbac6f1566cde08d3f5efc">get_value</a>(</span><span class="m-dox-wrap">) const &noexcept -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the values of the result, if the result doesn't hold the value the behaviour is undefined but will assert in debug mode.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a0495256a7baa705b545af54b4d41f82d" class="m-dox-self" name="a0495256a7baa705b545af54b4d41f82d">get_value</a>(</span><span class="m-dox-wrap">) &&noexcept -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the values of the result, if the result doesn't hold the value the behaviour is undefined but will assert in debug mode.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ad7a9913309920864c75becde0c287700" class="m-dox-self" name="ad7a9913309920864c75becde0c287700">operator*</a>(</span><span class="m-dox-wrap">) &noexcept -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the values of the result, if the result doesn't hold the value the behaviour is undefined but will assert in debug mode.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a9d80e087aa5e051b1dd367e5ec1582a0" class="m-dox-self" name="a9d80e087aa5e051b1dd367e5ec1582a0">operator*</a>(</span><span class="m-dox-wrap">) const &noexcept -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the values of the result, if the result doesn't hold the value the behaviour is undefined but will assert in debug mode.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a8aa39c9d7f723b6878559ef216e4309b" class="m-dox-self" name="a8aa39c9d7f723b6878559ef216e4309b">operator*</a>(</span><span class="m-dox-wrap">) &&noexcept -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the values of the result, if the result doesn't hold the value the behaviour is undefined but will assert in debug mode.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a0f9014ced70c55772fab16cb594492d3" class="m-dox-self" name="a0f9014ced70c55772fab16cb594492d3">get_exception</a>(</span><span class="m-dox-wrap">) &noexcept -> <a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a>&</span>
|
||||
</dt>
|
||||
<dd>Returns the exception of the result, if the result doesn't hold an exception the behaviour is undefined but will assert in debug mode.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a3c7aa02b1df0766a42d9932d296cc1cf" class="m-dox-self" name="a3c7aa02b1df0766a42d9932d296cc1cf">get_exception</a>(</span><span class="m-dox-wrap">) const &noexcept -> <a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> const &</span>
|
||||
</dt>
|
||||
<dd>Returns the exception of the result, if the result doesn't hold an exception the behaviour is undefined but will assert in debug mode.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a9db24e9b4b51463f9031b4da5f4eb31e" class="m-dox-self" name="a9db24e9b4b51463f9031b4da5f4eb31e">get_exception</a>(</span><span class="m-dox-wrap">) &&noexcept -> <a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a>&&</span>
|
||||
</dt>
|
||||
<dd>Returns the exception of the result, if the result doesn't hold an exception the behaviour is undefined but will assert in debug mode.</dd>
|
||||
</dl>
|
||||
</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>
|
||||
175
configuration.html
Normal file
175
configuration.html
Normal file
@ -0,0 +1,175 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Configuration | 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" id="m-navbar-current">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>
|
||||
Configuration
|
||||
</h1>
|
||||
|
||||
<p>Covers optional preprocessor macros that change the libraries behaviour.</p>
|
||||
<p>By default the library doesn't require any preprocessor definitions to be defined in order to work. However it is possible to define some in order to change the libraries behaviour:</p><table class="m-table"><thead><tr><th>Preprocessor definition</th><th>Consequence</th></tr></thead><tbody><tr><td><code>CONTINUABLE_WITH_NO_EXCEPTIONS</code></td><td>Exceptions are disabled and <code>std::error_condition</code> is used as <a href="group___primitives.html#ga0220315293d1e2ebbda6be95fb3b2eeb" class="m-dox">error_<wbr />type</a> . See <a href="tutorial-chaining-continuables.html#tutorial-chaining-continuables-fail" class="m-dox">Using fail and exceptions</a> for details.</td></tr><tr><td><code>CONTINUABLE_WITH_CUSTOM_ERROR_TYPE</code></td><td>Exceptions are disabled and the type defined by <code>CONTINUABLE_WITH_CUSTOM_ERROR_TYPE</code> is used as <a href="group___primitives.html#ga0220315293d1e2ebbda6be95fb3b2eeb" class="m-dox">error_<wbr />type</a> . See <a href="tutorial-chaining-continuables.html#tutorial-chaining-continuables-fail" class="m-dox">Using fail and exceptions</a> for details.</td></tr><tr><td><code>CONTINUABLE_WITH_UNHANDLED_EXCEPTIONS</code></td><td>Allows unhandled exceptions in asynchronous call hierarchies. See <a href="tutorial-chaining-continuables.html#tutorial-chaining-continuables-fail" class="m-dox">Using fail and exceptions</a> for details.</td></tr><tr><td><code>CONTINUABLE_WITH_CUSTOM_FINAL_CALLBACK</code></td><td>Allows to customize the final callback which can be used to implement custom unhandled asynchronous exception handlers.</td></tr><tr><td><code>CONTINUABLE_WITH_IMMEDIATE_TYPES</code></td><td>Don't decorate the used type erasure, which is done to keep type names minimal for better error messages in debug builds.</td></tr><tr><td><code>CONTINUABLE_WITH_EXPERIMENTAL_COROUTINE</code></td><td>Enables support for experimental coroutines and <code>co_await</code> expressions. See <a href="classcti_1_1continuable__base.html#ac79b103d5c000a3a3d1b98d8adcf58e8" class="m-dox">continuable_base::<wbr />operator co_await()</a> for details.</td></tr></tbody></table>
|
||||
</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>
|
||||
174
deprecated.html
Normal file
174
deprecated.html
Normal file
@ -0,0 +1,174 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Deprecated List | 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>
|
||||
Deprecated List
|
||||
</h1>
|
||||
|
||||
<dl class="m-dox"><dt>Member <a href="group___primitives.html#gab374e033adf83bc3883410b9857cca41" class="m-dox">cti::<wbr />dispatch_error_tag</a></dt><dd><a name="_deprecated000002"></a>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.</dd><dt>Member <a href="group___primitives.html#ga0220315293d1e2ebbda6be95fb3b2eeb" class="m-dox">cti::<wbr />error_type</a></dt><dd><a name="_deprecated000003"></a>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.</dd><dt>Member <a href="group___primitives.html#ga2d717de3efb8ff74889a603bf141cbad" class="m-dox">cti::<wbr />query_arg_t</a></dt><dd><a name="_deprecated000001"></a>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>.</dd></dl>
|
||||
</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>
|
||||
187
files.html
Normal file
187
files.html
Normal file
@ -0,0 +1,187 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>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>Files</h2>
|
||||
<ul class="m-dox">
|
||||
</ul>
|
||||
<script>
|
||||
function toggle(e) {
|
||||
e.parentElement.className = e.parentElement.className == 'm-dox-collapsible' ?
|
||||
'm-dox-expansible' : 'm-dox-collapsible';
|
||||
return false;
|
||||
}
|
||||
/* Collapse all nodes marked as such. Doing it via JS instead of directly in
|
||||
markup so disabling it doesn't harm usability. The list is somehow
|
||||
regenerated on every iteration and shrinks as I change the classes. It's not
|
||||
documented anywhere and I'm not sure if this is the same across browsers, so
|
||||
I am going backwards in that list to be sure. */
|
||||
var collapsed = document.getElementsByClassName("collapsed");
|
||||
for(var i = collapsed.length - 1; i >= 0; --i)
|
||||
collapsed[i].className = 'm-dox-expansible';
|
||||
</script>
|
||||
</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>
|
||||
510
group___base.html
Normal file
510
group___base.html
Normal file
@ -0,0 +1,510 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Base 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" id="m-navbar-current">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>
|
||||
Base <span class="m-thin">module</span></h1>
|
||||
<p>provides classes and functions to create <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects.</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>
|
||||
<li><a href="#func-members">Functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="nested-classes">
|
||||
<h2><a href="#nested-classes">Classes</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Data, typename Annotation></div>
|
||||
class <a href="classcti_1_1continuable__base.html" class="m-dox">cti::continuable_base</a>
|
||||
</dt>
|
||||
<dd>The main class of the continuable library, it provides the functionality for chaining callbacks and continuations together to a unified hierarchy.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Data, typename Hint></div>
|
||||
class <a href="classcti_1_1promise__base.html" class="m-dox">cti::promise_base</a>
|
||||
</dt>
|
||||
<dd>The <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> makes it possible to resolve an asynchronous continuable through it's result or through an error type.</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 T></div>
|
||||
using <a href="#gabe4e73c301a2697d9252c400194474e0" class="m-dox">is_continuable</a> = detail::base::is_continuable<T>
|
||||
</dt>
|
||||
<dd>Deduces to a true_type if the given type is a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section id="func-members">
|
||||
<h2><a href="#func-members">Functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args, typename Continuation></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#gaf47869ea139d88976af5b9654d6d61c0" class="m-dox">make_continuable</a>(</span><span class="m-dox-wrap">Continuation&& continuation) -> auto <span class="m-label m-flat m-primary">constexpr</span></span>
|
||||
</dt>
|
||||
<dd>Creates a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> from a promise/callback taking function.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#gaa1b6bcf17649b137e29c866ced3569c7" class="m-dox">make_ready_continuable</a>(</span><span class="m-dox-wrap">Args && ... args) -> auto</span>
|
||||
</dt>
|
||||
<dd>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with no result which instantly resolves the promise with no values.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args, typename Exception></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga41794c321aef916f4fd0fe4c36aa9e6e" class="m-dox">make_exceptional_continuable</a>(</span><span class="m-dox-wrap">Exception&& exception) -> auto <span class="m-label m-flat m-primary">constexpr</span></span>
|
||||
</dt>
|
||||
<dd>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with the parameterized result which instantly resolves the promise with the given error type.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Signature></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga7f0646a26ba7ee4ce1ac42caeef3caa1" class="m-dox">make_cancelling_continuable</a>(</span><span class="m-dox-wrap">) -> auto</span>
|
||||
</dt>
|
||||
<dd>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with the parameterized result which never resolves its promise and thus cancels the asynchronous continuation chain through throwing a default constructed exception_t.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#gacc7ae86f30e3c0331861ce7871e310dd" class="m-dox">make_plain</a>(</span><span class="m-dox-wrap">T&& value) -> auto</span>
|
||||
</dt>
|
||||
<dd>Can be used to disable the special meaning for a returned value in asynchronous handler functions.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#gacdc6a77a2ff98dabd7a2e9dc8c461934" class="m-dox">recover</a>(</span><span class="m-dox-wrap">Args && ... args) -> result<detail::traits::unrefcv_t<Args>...></span>
|
||||
</dt>
|
||||
<dd>Can be used to recover to from a failure handler, the result handler which comes after will be called with the corresponding result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga9223cf1a04ca2d6950d83d0917192fa5" class="m-dox">rethrow</a>(</span><span class="m-dox-wrap">exception_t exception) -> exceptional_result</span>
|
||||
</dt>
|
||||
<dd>Can be used to rethrow an exception to the asynchronous continuation chain, the failure handler which comes after will be called with the corresponding exception.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga3c1710e55aab586d267f96a02f6cd014" class="m-dox">cancel</a>(</span><span class="m-dox-wrap">) -> cancellation_result</span>
|
||||
</dt>
|
||||
<dd>Can be used to cancel an asynchronous continuation chain, the next failure handler which comes after cancel will be called with a default constructed exception_t object.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#gac20d32604949856659f84c06ebcaeb9e" class="m-dox">stop</a>(</span><span class="m-dox-wrap">) -> empty_result</span>
|
||||
</dt>
|
||||
<dd>Can be used to stop an asynchronous continuation chain, no handler which comes after stop was received won't be called.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Typedef documentation</h2>
|
||||
<section class="m-dox-details" id="gabe4e73c301a2697d9252c400194474e0"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename T>
|
||||
</div>
|
||||
using <a href="#gabe4e73c301a2697d9252c400194474e0" class="m-dox-self">is_continuable</a> = detail::base::is_continuable<T>
|
||||
</h3>
|
||||
<p>Deduces to a true_type if the given type is a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</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="gaf47869ea139d88976af5b9654d6d61c0"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Args, typename Continuation>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#gaf47869ea139d88976af5b9654d6d61c0" class="m-dox-self">make_continuable</a>(</span><span class="m-dox-wrap">Continuation&& continuation) <span class="m-label m-primary">constexpr</span></span></span>
|
||||
</h3>
|
||||
<p>Creates a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> from a promise/callback taking function.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Template parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">Args</td>
|
||||
<td><p>The types (signature hint) the given promise is resolved with.</p><ul><li><p><strong>Some arguments</strong> indicate the types the promise will be invoked with.</p><pre class="m-code"><span class="k">auto</span> <span class="n">ct</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">([](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="mi">200</span><span class="p">,</span> <span class="s">"<html>...</html>"</span><span class="p">);</span>
|
||||
<span class="p">});</span></pre></li><li><p><code>void</code> <strong>as argument</strong> indicates that the promise will be invoked with no arguments:</p><pre class="m-code"><span class="k">auto</span> <span class="n">ct</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="kt">void</span><span class="o">></span><span class="p">([](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">();</span>
|
||||
<span class="p">});</span></pre></li><li><p><strong>No arguments</strong> Since version 3.0.0 make_continuable always requires to be given valid arguments! You should always give the type hint a callback is called with because it's required for intermediate actions like connecting continuables. You may omit the signature hint if you are erasing the type of the continuable right after creation.</p><pre class="m-code"><span class="c1">// This won't work because the arguments are missing:</span>
|
||||
<span class="k">auto</span> <span class="n">ct</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="p">([](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="mf">0.f</span><span class="p">,</span> <span class="sc">'c'</span><span class="p">);</span>
|
||||
<span class="p">});</span>
|
||||
|
||||
<span class="c1">// However, you are allowed to do this:</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">continuable</span><span class="o"><</span><span class="kt">float</span><span class="p">,</span> <span class="kt">char</span><span class="o">></span> <span class="n">ct</span> <span class="o">=</span> <span class="p">[](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="n">callback</span><span class="p">)(</span><span class="mf">0.f</span><span class="p">,</span> <span class="sc">'c'</span><span class="p">);</span>
|
||||
<span class="p">};</span></pre></li></ul></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Continuation</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>continuation</td>
|
||||
<td><p>The continuation the continuable is created from. The continuation must be a callable type accepting a callback parameter which represents the object invokable with the asynchronous result of this continuable.</p><pre class="m-code"><span class="k">auto</span> <span class="n">ct</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">([](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="s">"result"</span><span class="p">);</span>
|
||||
<span class="p">});</span></pre><p>The callback may be stored or moved. In some cases the callback may be copied if supported by the underlying callback chain, in order to invoke the call chain multiple times. It's recommended to accept any callback instead of erasing it.</p><pre class="m-code"><span class="c1">// Good practice:</span>
|
||||
<span class="k">auto</span> <span class="n">ct</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">([](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="s">"result"</span><span class="p">);</span>
|
||||
<span class="p">});</span>
|
||||
|
||||
<span class="c1">// Good practice using a callable object:</span>
|
||||
<span class="k">struct</span> <span class="n">Continuation</span> <span class="p">{</span>
|
||||
<span class="k">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="o">></span>
|
||||
<span class="kt">void</span> <span class="k">operator</span><span class="p">()</span> <span class="p">(</span><span class="n">T</span><span class="o">&&</span> <span class="n">continuation</span><span class="p">)</span> <span class="o">&&</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">auto</span> <span class="n">ct</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">(</span><span class="n">Continuation</span><span class="p">{});</span>
|
||||
|
||||
<span class="c1">// Bad practice (because of unnecessary type erasure):</span>
|
||||
<span class="k">auto</span> <span class="n">ct</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">(</span>
|
||||
<span class="p">[](</span><span class="n">cti</span><span class="o">::</span><span class="n">promise</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="s">"result"</span><span class="p">);</span>
|
||||
<span class="p">});</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td>A <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with unspecified template parameters which wraps the given continuation. In order to convert the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> to a known type you need to apply type erasure through the <a href="group___types.html#ga95d2328ba27fe194491b52073b58be50" class="m-dox">continuable</a> or <a href="group___types.html#gaaed43cf7309b600464b10fde4a3df0de" class="m-dox">promise</a> facilities.</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-info"><h4>Note</h4><p>You should always turn the callback/promise into a r-value if possible (<code>std::move</code> or <code>std::forward</code>) for qualifier correct invokation. Additionally it's important to know that all continuable promises are callbacks and just expose their call operator nicely through <a href="classcti_1_1promise__base.html#a223d666944a70441b3837b461b1094c7" class="m-dox">set_<wbr />value</a> and <a href="classcti_1_1promise__base.html#a449356e97645d44cf4194932cc2006d7" class="m-dox">set_<wbr />exception</a>.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gaa1b6bcf17649b137e29c866ced3569c7"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Args>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#gaa1b6bcf17649b137e29c866ced3569c7" class="m-dox-self">make_ready_continuable</a>(</span><span class="m-dox-wrap">Args && ... args)</span></span>
|
||||
</h3>
|
||||
<p>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with no result which instantly resolves the promise with no values.</p>
|
||||
<aside class="m-note m-warning"><h4>Attention</h4><p>Usually using this function isn't needed at all since the continuable library is capable of working with plain values in most cases. Try not to use it since it causes unnecessary recursive function calls.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga41794c321aef916f4fd0fe4c36aa9e6e"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Args, typename Exception>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga41794c321aef916f4fd0fe4c36aa9e6e" class="m-dox-self">make_exceptional_continuable</a>(</span><span class="m-dox-wrap">Exception&& exception) <span class="m-label m-primary">constexpr</span></span></span>
|
||||
</h3>
|
||||
<p>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with the parameterized result which instantly resolves the promise with the given error type.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Template parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">Args</td>
|
||||
<td>The fake signature of the returned continuable.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Exception</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>See an example below:</p><pre class="m-code"><span class="n">std</span><span class="o">::</span><span class="n">logic_error</span> <span class="n">exception</span><span class="p">(</span><span class="s">"Some issue!"</span><span class="p">);</span>
|
||||
<span class="k">auto</span> <span class="n">ptr</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">make_exception_ptr</span><span class="p">(</span><span class="n">exception</span><span class="p">);</span>
|
||||
<span class="k">auto</span> <span class="n">ct</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_exceptional_continuable</span><span class="o"><</span><span class="kt">int</span><span class="o">></span><span class="p">(</span><span class="n">ptr</span><span class="p">);</span></pre><aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga7f0646a26ba7ee4ce1ac42caeef3caa1"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Signature>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga7f0646a26ba7ee4ce1ac42caeef3caa1" class="m-dox-self">make_cancelling_continuable</a>(</span><span class="m-dox-wrap">)</span></span>
|
||||
</h3>
|
||||
<p>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with the parameterized result which never resolves its promise and thus cancels the asynchronous continuation chain through throwing a default constructed exception_t.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Template parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">Signature</td>
|
||||
<td>The fake signature of the returned continuable.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>This can be used to cancel an asynchronous continuation chain when returning a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> from a handler where other paths could possibly continue the asynchronous chain. See an example below:</p><pre class="m-code"><span class="n">do_sth</span><span class="p">().</span><span class="n">then</span><span class="p">([</span><span class="n">weak</span> <span class="o">=</span> <span class="k">this</span><span class="o">-></span><span class="n">weak_from_this</span><span class="p">()]()</span> <span class="o">-></span> <span class="n">continuable</span><span class="o"><></span> <span class="p">{</span>
|
||||
<span class="k">if</span> <span class="p">(</span><span class="k">auto</span> <span class="n">me</span> <span class="o">=</span> <span class="n">weak</span><span class="p">.</span><span class="n">lock</span><span class="p">())</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">do_sth_more</span><span class="p">();</span>
|
||||
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
|
||||
<span class="c1">// Abort the asynchronous continuation chain since the</span>
|
||||
<span class="c1">// weakly referenced object expired previously.</span>
|
||||
<span class="k">return</span> <span class="n">make_cancelling_continuable</span><span class="o"><</span><span class="kt">void</span><span class="o">></span><span class="p">();</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">});</span></pre><p>The default unhandled exception handler ignores exception types that don't evaluate to true when being converted to a bool. This saves expensive construction of std::exception_ptr or similar types, where only one exception type is used for signaling the cancellation.</p><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gacc7ae86f30e3c0331861ce7871e310dd"><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="#gacc7ae86f30e3c0331861ce7871e310dd" class="m-dox-self">make_plain</a>(</span><span class="m-dox-wrap">T&& value)</span></span>
|
||||
</h3>
|
||||
<p>Can be used to disable the special meaning for a returned value in asynchronous handler functions.</p>
|
||||
<p>Several types have a special meaning when being returned from a callable passed to asynchronous handler functions like:</p><ul><li><a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">continuable_base::<wbr />then</a></li><li><a href="classcti_1_1continuable__base.html#a7001122101ed32f729e39c53d6cb9c7f" class="m-dox">continuable_base::<wbr />fail</a></li><li><a href="classcti_1_1continuable__base.html#ad4960d0794abb800f1dfd9a668900149" class="m-dox">continuable_base::<wbr />next</a></li></ul><p>For instance such types are std::tuple, std::pair and <a href="classcti_1_1result.html" class="m-dox">cti::<wbr />result</a>.</p><p>Wrapping such an object through a call to make_plain disables the special meaning for such objects as shown below:</p><pre class="m-code"><span class="n">continuable</span><span class="o"><</span><span class="n">result</span><span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">c</span> <span class="o">=</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"example.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">content</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">make_plain</span><span class="p">(</span><span class="n">make_result</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">));</span>
|
||||
<span class="p">})</span></pre><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gacdc6a77a2ff98dabd7a2e9dc8c461934"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Args>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">result<detail::traits::unrefcv_t<Args>...> </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#gacdc6a77a2ff98dabd7a2e9dc8c461934" class="m-dox-self">recover</a>(</span><span class="m-dox-wrap">Args && ... args)</span></span>
|
||||
</h3>
|
||||
<p>Can be used to recover to from a failure handler, the result handler which comes after will be called with the corresponding result.</p>
|
||||
<p>The <a href="classcti_1_1exceptional__result.html" class="m-dox">exceptional_<wbr />result</a> returned by this function can be returned from any result or failure handler in order to rethrow the exception.</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"example.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">content</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">recover</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">([](</span><span class="n">cti</span><span class="o">::</span><span class="n">exception_t</span> <span class="n">exception</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">recover</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="kt">int</span> <span class="n">b</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Recovered from the failure</span>
|
||||
<span class="p">})</span></pre><p>A corresponding <a href="classcti_1_1result.html" class="m-dox">result</a> is returned by <a href="group___base.html#gacdc6a77a2ff98dabd7a2e9dc8c461934" class="m-dox">recover</a></p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"example.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">content</span><span class="p">)</span> <span class="o">-></span> <span class="n">cti</span><span class="o">::</span><span class="n">result</span><span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">recover</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">([](</span><span class="n">cti</span><span class="o">::</span><span class="n">exception_t</span> <span class="n">exception</span><span class="p">)</span> <span class="o">-></span> <span class="n">cti</span><span class="o">::</span><span class="n">result</span><span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">recover</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="kt">int</span> <span class="n">b</span><span class="p">)</span> <span class="o">-></span> <span class="n">cti</span><span class="o">::</span><span class="n">result</span><span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="p">{</span>
|
||||
<span class="c1">// Recovered from the failure</span>
|
||||
<span class="p">})</span></pre><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga9223cf1a04ca2d6950d83d0917192fa5"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">exceptional_result </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga9223cf1a04ca2d6950d83d0917192fa5" class="m-dox-self">rethrow</a>(</span><span class="m-dox-wrap">exception_t exception)</span></span>
|
||||
</h3>
|
||||
<p>Can be used to rethrow an exception to the asynchronous continuation chain, the failure handler which comes after will be called with the corresponding exception.</p>
|
||||
<p>The <a href="classcti_1_1exceptional__result.html" class="m-dox">exceptional_<wbr />result</a> returned by this function can be returned from any result or failure handler in order to rethrow the exception.</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"example.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">content</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">rethrow</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_exception_ptr</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="p">{}));</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">([](</span><span class="n">cti</span><span class="o">::</span><span class="n">exception_t</span> <span class="n">exception</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">rethrow</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_exception_ptr</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="p">{}));</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">next</span><span class="p">([](</span><span class="k">auto</span><span class="o">&&</span><span class="p">...)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">rethrow</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_exception_ptr</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="p">{}));</span>
|
||||
<span class="p">});</span></pre><p>The returned <a href="classcti_1_1exceptional__result.html" class="m-dox">exceptional_<wbr />result</a> is convertible to any <a href="classcti_1_1result.html" class="m-dox">result</a> as shown below:</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"example.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">content</span><span class="p">)</span> <span class="o">-></span> <span class="n">cti</span><span class="o">::</span><span class="n">result</span><span class="o"><></span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">rethrow</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_exception_ptr</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="p">{}));</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">([](</span><span class="n">cti</span><span class="o">::</span><span class="n">exception_t</span> <span class="n">exception</span><span class="p">)</span> <span class="o">-></span> <span class="n">cti</span><span class="o">::</span><span class="n">result</span><span class="o"><></span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">rethrow</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_exception_ptr</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="p">{}));</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">next</span><span class="p">([](</span><span class="k">auto</span><span class="o">&&</span><span class="p">...)</span> <span class="o">-></span> <span class="n">cti</span><span class="o">::</span><span class="n">result</span><span class="o"><></span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">rethrow</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_exception_ptr</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="p">{}));</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga3c1710e55aab586d267f96a02f6cd014"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">cancellation_result </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga3c1710e55aab586d267f96a02f6cd014" class="m-dox-self">cancel</a>(</span><span class="m-dox-wrap">)</span></span>
|
||||
</h3>
|
||||
<p>Can be used to cancel an asynchronous continuation chain, the next failure handler which comes after cancel will be called with a default constructed exception_t object.</p>
|
||||
<p>The <a href="structcti_1_1cancellation__result.html" class="m-dox">cancellation_<wbr />result</a> returned by this function can be returned from any result or failure handler in order to cancel the chain.</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"example.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">content</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cancel</span><span class="p">();</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">([](</span><span class="n">cti</span><span class="o">::</span><span class="n">exception_t</span> <span class="n">exception</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cancel</span><span class="p">();</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">next</span><span class="p">([](</span><span class="k">auto</span><span class="o">&&</span><span class="p">...)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cancel</span><span class="p">();</span>
|
||||
<span class="p">});</span></pre><p>The returned <a href="structcti_1_1empty__result.html" class="m-dox">empty_<wbr />result</a> is convertible to any <a href="classcti_1_1result.html" class="m-dox">result</a> as shown below:</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"example.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">content</span><span class="p">)</span> <span class="o">-></span> <span class="n">cti</span><span class="o">::</span><span class="n">result</span><span class="o"><></span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cancel</span><span class="p">();</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">([](</span><span class="n">cti</span><span class="o">::</span><span class="n">exception_t</span> <span class="n">exception</span><span class="p">)</span> <span class="o">-></span> <span class="n">cti</span><span class="o">::</span><span class="n">result</span><span class="o"><></span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cancel</span><span class="p">();</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">next</span><span class="p">([](</span><span class="k">auto</span><span class="o">&&</span><span class="p">...)</span> <span class="o">-></span> <span class="n">cti</span><span class="o">::</span><span class="n">result</span><span class="o"><></span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cancel</span><span class="p">();</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gac20d32604949856659f84c06ebcaeb9e"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">empty_result </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#gac20d32604949856659f84c06ebcaeb9e" class="m-dox-self">stop</a>(</span><span class="m-dox-wrap">)</span></span>
|
||||
</h3>
|
||||
<p>Can be used to stop an asynchronous continuation chain, no handler which comes after stop was received won't be called.</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>
|
||||
460
group___connections.html
Normal file
460
group___connections.html
Normal file
@ -0,0 +1,460 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Connections 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" id="m-navbar-current">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>
|
||||
Connections <span class="m-thin">module</span></h1>
|
||||
<p>provides functions to connect <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />bases</a> through various strategies.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#func-members">Functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="func-members">
|
||||
<h2><a href="#func-members">Functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#gaef652b8561f76cad49e83cfa21a71734" class="m-dox">when_all</a>(</span><span class="m-dox-wrap">Args && ... args) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with an all logic. All continuables contained inside the given nested pack are invoked at once. On completion the final handler is called with the aggregated result of all continuables.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Iterator, std::enable_if_t<detail::range::is_iterator<Iterator>::value>* = nullptr></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#gaa39f871e8aa99953dc83fda92b449024" class="m-dox">when_all</a>(</span><span class="m-dox-wrap">Iterator begin,
|
||||
Iterator end) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with an all logic. The content of the iterator is moved out and converted to a temporary <code>std::vector</code> which is then passed to when_all.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga481c31024079b6074617c64b16e615dd" class="m-dox">when_seq</a>(</span><span class="m-dox-wrap">Args && ... args) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with a sequential logic. All continuables contained inside the given nested pack are invoked one after one. On completion the final handler is called with the aggregated result of all continuables.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Iterator, std::enable_if_t<detail::range::is_iterator<Iterator>::value>* = nullptr></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga1d52caeca48122b5aebb276d0d47805a" class="m-dox">when_seq</a>(</span><span class="m-dox-wrap">Iterator begin,
|
||||
Iterator end) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with a sequential logic. The content of the iterator is moved out and converted to a temporary <code>std::vector</code> which is then passed to when_seq.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga313760e876d0cbc766b41f6b192544bb" class="m-dox">when_any</a>(</span><span class="m-dox-wrap">Args && ... args) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with an any logic. All continuables contained inside the given nested pack are invoked at once. On completion of one continuable the final handler is called with the result of the resolved continuable.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Iterator, std::enable_if_t<detail::range::is_iterator<Iterator>::value>* = nullptr></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga580b6b0d4fd31371b2f37e0dc5bf039b" class="m-dox">when_any</a>(</span><span class="m-dox-wrap">Iterator begin,
|
||||
Iterator end) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with an any logic. The content of the iterator is moved out and converted to a temporary <code>std::vector</code> which is then passed to when_all.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<template<typename, typename> class C = std::vector, typename First, typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga4f6ecedf4b4ccd5e1c28d937ad717b32" class="m-dox">populate</a>(</span><span class="m-dox-wrap">First&& first,
|
||||
Args && ... args) -> C<std::decay_t<First>, std::allocator<std::decay_t<First>>></span>
|
||||
</dt>
|
||||
<dd>Populates a homogeneous container from the given arguments. All arguments need to be convertible to the first one, by default <code>std::vector</code> is used as container type.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Function documentation</h2>
|
||||
<section class="m-dox-details" id="gaef652b8561f76cad49e83cfa21a71734"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Args>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#gaef652b8561f76cad49e83cfa21a71734" class="m-dox-self">when_all</a>(</span><span class="m-dox-wrap">Args && ... args)</span></span>
|
||||
</h3>
|
||||
<p>Connects the given arguments with an all logic. All continuables contained inside the given nested pack are invoked at once. On completion the final handler is called with the aggregated result of all continuables.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">args</td>
|
||||
<td><p>Arbitrary arguments which are connected. Every type is allowed as arguments, continuables may be contained inside tuple like types (<code>std::tuple</code>) or in homogeneous containers such as <code>std::vector</code>. Non continuable arguments are preserved and passed to the final result as shown below:</p><pre class="m-code"><span class="n">cti</span><span class="o">::</span><span class="n">when_all</span><span class="p">(</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
|
||||
<span class="mi">2</span><span class="p">,</span> <span class="c1">//< See this plain value</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">populate</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">3</span><span class="p">),</span> <span class="c1">// Creates a runtime</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">4</span><span class="p">)),</span> <span class="c1">// sized container.</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">5</span><span class="p">))))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">r0</span><span class="p">,</span> <span class="kt">int</span> <span class="n">r1</span><span class="p">,</span> <span class="kt">int</span> <span class="n">r2</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">int</span><span class="o">></span> <span class="n">r34</span><span class="p">,</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">tuple</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">tuple</span><span class="o"><</span><span class="kt">int</span><span class="o">>></span> <span class="n">r5</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<aside class="m-note m-default"><h4>See also</h4><p><a href="classcti_1_1continuable__base.html#ad5cbff40fcd03a6451eae06d310f1439" class="m-dox">continuable_base::<wbr />operator&&</a> for details.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.1.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gaa39f871e8aa99953dc83fda92b449024"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Iterator, std::enable_if_t<detail::range::is_iterator<Iterator>::value>* = nullptr>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#gaa39f871e8aa99953dc83fda92b449024" class="m-dox-self">when_all</a>(</span><span class="m-dox-wrap">Iterator begin,
|
||||
Iterator end)</span></span>
|
||||
</h3>
|
||||
<p>Connects the given arguments with an all logic. The content of the iterator is moved out and converted to a temporary <code>std::vector</code> which is then passed to when_all.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">begin</td>
|
||||
<td>The begin iterator to the range which will be moved out and used as the arguments to the all connection</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>end</td>
|
||||
<td>The end iterator to the range which will be moved out and used as the arguments to the all connection</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<pre class="m-code"><span class="c1">// cti::populate just creates a std::vector from the two continuables.</span>
|
||||
<span class="k">auto</span> <span class="n">v</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">populate</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">),</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">1</span><span class="p">));</span>
|
||||
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">when_all</span><span class="p">(</span><span class="n">v</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">v</span><span class="p">.</span><span class="n">end</span><span class="p">())</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">int</span><span class="o">></span> <span class="n">r01</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-default"><h4>See also</h4><p><a href="group___connections.html#gaef652b8561f76cad49e83cfa21a71734" class="m-dox">when_<wbr />all</a> for details.</p></aside><aside class="m-note m-warning"><h4>Attention</h4><p>Prefer to invoke when_all with the whole container the iterators were taken from, since this saves us the creation of a temporary storage.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga481c31024079b6074617c64b16e615dd"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Args>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga481c31024079b6074617c64b16e615dd" class="m-dox-self">when_seq</a>(</span><span class="m-dox-wrap">Args && ... args)</span></span>
|
||||
</h3>
|
||||
<p>Connects the given arguments with a sequential logic. All continuables contained inside the given nested pack are invoked one after one. On completion the final handler is called with the aggregated result of all continuables.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">args</td>
|
||||
<td><p>Arbitrary arguments which are connected. Every type is allowed as arguments, continuables may be contained inside tuple like types (<code>std::tuple</code>) or in homogeneous containers such as <code>std::vector</code>. Non continuable arguments are preserved and passed to the final result as shown below:</p><pre class="m-code"><span class="n">cti</span><span class="o">::</span><span class="n">when_seq</span><span class="p">(</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
|
||||
<span class="mi">2</span><span class="p">,</span> <span class="c1">//< See this plain value</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">populate</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">3</span><span class="p">),</span> <span class="c1">// Creates a runtime</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">4</span><span class="p">)),</span> <span class="c1">// sized container.</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">5</span><span class="p">))))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">r0</span><span class="p">,</span> <span class="kt">int</span> <span class="n">r1</span><span class="p">,</span> <span class="kt">int</span> <span class="n">r2</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">int</span><span class="o">></span> <span class="n">r34</span><span class="p">,</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">tuple</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">tuple</span><span class="o"><</span><span class="kt">int</span><span class="o">>></span> <span class="n">r5</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<aside class="m-note m-default"><h4>See also</h4><p><a href="classcti_1_1continuable__base.html#abaaaf8a35827456fead299851268760e" class="m-dox">continuable_base::<wbr />operator>></a> for details.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.1.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga1d52caeca48122b5aebb276d0d47805a"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Iterator, std::enable_if_t<detail::range::is_iterator<Iterator>::value>* = nullptr>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga1d52caeca48122b5aebb276d0d47805a" class="m-dox-self">when_seq</a>(</span><span class="m-dox-wrap">Iterator begin,
|
||||
Iterator end)</span></span>
|
||||
</h3>
|
||||
<p>Connects the given arguments with a sequential logic. The content of the iterator is moved out and converted to a temporary <code>std::vector</code> which is then passed to when_seq.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">begin</td>
|
||||
<td>The begin iterator to the range which will be moved out and used as the arguments to the sequential connection</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>end</td>
|
||||
<td>The end iterator to the range which will be moved out and used as the arguments to the sequential connection</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<pre class="m-code"><span class="c1">// cti::populate just creates a std::vector from the two continuables.</span>
|
||||
<span class="k">auto</span> <span class="n">v</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">populate</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">),</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">1</span><span class="p">));</span>
|
||||
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">when_seq</span><span class="p">(</span><span class="n">v</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">v</span><span class="p">.</span><span class="n">end</span><span class="p">())</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">int</span><span class="o">></span> <span class="n">r01</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-default"><h4>See also</h4><p><a href="group___connections.html#ga481c31024079b6074617c64b16e615dd" class="m-dox">when_<wbr />seq</a> for details.</p></aside><aside class="m-note m-warning"><h4>Attention</h4><p>Prefer to invoke when_seq with the whole container the iterators were taken from, since this saves us the creation of a temporary storage.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga313760e876d0cbc766b41f6b192544bb"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Args>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga313760e876d0cbc766b41f6b192544bb" class="m-dox-self">when_any</a>(</span><span class="m-dox-wrap">Args && ... args)</span></span>
|
||||
</h3>
|
||||
<p>Connects the given arguments with an any logic. All continuables contained inside the given nested pack are invoked at once. On completion of one continuable the final handler is called with the result of the resolved continuable.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">args</td>
|
||||
<td><p>Arbitrary arguments which are connected. Every type is allowed as arguments, continuables may be contained inside tuple like types (<code>std::tuple</code>) or in homogeneous containers such as <code>std::vector</code>. Non continuable arguments are preserved and passed to the final result as shown below:</p><pre class="m-code"><span class="n">cti</span><span class="o">::</span><span class="n">when_any</span><span class="p">(</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
|
||||
<span class="mi">2</span><span class="p">,</span> <span class="c1">//< See this plain value</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">populate</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">3</span><span class="p">),</span> <span class="c1">// Creates a runtime</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">4</span><span class="p">)),</span> <span class="c1">// sized container.</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">5</span><span class="p">))))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">r0</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<aside class="m-note m-default"><h4>See also</h4><p><a href="classcti_1_1continuable__base.html#ada74584fb95bf00a50d05072e933c144" class="m-dox">continuable_base::<wbr />operator||</a> for details.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.1.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga580b6b0d4fd31371b2f37e0dc5bf039b"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Iterator, std::enable_if_t<detail::range::is_iterator<Iterator>::value>* = nullptr>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga580b6b0d4fd31371b2f37e0dc5bf039b" class="m-dox-self">when_any</a>(</span><span class="m-dox-wrap">Iterator begin,
|
||||
Iterator end)</span></span>
|
||||
</h3>
|
||||
<p>Connects the given arguments with an any logic. The content of the iterator is moved out and converted to a temporary <code>std::vector</code> which is then passed to when_all.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">begin</td>
|
||||
<td>The begin iterator to the range which will be moved out and used as the arguments to the all connection</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>end</td>
|
||||
<td>The end iterator to the range which will be moved out and used as the arguments to the all connection</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<pre class="m-code"><span class="c1">// cti::populate just creates a std::vector from the two continuables.</span>
|
||||
<span class="k">auto</span> <span class="n">v</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">populate</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">),</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">1</span><span class="p">));</span>
|
||||
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">when_any</span><span class="p">(</span><span class="n">v</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">v</span><span class="p">.</span><span class="n">end</span><span class="p">())</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">r01</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-default"><h4>See also</h4><p><a href="group___connections.html#ga313760e876d0cbc766b41f6b192544bb" class="m-dox">when_<wbr />any</a> for details.</p></aside><aside class="m-note m-warning"><h4>Attention</h4><p>Prefer to invoke when_any with the whole container the iterators were taken from, since this saves us the creation of a temporary storage.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga4f6ecedf4b4ccd5e1c28d937ad717b32"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<template<typename, typename> class C = std::vector, typename First, typename... Args>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">C<std::decay_t<First>, std::allocator<std::decay_t<First>>> </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga4f6ecedf4b4ccd5e1c28d937ad717b32" class="m-dox-self">populate</a>(</span><span class="m-dox-wrap">First&& first,
|
||||
Args && ... args)</span></span>
|
||||
</h3>
|
||||
<p>Populates a homogeneous container from the given arguments. All arguments need to be convertible to the first one, by default <code>std::vector</code> is used as container type.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Template parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">C</td>
|
||||
<td>The container type which is used to store the arguments into.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>First</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Args</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>This method mainly helps to create a homogeneous container from a runtime known count of continuables which type isn't exactly known. All continuables which are passed to this function should be originating from the same source or a method called with the same types of arguments:</p><pre class="m-code"><span class="k">auto</span> <span class="n">container</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">populate</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">),</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">1</span><span class="p">)),</span>
|
||||
|
||||
<span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="mi">5</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// You may add more continuables to the container afterwards</span>
|
||||
<span class="n">container</span><span class="p">.</span><span class="n">emplace_back</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="n">i</span><span class="p">));</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">when_any</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">container</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre><p>Additionally it is possible to change the targeted container as below:</p><pre class="m-code"><span class="k">auto</span> <span class="n">container</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">populate</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">list</span><span class="o">></span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">),</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">1</span><span class="p">)),</span></pre><aside class="m-note m-default"><h4>Since</h4><p>3.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>
|
||||
175
group___operations.html
Normal file
175
group___operations.html
Normal file
@ -0,0 +1,175 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Operations 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>
|
||||
Operations <span class="m-thin">module</span></h1>
|
||||
<p>provides functions to work with asynchronous control flows.</p>
|
||||
<section>
|
||||
<h2>Function documentation</h2>
|
||||
</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>
|
||||
293
group___primitives.html
Normal file
293
group___primitives.html
Normal file
@ -0,0 +1,293 @@
|
||||
<!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>
|
||||
193
group___promisify.html
Normal file
193
group___promisify.html
Normal file
@ -0,0 +1,193 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Promisify 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" id="m-navbar-current">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>
|
||||
Promisify <span class="m-thin">module</span></h1>
|
||||
<p>provides helper methods to convert various callback styles to <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />bases</a>.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#nested-classes">Classes</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="nested-classes">
|
||||
<h2><a href="#nested-classes">Classes</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Result></div>
|
||||
class <a href="classcti_1_1promisify.html" class="m-dox">cti::promisify</a>
|
||||
</dt>
|
||||
<dd>Helper class for converting callback taking callable types into a a continuable. Various styles are supported.</dd>
|
||||
</dl>
|
||||
</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>
|
||||
288
group___result.html
Normal file
288
group___result.html
Normal file
@ -0,0 +1,288 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Result 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>
|
||||
Result <span class="m-thin">module</span></h1>
|
||||
<p>provides the <a href="classcti_1_1result.html" class="m-dox">result</a> class and corresponding utility functions to work with the result of an asynchronous operation which can possibly yield:</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>
|
||||
<li><a href="#func-members">Functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul><li><em>no result</em>: If the operation didn't finish</li><li><em>a value</em>: If the operation finished successfully</li><li><em>an exception</em>: If the operation finished with an exception or was cancelled.</li></ul>
|
||||
<section id="nested-classes">
|
||||
<h2><a href="#nested-classes">Classes</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
struct <a href="structcti_1_1empty__result.html" class="m-dox">cti::empty_result</a>
|
||||
</dt>
|
||||
<dd>A class which is convertible to any <a href="classcti_1_1result.html" class="m-dox">result</a> and that definitely holds no value so the real result gets invalidated when this object is passed to it.</dd>
|
||||
<dt>
|
||||
struct <a href="structcti_1_1cancellation__result.html" class="m-dox">cti::cancellation_result</a>
|
||||
</dt>
|
||||
<dd>A class which is convertible to any <a href="classcti_1_1result.html" class="m-dox">result</a> and that definitely holds a default constructed exception which signals the cancellation of the asynchronous control flow.</dd>
|
||||
<dt>
|
||||
class <a href="classcti_1_1exceptional__result.html" class="m-dox">cti::exceptional_result</a>
|
||||
</dt>
|
||||
<dd>A class which is convertible to any result and that holds an exception which is then passed to the converted result object.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... T></div>
|
||||
class <a href="classcti_1_1result.html" class="m-dox">cti::result</a>
|
||||
</dt>
|
||||
<dd>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.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section id="typedef-members">
|
||||
<h2><a href="#typedef-members">Typedefs</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
using <a href="#gaa4a7d06dc54b9058d15bf46305e4f282" class="m-dox">void_arg_t</a> = detail::void_arg_t
|
||||
</dt>
|
||||
<dd>A tag which represents present void values in result.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section id="func-members">
|
||||
<h2><a href="#func-members">Functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<div class="m-dox-template">template<std::size_t I, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga8c47cc24b02abb222a8bd7739ec3920e" class="m-dox-self" name="ga8c47cc24b02abb222a8bd7739ec3920e">get</a>(</span><span class="m-dox-wrap">result<T...>& result) -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the value at position I of the given result.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<std::size_t I, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga6d638c96597a30798bf74eb5a7968730" class="m-dox-self" name="ga6d638c96597a30798bf74eb5a7968730">get</a>(</span><span class="m-dox-wrap">result<T...> const& result) -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the value at position I of the given result.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<std::size_t I, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga61a97fe8e93c19e42f97396c6262281b" class="m-dox-self" name="ga61a97fe8e93c19e42f97396c6262281b">get</a>(</span><span class="m-dox-wrap">result<T...>&& result) -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the value at position I of the given result.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... T, typename Result = result<detail::traits::unrefcv_t<T>...>></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga2852fa60e4e34409e35a9f6e8ff5c816" class="m-dox">make_result</a>(</span><span class="m-dox-wrap">T && ... values) -> Result</span>
|
||||
</dt>
|
||||
<dd>Creates a present result from the given values.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#gae70b4f9c3ca8e28e559363a4bb9fee00" class="m-dox">make_result</a>(</span><span class="m-dox-wrap">exception_arg_t,
|
||||
exception_t exception) -> exceptional_result</span>
|
||||
</dt>
|
||||
<dd>Creates an <a href="classcti_1_1exceptional__result.html" class="m-dox">exceptional_<wbr />result</a> from the given exception.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Typedef documentation</h2>
|
||||
<section class="m-dox-details" id="gaa4a7d06dc54b9058d15bf46305e4f282"><div>
|
||||
<h3>
|
||||
using <a href="#gaa4a7d06dc54b9058d15bf46305e4f282" class="m-dox-self">void_arg_t</a> = detail::void_arg_t
|
||||
</h3>
|
||||
<p>A tag which represents present void values in result.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Function documentation</h2>
|
||||
<section class="m-dox-details" id="ga2852fa60e4e34409e35a9f6e8ff5c816"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... T, typename Result = result<detail::traits::unrefcv_t<T>...>>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">Result </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga2852fa60e4e34409e35a9f6e8ff5c816" class="m-dox-self">make_result</a>(</span><span class="m-dox-wrap">T && ... values)</span></span>
|
||||
</h3>
|
||||
<p>Creates a present result from the given values.</p>
|
||||
<p>This could be used to pass the result of the next handler to the same asynchronous path it came from as shown below:</p><pre class="m-code"><span class="n">make_ready_continuable</span><span class="p">().</span><span class="n">next</span><span class="p">([</span><span class="o">&</span><span class="p">](</span><span class="k">auto</span><span class="o">&&</span><span class="p">...</span> <span class="n">args</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">result</span><span class="o"><></span> <span class="n">captured</span> <span class="o">=</span> <span class="n">make_result</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">forward</span><span class="o"><</span><span class="k">decltype</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="o">></span><span class="p">(</span><span class="n">args</span><span class="p">)...);</span>
|
||||
<span class="k">return</span> <span class="nf">shutdown</span><span class="p">().</span><span class="n">then</span><span class="p">([</span><span class="n">captured</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">captured</span><span class="p">)]()</span> <span class="k">mutable</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">captured</span><span class="p">);</span>
|
||||
<span class="p">});</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gae70b4f9c3ca8e28e559363a4bb9fee00"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">exceptional_result </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#gae70b4f9c3ca8e28e559363a4bb9fee00" class="m-dox-self">make_result</a>(</span><span class="m-dox-wrap">exception_arg_t,
|
||||
exception_t exception)</span></span>
|
||||
</h3>
|
||||
<p>Creates an <a href="classcti_1_1exceptional__result.html" class="m-dox">exceptional_<wbr />result</a> from the given exception.</p>
|
||||
<p>This could be used to pass the result of the next handler to the same asynchronous path it came from as shown below:</p><pre class="m-code"><span class="n">make_ready_continuable</span><span class="p">().</span><span class="n">next</span><span class="p">([</span><span class="o">&</span><span class="p">](</span><span class="k">auto</span><span class="o">&&</span><span class="p">...</span> <span class="n">args</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">result</span><span class="o"><></span> <span class="n">captured</span> <span class="o">=</span> <span class="n">make_result</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">forward</span><span class="o"><</span><span class="k">decltype</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="o">></span><span class="p">(</span><span class="n">args</span><span class="p">)...);</span>
|
||||
<span class="k">return</span> <span class="nf">shutdown</span><span class="p">().</span><span class="n">then</span><span class="p">([</span><span class="n">captured</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">captured</span><span class="p">)]()</span> <span class="k">mutable</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">captured</span><span class="p">);</span>
|
||||
<span class="p">});</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p><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>
|
||||
340
group___testing.html
Normal file
340
group___testing.html
Normal file
@ -0,0 +1,340 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Testing 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" id="m-navbar-current">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>
|
||||
Testing <span class="m-thin">module</span></h1>
|
||||
<p>provides macro shortcuts for testing asynchronous continuations through GTest.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#defines">Defines</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="define-members">
|
||||
<h2><a href="#define-members">Defines</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga19705a633c93b9df4df17aa612138475" class="m-dox">ASSERT_ASYNC_COMPLETION</a>(</span><span class="m-dox-wrap">CONTINUABLE)</span>
|
||||
</dt>
|
||||
<dd>Asserts that the final callback of the given continuable was called with any result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga83a8a6551404b672fed165166b0528c4" class="m-dox">ASSERT_ASYNC_EXCEPTION_COMPLETION</a>(</span><span class="m-dox-wrap">CONTINUABLE)</span>
|
||||
</dt>
|
||||
<dd>Asserts that the final callback of the given continuable was called with any exceptional result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga129a31287952beabf94bdd22c3af9042" class="m-dox">ASSERT_ASYNC_CANCELLATION</a>(</span><span class="m-dox-wrap">CONTINUABLE)</span>
|
||||
</dt>
|
||||
<dd>Asserts that the final callback of the given continuable is called with a cancelled result which is represented by a default constructed exception_t.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#gaa89eda3eb76b7604d75d1928e51e00b4" class="m-dox">ASSERT_ASYNC_INCOMPLETION</a>(</span><span class="m-dox-wrap">CONTINUABLE)</span>
|
||||
</dt>
|
||||
<dd>Asserts that the final callback of the given continuable is never called with any result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#gadc19a4b21ca4f61f61c6c031dd57d822" class="m-dox-self" name="gadc19a4b21ca4f61f61c6c031dd57d822">ASSERT_ASYNC_VALIDATION</a>(</span><span class="m-dox-wrap">CONTINUABLE,
|
||||
VALIDATOR)</span>
|
||||
</dt>
|
||||
<dd>Expects the continuation to be called and forwards it's arguments to the given validator which can then do assertions on the result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#gaf8390b0c3997a58f77ec852c1121341e" class="m-dox">ASSERT_ASYNC_BINARY_VALIDATION</a>(</span><span class="m-dox-wrap">VALIDATOR,
|
||||
...)</span>
|
||||
</dt>
|
||||
<dd>Asserts that the continuation was called and forwards it's arguments to the given validator which can then do assertions on the result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#gaea321a35e497cff7f897482cb95f0d47" class="m-dox">ASSERT_ASYNC_BINARY_EXCEPTION_VALIDATION</a>(</span><span class="m-dox-wrap">VALIDATOR,
|
||||
...)</span>
|
||||
</dt>
|
||||
<dd>Asserts that the continuation was resolved through an error and forwards it's error result to the given validator which can then do assertions on the error result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga1c28bfaf6b8246a96ebe44020771c059" class="m-dox">EXPECT_ASYNC_RESULT</a>(</span><span class="m-dox-wrap">...)</span>
|
||||
</dt>
|
||||
<dd>Expects that the continuable is finished with the given result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga98e249af2f132d3f30c63ed4ca8d0452" class="m-dox">EXPECT_ASYNC_EXCEPTION_RESULT</a>(</span><span class="m-dox-wrap">...)</span>
|
||||
</dt>
|
||||
<dd>Asserts that the continuable is finished with the given exception.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga0e66f753c9c0a3ef7c4b2313d5feef90" class="m-dox">ASSERT_ASYNC_RESULT</a>(</span><span class="m-dox-wrap">...)</span>
|
||||
</dt>
|
||||
<dd>Asserts that the continuable is finished with the given result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#gafb7fdd53d1d70f518386fdda37dce87b" class="m-dox">ASSERT_ASYNC_TYPES</a>(</span><span class="m-dox-wrap">CONTINUABLE,
|
||||
...)</span>
|
||||
</dt>
|
||||
<dd>Asserts that the continuable is finished with the given type of arguments without validating it against equality.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga913e34a5390c17cf27eb34674e5c6417" class="m-dox">ASSERT_ASYNC_EXCEPTION_RESULT</a>(</span><span class="m-dox-wrap">...)</span>
|
||||
</dt>
|
||||
<dd>Asserts that the continuable is finished with the given exception.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Define documentation</h2>
|
||||
<section class="m-dox-details" id="ga19705a633c93b9df4df17aa612138475"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga19705a633c93b9df4df17aa612138475" class="m-dox-self">ASSERT_ASYNC_COMPLETION</a>(</span><span class="m-dox-wrap">CONTINUABLE)</span>
|
||||
</h3>
|
||||
<p>Asserts that the final callback of the given continuable was called with any result.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga83a8a6551404b672fed165166b0528c4"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga83a8a6551404b672fed165166b0528c4" class="m-dox-self">ASSERT_ASYNC_EXCEPTION_COMPLETION</a>(</span><span class="m-dox-wrap">CONTINUABLE)</span>
|
||||
</h3>
|
||||
<p>Asserts that the final callback of the given continuable was called with any exceptional result.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>2.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga129a31287952beabf94bdd22c3af9042"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga129a31287952beabf94bdd22c3af9042" class="m-dox-self">ASSERT_ASYNC_CANCELLATION</a>(</span><span class="m-dox-wrap">CONTINUABLE)</span>
|
||||
</h3>
|
||||
<p>Asserts that the final callback of the given continuable is called with a cancelled result which is represented by a default constructed exception_t.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gaa89eda3eb76b7604d75d1928e51e00b4"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#gaa89eda3eb76b7604d75d1928e51e00b4" class="m-dox-self">ASSERT_ASYNC_INCOMPLETION</a>(</span><span class="m-dox-wrap">CONTINUABLE)</span>
|
||||
</h3>
|
||||
<p>Asserts that the final callback of the given continuable is never called with any result.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gaf8390b0c3997a58f77ec852c1121341e"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#gaf8390b0c3997a58f77ec852c1121341e" class="m-dox-self">ASSERT_ASYNC_BINARY_VALIDATION</a>(</span><span class="m-dox-wrap">VALIDATOR,
|
||||
...)</span>
|
||||
</h3>
|
||||
<p>Asserts that the continuation was called and forwards it's arguments to the given validator which can then do assertions on the result.</p>
|
||||
<p>A validator consists of a binary consumer with a signature as in in the example shown below:</p><pre class="m-code"><span class="k">auto</span> <span class="n">validator</span> <span class="o">=</span> <span class="p">[](</span><span class="k">auto</span> <span class="n">expected</span><span class="p">,</span> <span class="k">auto</span> <span class="n">actual</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">EXPECT_EQ</span><span class="p">(</span><span class="n">expected</span><span class="p">,</span> <span class="n">actual</span><span class="p">);</span>
|
||||
<span class="p">};</span></pre><p>The macro is usable as shown in the following example:</p><pre class="m-code"><span class="n">continuable</span><span class="o"><</span><span class="n">string</span><span class="o">></span> <span class="n">async_get</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">);</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="k">auto</span> <span class="n">validator</span> <span class="o">=</span> <span class="p">[](</span><span class="k">auto</span> <span class="n">expected</span><span class="p">,</span> <span class="k">auto</span> <span class="n">actual</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">EXPECT_EQ</span><span class="p">(</span><span class="n">expected</span><span class="p">,</span> <span class="n">actual</span><span class="p">);</span>
|
||||
<span class="p">};</span>
|
||||
|
||||
<span class="n">ASSERT_ASYNC_BINARY_VALIDATION</span><span class="p">(</span><span class="n">validator</span><span class="p">,</span> <span class="n">async_get</span><span class="p">(</span><span class="s">"hello"</span><span class="p">),</span> <span class="s">"hello"</span><span class="p">)</span></pre><p>The validator is called for every expecting and actual result.</p><aside class="m-note m-info"><h4>Note</h4><p>This macro is mainly present for building other assertions relying on custom validation logic.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gaea321a35e497cff7f897482cb95f0d47"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#gaea321a35e497cff7f897482cb95f0d47" class="m-dox-self">ASSERT_ASYNC_BINARY_EXCEPTION_VALIDATION</a>(</span><span class="m-dox-wrap">VALIDATOR,
|
||||
...)</span>
|
||||
</h3>
|
||||
<p>Asserts that the continuation was resolved through an error and forwards it's error result to the given validator which can then do assertions on the error result.</p>
|
||||
<aside class="m-note m-info"><h4>Note</h4><p>This macro is mainly present for building other assertions relying on custom validation logic.</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="ga1c28bfaf6b8246a96ebe44020771c059"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga1c28bfaf6b8246a96ebe44020771c059" class="m-dox-self">EXPECT_ASYNC_RESULT</a>(</span><span class="m-dox-wrap">...)</span>
|
||||
</h3>
|
||||
<p>Expects that the continuable is finished with the given result.</p>
|
||||
<pre class="m-code"><span class="n">continuable</span><span class="o"><</span><span class="n">string</span><span class="o">></span> <span class="n">async_get</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">);</span>
|
||||
<span class="c1">// ...</span>
|
||||
|
||||
<span class="n">EXPECT_ASYNC_RESULT</span><span class="p">(</span><span class="n">async_get</span><span class="p">(</span><span class="s">"hello"</span><span class="p">),</span> <span class="s">"hello"</span><span class="p">);</span></pre><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga98e249af2f132d3f30c63ed4ca8d0452"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga98e249af2f132d3f30c63ed4ca8d0452" class="m-dox-self">EXPECT_ASYNC_EXCEPTION_RESULT</a>(</span><span class="m-dox-wrap">...)</span>
|
||||
</h3>
|
||||
<p>Asserts that the continuable is finished with the given exception.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>2.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga0e66f753c9c0a3ef7c4b2313d5feef90"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga0e66f753c9c0a3ef7c4b2313d5feef90" class="m-dox-self">ASSERT_ASYNC_RESULT</a>(</span><span class="m-dox-wrap">...)</span>
|
||||
</h3>
|
||||
<p>Asserts that the continuable is finished with the given result.</p>
|
||||
<pre class="m-code"><span class="n">continuable</span><span class="o"><</span><span class="n">string</span><span class="o">></span> <span class="n">async_get</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">);</span>
|
||||
<span class="c1">// ...</span>
|
||||
|
||||
<span class="n">ASSERT_ASYNC_RESULT</span><span class="p">(</span><span class="n">async_get</span><span class="p">(</span><span class="s">"hello"</span><span class="p">),</span> <span class="s">"hello"</span><span class="p">);</span></pre><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gafb7fdd53d1d70f518386fdda37dce87b"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#gafb7fdd53d1d70f518386fdda37dce87b" class="m-dox-self">ASSERT_ASYNC_TYPES</a>(</span><span class="m-dox-wrap">CONTINUABLE,
|
||||
...)</span>
|
||||
</h3>
|
||||
<p>Asserts that the continuable is finished with the given type of arguments without validating it against equality.</p>
|
||||
<pre class="m-code"><span class="n">continuable</span><span class="o"><</span><span class="n">string</span><span class="o">></span> <span class="n">async_get</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">);</span>
|
||||
<span class="c1">// ...</span>
|
||||
|
||||
<span class="n">ASSERT_ASYNC_TYPES</span><span class="p">(</span><span class="n">async_get</span><span class="p">(</span><span class="s">"hello"</span><span class="p">),</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">);</span></pre><aside class="m-note m-info"><h4>Note</h4><p>This is a compile-time assertion.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga913e34a5390c17cf27eb34674e5c6417"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">#define <a href="#ga913e34a5390c17cf27eb34674e5c6417" class="m-dox-self">ASSERT_ASYNC_EXCEPTION_RESULT</a>(</span><span class="m-dox-wrap">...)</span>
|
||||
</h3>
|
||||
<p>Asserts that the continuable is finished with the given exception.</p>
|
||||
<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">
|
||||
<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>
|
||||
190
group___transforms.html
Normal file
190
group___transforms.html
Normal file
@ -0,0 +1,190 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<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">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" 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 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>
|
||||
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>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="namespaces">
|
||||
<h2><a href="#namespaces">Namespaces</a></h2>
|
||||
<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>
|
||||
</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>
|
||||
382
group___traversal.html
Normal file
382
group___traversal.html
Normal file
@ -0,0 +1,382 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Traversal 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" id="m-navbar-current">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>
|
||||
Traversal <span class="m-thin">module</span></h1>
|
||||
<p>provides functions to traverse and remap nested packs.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#typedef-members">Typedefs</a></li>
|
||||
<li><a href="#func-members">Functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="typedef-members">
|
||||
<h2><a href="#typedef-members">Typedefs</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
using <a href="#ga170b41a7aacd94036f9da0af42c6558d" class="m-dox">async_traverse_visit_tag</a> = detail::traversal::async_traverse_visit_tag
|
||||
</dt>
|
||||
<dd>A tag which is passed to the <code>operator()</code> of the visitor if an element is visited synchronously through <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</dd>
|
||||
<dt>
|
||||
using <a href="#gacc6d0dce8126550436303d433c96b1d7" class="m-dox">async_traverse_detach_tag</a> = detail::traversal::async_traverse_detach_tag
|
||||
</dt>
|
||||
<dd>A tag which is passed to the <code>operator()</code> of the visitor if an element is visited after the traversal was detached through <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</dd>
|
||||
<dt>
|
||||
using <a href="#ga1c9f6c5ba9ffb68ff36a1f95b78e7d3a" class="m-dox">async_traverse_complete_tag</a> = detail::traversal::async_traverse_complete_tag
|
||||
</dt>
|
||||
<dd>A tag which is passed to the <code>operator()</code> of the visitor if the asynchronous pack traversal was finished through <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename T></div>
|
||||
using <a href="#gaf67b511265fa74dc4b117cdb1ce9d1e3" class="m-dox">async_traverse_in_place_tag</a> = detail::traversal::async_traverse_in_place_tag<T>
|
||||
</dt>
|
||||
<dd>A tag to identify that a mapper shall be constructed in-place from the first argument passed to <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section id="func-members">
|
||||
<h2><a href="#func-members">Functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Visitor, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_pack_async</a>(</span><span class="m-dox-wrap">Visitor&& visitor,
|
||||
T && ... pack) -> auto</span>
|
||||
</dt>
|
||||
<dd>Traverses the pack with the given visitor in an asynchronous way.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Mapper, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#gace27f8127eb5eba0f4ab753daacf6a57" class="m-dox">map_pack</a>(</span><span class="m-dox-wrap">Mapper&& mapper,
|
||||
T && ... pack) -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Maps the pack with the given mapper.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ga7c14358f4d11803b50ab9687dfcb11c5" class="m-dox">spread_this</a>(</span><span class="m-dox-wrap">T && ... args) -> detail::traversal::spreading::spread_box<std::decay_t<T>...> <span class="m-label m-flat m-primary">constexpr</span> <span class="m-label m-flat m-success">noexcept(…)</span></span>
|
||||
</dt>
|
||||
<dd>Indicate that the result shall be spread across the parent container if possible. This can be used to create a mapper function used in map_pack that maps one element to an arbitrary count (1:n).</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Mapper, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">void <a href="#gab497ec8ef4cf8532703fcb9852846a2e" class="m-dox">traverse_pack</a>(</span><span class="m-dox-wrap">Mapper&& mapper,
|
||||
T && ... pack)</span>
|
||||
</dt>
|
||||
<dd>Traverses the pack with the given visitor.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Typedef documentation</h2>
|
||||
<section class="m-dox-details" id="ga170b41a7aacd94036f9da0af42c6558d"><div>
|
||||
<h3>
|
||||
using <a href="#ga170b41a7aacd94036f9da0af42c6558d" class="m-dox-self">async_traverse_visit_tag</a> = detail::traversal::async_traverse_visit_tag
|
||||
</h3>
|
||||
<p>A tag which is passed to the <code>operator()</code> of the visitor if an element is visited synchronously through <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gacc6d0dce8126550436303d433c96b1d7"><div>
|
||||
<h3>
|
||||
using <a href="#gacc6d0dce8126550436303d433c96b1d7" class="m-dox-self">async_traverse_detach_tag</a> = detail::traversal::async_traverse_detach_tag
|
||||
</h3>
|
||||
<p>A tag which is passed to the <code>operator()</code> of the visitor if an element is visited after the traversal was detached through <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga1c9f6c5ba9ffb68ff36a1f95b78e7d3a"><div>
|
||||
<h3>
|
||||
using <a href="#ga1c9f6c5ba9ffb68ff36a1f95b78e7d3a" class="m-dox-self">async_traverse_complete_tag</a> = detail::traversal::async_traverse_complete_tag
|
||||
</h3>
|
||||
<p>A tag which is passed to the <code>operator()</code> of the visitor if the asynchronous pack traversal was finished through <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gaf67b511265fa74dc4b117cdb1ce9d1e3"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename T>
|
||||
</div>
|
||||
using <a href="#gaf67b511265fa74dc4b117cdb1ce9d1e3" class="m-dox-self">async_traverse_in_place_tag</a> = detail::traversal::async_traverse_in_place_tag<T>
|
||||
</h3>
|
||||
<p>A tag to identify that a mapper shall be constructed in-place from the first argument passed to <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</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="ga02922d0c5bf7a18340069b3500a0cf90"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Visitor, typename... T>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox-self">traverse_pack_async</a>(</span><span class="m-dox-wrap">Visitor&& visitor,
|
||||
T && ... pack)</span></span>
|
||||
</h3>
|
||||
<p>Traverses the pack with the given visitor in an asynchronous way.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">visitor</td>
|
||||
<td>A visitor object which provides the three <code>operator()</code> overloads that were described above. Additionally the visitor must be compatible for referencing it from a <code>boost::intrusive_ptr</code>. The visitor should must have a virtual destructor!</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pack</td>
|
||||
<td>The arbitrary parameter pack which is traversed asynchronously. Nested objects inside containers and tuple like types are traversed recursively.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td>A std::shared_ptr that references an instance of the given visitor object.</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<p>This function works in the same way as <code>traverse_pack</code>, however, we are able to suspend and continue the traversal at later time. Thus we require a visitor callable object which provides three <code>operator()</code> overloads as depicted by the code sample below:</p><pre class="m-code"><span class="k">struct</span> <span class="n">my_async_visitor</span> <span class="p">{</span>
|
||||
<span class="k">template</span> <span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="o">></span>
|
||||
<span class="kt">bool</span> <span class="k">operator</span><span class="p">()(</span><span class="n">async_traverse_visit_tag</span><span class="p">,</span> <span class="n">T</span><span class="o">&&</span> <span class="n">element</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">template</span> <span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="p">,</span> <span class="k">typename</span> <span class="n">N</span><span class="o">></span>
|
||||
<span class="kt">void</span> <span class="k">operator</span><span class="p">()(</span><span class="n">async_traverse_detach_tag</span><span class="p">,</span> <span class="n">T</span><span class="o">&&</span> <span class="n">element</span><span class="p">,</span> <span class="n">N</span><span class="o">&&</span> <span class="n">next</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">template</span> <span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="o">></span>
|
||||
<span class="kt">void</span> <span class="k">operator</span><span class="p">()(</span><span class="n">async_traverse_complete_tag</span><span class="p">,</span> <span class="n">T</span><span class="o">&&</span> <span class="n">pack</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">};</span></pre><aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside><p>See <code>traverse_pack</code> for a detailed description about the traversal behaviour and capabilities.</p>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gace27f8127eb5eba0f4ab753daacf6a57"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Mapper, typename... T>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">decltype(auto) </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#gace27f8127eb5eba0f4ab753daacf6a57" class="m-dox-self">map_pack</a>(</span><span class="m-dox-wrap">Mapper&& mapper,
|
||||
T && ... pack)</span></span>
|
||||
</h3>
|
||||
<p>Maps the pack with the given mapper.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">mapper</td>
|
||||
<td>A callable object, which accept an arbitrary type and maps it to another type or the same one.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pack</td>
|
||||
<td>An arbitrary variadic pack which may contain any type.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Returns</th>
|
||||
<td>The mapped element or in case the pack contains multiple elements, the pack is wrapped into a <code>std::tuple</code>.</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead>
|
||||
<tr><th colspan="2">Exceptions</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>std::exception</td>
|
||||
<td>like objects which are thrown by an invocation to the mapper.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>This function tries to visit all plain elements which may be wrapped in:</p><ul><li>homogeneous containers (<code>std::vector</code>, <code>std::list</code>)</li><li>heterogenous containers <code>(std::tuple</code>, <code>std::pair</code>, <code>std::array</code>) and re-assembles the pack with the result of the mapper. Mapping from one type to a different one is supported.</li></ul><p>Elements that aren't accepted by the mapper are routed through and preserved through the hierarchy.</p><pre class="m-code"><span class="c1">// Maps all integers to floats</span>
|
||||
<span class="n">map_pack</span><span class="p">([](</span><span class="kt">int</span> <span class="n">value</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="kt">float</span><span class="p">(</span><span class="n">value</span><span class="p">);</span>
|
||||
<span class="p">},</span>
|
||||
<span class="mi">1</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">int</span><span class="o">></span><span class="p">{</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">}),</span> <span class="mi">5</span><span class="p">);</span></pre><aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga7c14358f4d11803b50ab9687dfcb11c5"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... T>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">detail::traversal::spreading::spread_box<std::decay_t<T>...> </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ga7c14358f4d11803b50ab9687dfcb11c5" class="m-dox-self">spread_this</a>(</span><span class="m-dox-wrap">T && ... args) <span class="m-label m-primary">constexpr</span> <span class="m-label m-success">noexcept(…)</span></span></span>
|
||||
</h3>
|
||||
<p>Indicate that the result shall be spread across the parent container if possible. This can be used to create a mapper function used in map_pack that maps one element to an arbitrary count (1:n).</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>3.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gab497ec8ef4cf8532703fcb9852846a2e"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Mapper, typename... T>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">void </span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#gab497ec8ef4cf8532703fcb9852846a2e" class="m-dox-self">traverse_pack</a>(</span><span class="m-dox-wrap">Mapper&& mapper,
|
||||
T && ... pack)</span></span>
|
||||
</h3>
|
||||
<p>Traverses the pack with the given visitor.</p>
|
||||
<p>This function works in the same way as <code>map_pack</code>, however, the result of the mapper isn't preserved.</p><p>See <code>map_pack</code> for a detailed description.</p><aside class="m-note m-default"><h4>Since</h4><p>3.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>
|
||||
247
group___types.html
Normal file
247
group___types.html
Normal file
@ -0,0 +1,247 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Types 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" id="m-navbar-current">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>
|
||||
Types <span class="m-thin">module</span></h1>
|
||||
<p>provides the <a href="group___types.html#ga95d2328ba27fe194491b52073b58be50" class="m-dox">continuable</a> and <a href="group___types.html#gaaed43cf7309b600464b10fde4a3df0de" class="m-dox">promise</a> facility for type erasure.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#typedef-members">Typedefs</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<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="#ga4e33254143db6484c753a19662f933aa" class="m-dox">continuation_capacity</a> = detail::erasure::continuation_capacity<Args...>
|
||||
</dt>
|
||||
<dd>Deduces to the preferred continuation capacity for a possible small functor optimization. The given capacity size is always enough to to avoid any allocation when storing a ready <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
using <a href="#ga95d2328ba27fe194491b52073b58be50" class="m-dox">continuable</a> = continuable_base<detail::erasure::continuation<Args...>, signature_arg_t<Args...>>
|
||||
</dt>
|
||||
<dd>Defines a non-copyable continuation type which uses the function2 backend for type erasure.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
using <a href="#gaaed43cf7309b600464b10fde4a3df0de" class="m-dox">promise</a> = promise_base<detail::erasure::callback<Args...>, signature_arg_t<Args...>>
|
||||
</dt>
|
||||
<dd>Defines a non-copyable promise type which is using the function2 backend for type erasure.</dd>
|
||||
<dt>
|
||||
using <a href="#ga95694d77afbef8b5a715b9e715ffdeb9" class="m-dox">work</a> = promise_base<detail::erasure::work, signature_arg_t<>>
|
||||
</dt>
|
||||
<dd>Defines a non-copyable type erasure which is capable of carrying callable objects passed to executors.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Typedef documentation</h2>
|
||||
<section class="m-dox-details" id="ga4e33254143db6484c753a19662f933aa"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Args>
|
||||
</div>
|
||||
using <a href="#ga4e33254143db6484c753a19662f933aa" class="m-dox-self">continuation_capacity</a> = detail::erasure::continuation_capacity<Args...>
|
||||
</h3>
|
||||
<p>Deduces to the preferred continuation capacity for a possible small functor optimization. The given capacity size is always enough to to avoid any allocation when storing a ready <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<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="ga95d2328ba27fe194491b52073b58be50"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Args>
|
||||
</div>
|
||||
using <a href="#ga95d2328ba27fe194491b52073b58be50" class="m-dox-self">continuable</a> = continuable_base<detail::erasure::continuation<Args...>, signature_arg_t<Args...>>
|
||||
</h3>
|
||||
<p>Defines a non-copyable continuation type which uses the function2 backend for type erasure.</p>
|
||||
<p>Usable like: <code>continuable<int, float></code></p><aside class="m-note m-info"><h4>Note</h4><p>You can always define your own continuable with a type erasure of choice, the type erasure wrapper just needs to accept a callable object with a continuation signature as specified in the Primitives section.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="gaaed43cf7309b600464b10fde4a3df0de"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Args>
|
||||
</div>
|
||||
using <a href="#gaaed43cf7309b600464b10fde4a3df0de" class="m-dox-self">promise</a> = promise_base<detail::erasure::callback<Args...>, signature_arg_t<Args...>>
|
||||
</h3>
|
||||
<p>Defines a non-copyable promise type which is using the function2 backend for type erasure.</p>
|
||||
<p>Usable like: <code>promise<int, float></code></p><aside class="m-note m-info"><h4>Note</h4><p>You can always define your own promise with a type erasure of choice, the type erasure wrapper just needs to accept a callable object with a callback signature as specified in the Primitives section.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>1.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="ga95694d77afbef8b5a715b9e715ffdeb9"><div>
|
||||
<h3>
|
||||
using <a href="#ga95694d77afbef8b5a715b9e715ffdeb9" class="m-dox-self">work</a> = promise_base<detail::erasure::work, signature_arg_t<>>
|
||||
</h3>
|
||||
<p>Defines a non-copyable type erasure which is capable of carrying callable objects passed to executors.</p>
|
||||
<p>The work behaves like a <code>promise<></code> but the work type erasure uses extra stack space for small object optimization. Additionally the outstanding work can be resolved through an exception.</p><aside class="m-note m-info"><h4>Note</h4><p>You can always define your own cancelable_work with a type erasure of choice, the type erasure wrapper just needs to accept a callable object which is callable with a <code>void()</code> and <code>void(exception_arg_t, exception_t)</code> signature.</p></aside><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>
|
||||
3
highlight.min.js
vendored
Normal file
3
highlight.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
191
index.html
Normal file
191
index.html
Normal file
@ -0,0 +1,191 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>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">
|
||||
<div class="terminal">
|
||||
<div class="fakeMenu">
|
||||
<div class="fakeButtons fakeClose"></div>
|
||||
<div class="fakeButtons fakeMinimize"></div>
|
||||
<div class="fakeButtons fakeZoom"></div>
|
||||
</div>
|
||||
<div class="fakeScreen">
|
||||
<pre><code id="typedterminal" class="cpp"></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="starbar">
|
||||
<iframe src="https://ghbtns.com/github-btn.html?user=naios&repo=continuable&type=star&count=true" frameborder="0" scrolling="0" width="200px" height="20px"></iframe>
|
||||
<iframe src="https://ghbtns.com/github-btn.html?user=Naios&type=follow" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
|
||||
</div>
|
||||
</br>
|
||||
|
||||
<script src="typed.js"></script>
|
||||
<script src="highlight.min.js"></script>
|
||||
<script src="terminal.js"></script>
|
||||
|
||||
<section id="mainpage-overview"><h2><a href="#mainpage-overview">Overview</a></h2><p><strong>Continuable is a C++14 library that provides full support for:</strong></p><ul><li>lazy async continuation chaining based on <strong>callbacks</strong> (<a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">then</a>) and expression templates, callbacks are wrapped nicely as <a href="classcti_1_1promise__base.html" class="m-dox">promises</a>.</li><li><strong>no enforced type-erasure</strong> which means we need <strong>less heap allocations</strong> than comparable libraries, strictly following the <strong>"don't
|
||||
pay for what you don't use"</strong> principle.</li><li>support for <strong>all, any and sequential connections</strong> between continuables through expressive operator overloads <a href="classcti_1_1continuable__base.html#ad5cbff40fcd03a6451eae06d310f1439" class="m-dox">&&</a>, <a href="classcti_1_1continuable__base.html#ada74584fb95bf00a50d05072e933c144" class="m-dox">||</a> and <a href="classcti_1_1continuable__base.html#abaaaf8a35827456fead299851268760e" class="m-dox">>></a> as well as free functions <a href="group___connections.html#gaef652b8561f76cad49e83cfa21a71734" class="m-dox">when_<wbr />all</a>, <a href="group___connections.html#ga313760e876d0cbc766b41f6b192544bb" class="m-dox">when_<wbr />any</a> and <a href="group___connections.html#ga481c31024079b6074617c64b16e615dd" class="m-dox">when_<wbr />seq</a>.</li><li>asynchronous <a href="classcti_1_1continuable__base.html#a7001122101ed32f729e39c53d6cb9c7f" class="m-dox">error handling</a> through <a href="classcti_1_1promise__base.html#a449356e97645d44cf4194932cc2006d7" class="m-dox">exceptions</a>, <a href="configuration.html" class="m-dox">error codes</a> and <a href="configuration.html" class="m-dox">user defined types</a>.</li><li><strong>syntactic sugar</strong> for instance: <strong>partial invocation</strong>, <strong>tuple unpacking</strong>, <code>co_await</code> support and <a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">executors</a>.</li><li><strong>encapsuled from any runtime</strong>, larger framework or executors makes it possible to use continuable even in smaller or esoteric usage scenarios.</li></ul></section><section id="mainpage-getting-started"><h2><a href="#mainpage-getting-started">Getting started</a></h2><p>Continuable is a header-only library with zero compilation dependencies. The <a href="installation.html" class="m-dox">Installation</a> and <a href="configuration.html" class="m-dox">Configuration</a> are explained in its own chapter.</p><p>The <a href="tutorial.html" class="m-dox">Tutorial</a> is everything you need in order to get to know the libraries API. Beside of this, there is a detailed in-source documentation provided.</p><p>Continuable follows the semantic versioning schema and changes are listed in the <a href="changelog.html" class="m-dox">Changelog</a>.</p></section><section id="mainpage-contact"><h2><a href="#mainpage-contact">Contributing and Questions</a></h2><p>Through the <a href="https://github.com/Naios/continuable/issues">Github issue tracker</a> you are welcomed to ask for questions, contribute code or request new features. Also I would like to hear your personal opinion about the library design or your personal experience in using the library to improve it.</p><aside class="m-note m-warning"><h4>Attention</h4><p>If you like the library I would be glad if you star it on Github, because it helps other users to find this library.</p></aside><aside class="m-note m-info"><h4>Note</h4><p>If you are using the library in your open-source or commercial project I would highly appreciate if you could give me a short notice so I can add you to a list of projects and companies using this library.</p></aside></section><section id="mainpage-license"><h2><a href="#mainpage-license">License</a></h2><p>Continuable is licensed under the MIT license:</p><blockquote><p>Copyright(c) 2015 - 2020 Denis Blank <denis.blank at outlook dot com></p><p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :</p><p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p><p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p></blockquote></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>
|
||||
201
installation.html
Normal file
201
installation.html
Normal file
@ -0,0 +1,201 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Installation | 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" id="m-navbar-current">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>
|
||||
Installation
|
||||
</h1>
|
||||
|
||||
<p>An explanation on how to install continuable on various platforms.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li><a href="#installation-requirements">Requirements</a></li>
|
||||
<li><a href="#installation-dependencies">Dependencies</a></li>
|
||||
<li>
|
||||
<a href="#installation-installation">Installation</a>
|
||||
<ul>
|
||||
<li><a href="#installation-installation-cmake">Through CMake</a></li>
|
||||
<li><a href="#installation-installation-pkg">Through package managers</a></li>
|
||||
<li><a href="#installation-installation-amalgamation">By using the amalgamation header</a></li>
|
||||
<li><a href="#installation-installation-copy">By copying the headers</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#installation-unit-tests">Building the unit tests</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="installation-requirements"><h2><a href="#installation-requirements">Requirements</a></h2><p>Continuable requires a fairly new toolchain and was verified to work with following compilers:</p><ul><li>Visual Studio 2017+ Update 2</li><li>Clang 5.0+</li><li>GCC 6.0+</li></ul><p>Although the build is observed with the listed compilers earlier versions might work.</p><aside class="m-note m-danger"><h4>Warning</h4><p>GCC is proven to be slower than Clang in template compilation and thus it is suggested to use Clang instead.</p></aside></section><section id="installation-dependencies"><h2><a href="#installation-dependencies">Dependencies</a></h2><p>Continuable is a header-only library with one required header-only dependency:</p><ul><li><a href="https://github.com/Naios/function2">Naios/<wbr />function2</a> is used as type erasure wrapper to convert a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> into a <a href="group___types.html#ga95d2328ba27fe194491b52073b58be50" class="m-dox">continuable</a>.</li></ul><p>Additionally GTest is required as optional dependency for the asynchronous unit testing macros defined in <code>continuable/support/gtest.hpp</code> if those are used:</p><ul><li><a href="https://github.com/google/googletest">google/<wbr />googletest</a> is used as unit testing framework and to provide asynchronous testing macros.</li></ul><p>For the examples and unit tests there might be more dependencies used, which are fetched through git submodules.</p><aside class="m-note m-info"><h4>Note</h4><p>The library only depends on the standard library when following headers are used:</p><ul><li><code><a href="continuable-base_8hpp.html" class="m-dox">continuable/<wbr />continuable-base.hpp</a></code></li><li><code><a href="continuable-promise-base_8hpp.html" class="m-dox">continuable/<wbr />continuable-promise-base.hpp</a></code></li><li><code><a href="continuable-connections_8hpp.html" class="m-dox">continuable/<wbr />continuable-connections.hpp</a></code></li><li><code><a href="continuable-promisify_8hpp.html" class="m-dox">continuable/<wbr />continuable-promisify.hpp</a></code></li><li><code><a href="continuable-transforms_8hpp.html" class="m-dox">continuable/<wbr />continuable-transforms.hpp</a></code></li></ul></aside></section><section id="installation-installation"><h2><a href="#installation-installation">Installation</a></h2><p>Making continuable available inside your project is possible through various ways.</p><section id="installation-installation-cmake"><h3><a href="#installation-installation-cmake">Through CMake</a></h3><p>The continuable build is driven by CMake and the project exposes CMake interface targets when being used by external projects:</p><pre class="m-code"><span class="nb">add_subdirectory</span><span class="p">(</span><span class="s">continuable</span><span class="p">)</span>
|
||||
<span class="c"># continuable provides an interface target which makes it's</span>
|
||||
<span class="c"># headers available to all projects using the continuable library.</span>
|
||||
<span class="nb">target_link_libraries</span><span class="p">(</span><span class="s">my_project</span> <span class="s">continuable</span><span class="p">)</span></pre><p>When adding the continuable subdirectory as git submodule this should work out of the box.</p><pre class="m-code">git submodule add https://github.com/Naios/continuable.git</pre><aside class="m-note m-warning"><h4>Attention</h4><p>On POSIX platforms you are required to link your application against a corresponding thread library, otherwise <code>std::futures</code> won't work properly, this is done automatically by the provided CMake project.</p></aside><p>Additionally the CMake project exports a <code>continuable</code> target which is importable through the <code class="m-code"><span class="err">find_package</span></code> CMake command when installed:</p><pre class="m-code">mkdir build
|
||||
<span class="nb">cd</span> build
|
||||
cmake ..
|
||||
cmake --build . --target INSTALL --config Release</pre><p>In your <code>CMakeLists.txt</code>:</p><pre class="m-code"><span class="nb">find_package</span><span class="p">(</span><span class="s">continuable</span> <span class="s">REQUIRED</span><span class="p">)</span></pre></section><section id="installation-installation-pkg"><h3><a href="#installation-installation-pkg">Through package managers</a></h3><p>Continuable is present in some package managers and registries already, and might be installed from there.</p><aside class="m-note m-warning"><h4>Attention</h4><p>The project is still looking for contributions that would help to make it available from various package managers in order to make the installation easier.</p></aside></section><section id="installation-installation-amalgamation"><h3><a href="#installation-installation-amalgamation">By using the amalgamation header</a></h3><p>For major versions there is an amalgamation header provided which can be included without any dependency:</p><ul><li><a href="https://gist.githubusercontent.com/Naios/25d731aa4707d35a9bcec507f3cb9038/raw/051d2ea07b6704893c7fc9844e8d1c105c6821e0/continuable.hpp">4.0.0</a></li><li><a href="https://gist.githubusercontent.com/Naios/b128ab5028a7eb33e4285c0293573d9f/raw/79fe332964a786b21a8661ef65d07a5669260a3c/continuable.hpp">3.0.0</a></li></ul></section><section id="installation-installation-copy"><h3><a href="#installation-installation-copy">By copying the headers</a></h3><p>If you don't want to rely on CMake or package managers it is possible to copy and include the <code>include</code> directories of continuable and <a href="https://github.com/Naios/function2">Naios/<wbr />function2</a> into your project.</p><p>As an improvement git submodules could be used:</p><pre class="m-code">git submodule add https://github.com/Naios/continuable.git
|
||||
git submodule add https://github.com/Naios/function2.git</pre></section></section><section id="installation-unit-tests"><h2><a href="#installation-unit-tests">Building the unit tests</a></h2><p>In order to build the unit tests clone the repository recursively with all submodules:</p><pre class="m-code"><span class="c1"># Shell:</span>
|
||||
git clone --recursive https://github.com/Naios/continuable.git</pre><p>Then CMake can be used to generate a project solution for testing.</p></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>
|
||||
2780
m-dark+doxygen.compiled.css
Normal file
2780
m-dark+doxygen.compiled.css
Normal file
File diff suppressed because it is too large
Load Diff
197
modules.html
Normal file
197
modules.html
Normal file
@ -0,0 +1,197 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>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" id="m-navbar-current">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>Modules</h2>
|
||||
<ul class="m-dox">
|
||||
<li>module <a href="group___base.html" class="m-dox">Base</a> <span class="m-dox">provides classes and functions to create <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects.</span></li>
|
||||
<li>module <a href="group___connections.html" class="m-dox">Connections</a> <span class="m-dox">provides functions to connect <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />bases</a> through various strategies.</span></li>
|
||||
<li>module <a href="group___operations.html" class="m-dox">Operations</a> <span class="m-dox">provides functions to work with asynchronous control flows.</span></li>
|
||||
<li>module <a href="group___primitives.html" class="m-dox">Primitives</a> <span class="m-dox">provides basic tag types for creating a customized callbacks and continuations.</span></li>
|
||||
<li>module <a href="group___promisify.html" class="m-dox">Promisify</a> <span class="m-dox">provides helper methods to convert various callback styles to <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />bases</a>.</span></li>
|
||||
<li>module <a href="group___result.html" class="m-dox">Result</a> <span class="m-dox">provides the <a href="classcti_1_1result.html" class="m-dox">result</a> class and corresponding utility functions to work with the result of an asynchronous operation which can possibly yield:</span></li>
|
||||
<li>module <a href="group___transforms.html" class="m-dox">Transforms</a> <span class="m-dox">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>).</span></li>
|
||||
<li>module <a href="group___traversal.html" class="m-dox">Traversal</a> <span class="m-dox">provides functions to traverse and remap nested packs.</span></li>
|
||||
<li>module <a href="group___types.html" class="m-dox">Types</a> <span class="m-dox">provides the <a href="group___types.html#ga95d2328ba27fe194491b52073b58be50" class="m-dox">continuable</a> and <a href="group___types.html#gaaed43cf7309b600464b10fde4a3df0de" class="m-dox">promise</a> facility for type erasure.</span></li>
|
||||
<li>module <a href="group___testing.html" class="m-dox">Testing</a> <span class="m-dox">provides macro shortcuts for testing asynchronous continuations through GTest.</span></li>
|
||||
</ul>
|
||||
<script>
|
||||
function toggle(e) {
|
||||
e.parentElement.className = e.parentElement.className == 'm-dox-collapsible' ?
|
||||
'm-dox-expansible' : 'm-dox-collapsible';
|
||||
return false;
|
||||
}
|
||||
/* Collapse all nodes marked as such. Doing it via JS instead of directly in
|
||||
markup so disabling it doesn't harm usability. The list is somehow
|
||||
regenerated on every iteration and shrinks as I change the classes. It's not
|
||||
documented anywhere and I'm not sure if this is the same across browsers, so
|
||||
I am going backwards in that list to be sure. */
|
||||
var collapsed = document.getElementsByClassName("collapsed");
|
||||
for(var i = collapsed.length - 1; i >= 0; --i)
|
||||
collapsed[i].className = 'm-dox-expansible';
|
||||
</script>
|
||||
</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>
|
||||
585
namespacecti.html
Normal file
585
namespacecti.html
Normal file
@ -0,0 +1,585 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti namespace | 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" id="m-navbar-current">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>
|
||||
cti <span class="m-thin">namespace</span>
|
||||
</h1>
|
||||
<p>Declares the continuable library namespace.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#namespaces">Namespaces</a></li>
|
||||
<li><a href="#nested-classes">Classes</a></li>
|
||||
<li><a href="#typedef-members">Typedefs</a></li>
|
||||
<li><a href="#func-members">Functions</a></li>
|
||||
<li><a href="#var-members">Variables</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>The most important class is <a href="classcti_1_1continuable__base.html" class="m-dox">cti::<wbr />continuable_base</a>, that provides the whole functionality for continuation chaining.</p><p>The class <a href="classcti_1_1continuable__base.html" class="m-dox">cti::<wbr />continuable_base</a> is created through the <a href="group___base.html#gaf47869ea139d88976af5b9654d6d61c0" class="m-dox">cti::<wbr />make_continuable()</a> function which accepts a callback taking function.</p><p>Also there are following support functions available:</p><ul><li><a href="group___connections.html#gaef652b8561f76cad49e83cfa21a71734" class="m-dox">cti::<wbr />when_all()</a> - connects <a href="classcti_1_1continuable__base.html" class="m-dox">cti::<wbr />continuable_base</a>'s to an <code>all</code> connection.</li><li><a href="group___connections.html#ga313760e876d0cbc766b41f6b192544bb" class="m-dox">cti::<wbr />when_any()</a> - connects <a href="classcti_1_1continuable__base.html" class="m-dox">cti::<wbr />continuable_base</a>'s to an <code>any</code> connection.</li><li><a href="group___connections.html#ga481c31024079b6074617c64b16e615dd" class="m-dox">cti::<wbr />when_seq()</a> - connects <a href="classcti_1_1continuable__base.html" class="m-dox">cti::<wbr />continuable_base</a>'s to a sequence.</li></ul>
|
||||
<section id="namespaces">
|
||||
<h2><a href="#namespaces">Namespaces</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>namespace <a href="namespacecti_1_1transforms.html" class="m-dox">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="nested-classes">
|
||||
<h2><a href="#nested-classes">Classes</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
struct <a href="structcti_1_1cancellation__result.html" class="m-dox">cancellation_result</a>
|
||||
</dt>
|
||||
<dd>A class which is convertible to any <a href="classcti_1_1result.html" class="m-dox">result</a> and that definitely holds a default constructed exception which signals the cancellation of the asynchronous control flow.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Data, typename Annotation></div>
|
||||
class <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_base</a>
|
||||
</dt>
|
||||
<dd>The main class of the continuable library, it provides the functionality for chaining callbacks and continuations together to a unified hierarchy.</dd>
|
||||
<dt>
|
||||
struct <a href="structcti_1_1empty__result.html" class="m-dox">empty_result</a>
|
||||
</dt>
|
||||
<dd>A class which is convertible to any <a href="classcti_1_1result.html" class="m-dox">result</a> and that definitely holds no value so the real result gets invalidated when this object is passed to it.</dd>
|
||||
<dt>
|
||||
struct <a href="structcti_1_1exception__arg__t.html" class="m-dox">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>
|
||||
<dt>
|
||||
class <a href="classcti_1_1exceptional__result.html" class="m-dox">exceptional_result</a>
|
||||
</dt>
|
||||
<dd>A class which is convertible to any result and that holds an exception which is then passed to the converted result object.</dd>
|
||||
<dt>
|
||||
struct <a href="structcti_1_1is__ready__arg__t.html" class="m-dox">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>
|
||||
<div class="m-dox-template">template<typename Data, typename Hint></div>
|
||||
class <a href="classcti_1_1promise__base.html" class="m-dox">promise_base</a>
|
||||
</dt>
|
||||
<dd>The <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> makes it possible to resolve an asynchronous continuable through it's result or through an error type.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Result></div>
|
||||
class <a href="classcti_1_1promisify.html" class="m-dox">promisify</a>
|
||||
</dt>
|
||||
<dd>Helper class for converting callback taking callable types into a a continuable. Various styles are supported.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... T></div>
|
||||
class <a href="classcti_1_1result.html" class="m-dox">result</a>
|
||||
</dt>
|
||||
<dd>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.</dd>
|
||||
<dt>
|
||||
struct <a href="structcti_1_1unpack__arg__t.html" class="m-dox">unpack_arg_t</a>
|
||||
</dt>
|
||||
<dd>Represents the tag type that is used to unpack the result of a continuation.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Mapper = detail::asio::map_default></div>
|
||||
struct <a href="structcti_1_1use__continuable__t.html" class="m-dox">use_continuable_t</a>
|
||||
</dt>
|
||||
<dd>Type used as an ASIO completion token to specify an asynchronous operation that should return a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</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 T></div>
|
||||
using <a href="group___base.html#gabe4e73c301a2697d9252c400194474e0" class="m-dox">is_continuable</a> = detail::base::is_continuable<T>
|
||||
</dt>
|
||||
<dd>Deduces to a true_type if the given type is a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
using <a href="group___primitives.html#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="group___primitives.html#ga2d717de3efb8ff74889a603bf141cbad" class="m-dox">query_arg_t</a> = <a href="structcti_1_1unpack__arg__t.html" class="m-dox">unpack_<wbr />arg_<wbr />t</a> <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="group___primitives.html#gab374e033adf83bc3883410b9857cca41" class="m-dox">dispatch_error_tag</a> = <a href="structcti_1_1exception__arg__t.html" class="m-dox">exception_<wbr />arg_<wbr />t</a> <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="group___primitives.html#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="group___primitives.html#ga0220315293d1e2ebbda6be95fb3b2eeb" class="m-dox">error_type</a> = <a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> <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="group___primitives.html#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>
|
||||
<dt>
|
||||
using <a href="group___result.html#gaa4a7d06dc54b9058d15bf46305e4f282" class="m-dox">void_arg_t</a> = detail::void_arg_t
|
||||
</dt>
|
||||
<dd>A tag which represents present void values in result.</dd>
|
||||
<dt>
|
||||
using <a href="group___traversal.html#ga170b41a7aacd94036f9da0af42c6558d" class="m-dox">async_traverse_visit_tag</a> = detail::traversal::async_traverse_visit_tag
|
||||
</dt>
|
||||
<dd>A tag which is passed to the <code>operator()</code> of the visitor if an element is visited synchronously through <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</dd>
|
||||
<dt>
|
||||
using <a href="group___traversal.html#gacc6d0dce8126550436303d433c96b1d7" class="m-dox">async_traverse_detach_tag</a> = detail::traversal::async_traverse_detach_tag
|
||||
</dt>
|
||||
<dd>A tag which is passed to the <code>operator()</code> of the visitor if an element is visited after the traversal was detached through <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</dd>
|
||||
<dt>
|
||||
using <a href="group___traversal.html#ga1c9f6c5ba9ffb68ff36a1f95b78e7d3a" class="m-dox">async_traverse_complete_tag</a> = detail::traversal::async_traverse_complete_tag
|
||||
</dt>
|
||||
<dd>A tag which is passed to the <code>operator()</code> of the visitor if the asynchronous pack traversal was finished through <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename T></div>
|
||||
using <a href="group___traversal.html#gaf67b511265fa74dc4b117cdb1ce9d1e3" class="m-dox">async_traverse_in_place_tag</a> = detail::traversal::async_traverse_in_place_tag<T>
|
||||
</dt>
|
||||
<dd>A tag to identify that a mapper shall be constructed in-place from the first argument passed to <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_<wbr />pack_<wbr />async</a>.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
using <a href="group___types.html#ga4e33254143db6484c753a19662f933aa" class="m-dox">continuation_capacity</a> = detail::erasure::continuation_capacity<Args...>
|
||||
</dt>
|
||||
<dd>Deduces to the preferred continuation capacity for a possible small functor optimization. The given capacity size is always enough to to avoid any allocation when storing a ready <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
using <a href="group___types.html#ga95d2328ba27fe194491b52073b58be50" class="m-dox">continuable</a> = <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a><detail::erasure::continuation<Args...>, <a href="group___primitives.html#ga0471bc4c43101c3f077c0601c617abce" class="m-dox">signature_<wbr />arg_<wbr />t</a><Args...>>
|
||||
</dt>
|
||||
<dd>Defines a non-copyable continuation type which uses the function2 backend for type erasure.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
using <a href="group___types.html#gaaed43cf7309b600464b10fde4a3df0de" class="m-dox">promise</a> = <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a><detail::erasure::callback<Args...>, <a href="group___primitives.html#ga0471bc4c43101c3f077c0601c617abce" class="m-dox">signature_<wbr />arg_<wbr />t</a><Args...>>
|
||||
</dt>
|
||||
<dd>Defines a non-copyable promise type which is using the function2 backend for type erasure.</dd>
|
||||
<dt>
|
||||
using <a href="group___types.html#ga95694d77afbef8b5a715b9e715ffdeb9" class="m-dox">work</a> = <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a><detail::erasure::work, <a href="group___primitives.html#ga0471bc4c43101c3f077c0601c617abce" class="m-dox">signature_<wbr />arg_<wbr />t</a><>>
|
||||
</dt>
|
||||
<dd>Defines a non-copyable type erasure which is capable of carrying callable objects passed to executors.</dd>
|
||||
<dt>
|
||||
using <a href="#a637f3ade8400faa575b4a6ef584f4431" class="m-dox">asio_error_code_t</a> = detail::asio::error_code_t
|
||||
</dt>
|
||||
<dd>The error code type used by your asio distribution.</dd>
|
||||
<dt>
|
||||
using <a href="#a33044c007ff02f6324954167003f5c36" class="m-dox">asio_basic_errors_t</a> = detail::asio::basic_errors_t
|
||||
</dt>
|
||||
<dd>The basic error code enum used by your asio distribution.</dd>
|
||||
<dt>
|
||||
using <a href="#a8681a592a8360d66100a7e72e555bf4f" class="m-dox">asio_system_error_t</a> = detail::asio::system_error_t
|
||||
</dt>
|
||||
<dd>The system error type used by your asio distribution.</dd>
|
||||
<dt>
|
||||
using <a href="#a4d0da7830d56f4e638a2dc23d1bc27db" class="m-dox">use_continuable_raw_t</a> = <a href="structcti_1_1use__continuable__t.html" class="m-dox">use_<wbr />continuable_<wbr />t</a><detail::asio::map_none>
|
||||
</dt>
|
||||
<dd>Type used as an ASIO completion token to specify an asynchronous operation that should return a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section id="func-members">
|
||||
<h2><a href="#func-members">Functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args, typename Continuation></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___base.html#gaf47869ea139d88976af5b9654d6d61c0" class="m-dox">make_continuable</a>(</span><span class="m-dox-wrap">Continuation&& continuation) -> auto <span class="m-label m-flat m-primary">constexpr</span></span>
|
||||
</dt>
|
||||
<dd>Creates a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> from a promise/callback taking function.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___base.html#gaa1b6bcf17649b137e29c866ced3569c7" class="m-dox">make_ready_continuable</a>(</span><span class="m-dox-wrap">Args && ... args) -> auto</span>
|
||||
</dt>
|
||||
<dd>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with no result which instantly resolves the promise with no values.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args, typename Exception></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___base.html#ga41794c321aef916f4fd0fe4c36aa9e6e" class="m-dox">make_exceptional_continuable</a>(</span><span class="m-dox-wrap">Exception&& exception) -> auto <span class="m-label m-flat m-primary">constexpr</span></span>
|
||||
</dt>
|
||||
<dd>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with the parameterized result which instantly resolves the promise with the given error type.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Signature></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___base.html#ga7f0646a26ba7ee4ce1ac42caeef3caa1" class="m-dox">make_cancelling_continuable</a>(</span><span class="m-dox-wrap">) -> auto</span>
|
||||
</dt>
|
||||
<dd>Returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with the parameterized result which never resolves its promise and thus cancels the asynchronous continuation chain through throwing a default constructed exception_t.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___base.html#gacc7ae86f30e3c0331861ce7871e310dd" class="m-dox">make_plain</a>(</span><span class="m-dox-wrap">T&& value) -> auto</span>
|
||||
</dt>
|
||||
<dd>Can be used to disable the special meaning for a returned value in asynchronous handler functions.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___base.html#gacdc6a77a2ff98dabd7a2e9dc8c461934" class="m-dox">recover</a>(</span><span class="m-dox-wrap">Args && ... args) -> <a href="classcti_1_1result.html" class="m-dox">result</a><detail::traits::unrefcv_t<Args>...></span>
|
||||
</dt>
|
||||
<dd>Can be used to recover to from a failure handler, the result handler which comes after will be called with the corresponding result.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___base.html#ga9223cf1a04ca2d6950d83d0917192fa5" class="m-dox">rethrow</a>(</span><span class="m-dox-wrap"><a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> exception) -> <a href="classcti_1_1exceptional__result.html" class="m-dox">exceptional_<wbr />result</a></span>
|
||||
</dt>
|
||||
<dd>Can be used to rethrow an exception to the asynchronous continuation chain, the failure handler which comes after will be called with the corresponding exception.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___base.html#ga3c1710e55aab586d267f96a02f6cd014" class="m-dox">cancel</a>(</span><span class="m-dox-wrap">) -> <a href="structcti_1_1cancellation__result.html" class="m-dox">cancellation_<wbr />result</a></span>
|
||||
</dt>
|
||||
<dd>Can be used to cancel an asynchronous continuation chain, the next failure handler which comes after cancel will be called with a default constructed exception_t object.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___base.html#gac20d32604949856659f84c06ebcaeb9e" class="m-dox">stop</a>(</span><span class="m-dox-wrap">) -> <a href="structcti_1_1empty__result.html" class="m-dox">empty_<wbr />result</a></span>
|
||||
</dt>
|
||||
<dd>Can be used to stop an asynchronous continuation chain, no handler which comes after stop was received won't be called.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___connections.html#gaef652b8561f76cad49e83cfa21a71734" class="m-dox">when_all</a>(</span><span class="m-dox-wrap">Args && ... args) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with an all logic. All continuables contained inside the given nested pack are invoked at once. On completion the final handler is called with the aggregated result of all continuables.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Iterator, std::enable_if_t<detail::range::is_iterator<Iterator>::value>* = nullptr></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___connections.html#gaa39f871e8aa99953dc83fda92b449024" class="m-dox">when_all</a>(</span><span class="m-dox-wrap">Iterator begin,
|
||||
Iterator end) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with an all logic. The content of the iterator is moved out and converted to a temporary <code>std::vector</code> which is then passed to when_all.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___connections.html#ga481c31024079b6074617c64b16e615dd" class="m-dox">when_seq</a>(</span><span class="m-dox-wrap">Args && ... args) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with a sequential logic. All continuables contained inside the given nested pack are invoked one after one. On completion the final handler is called with the aggregated result of all continuables.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Iterator, std::enable_if_t<detail::range::is_iterator<Iterator>::value>* = nullptr></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___connections.html#ga1d52caeca48122b5aebb276d0d47805a" class="m-dox">when_seq</a>(</span><span class="m-dox-wrap">Iterator begin,
|
||||
Iterator end) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with a sequential logic. The content of the iterator is moved out and converted to a temporary <code>std::vector</code> which is then passed to when_seq.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___connections.html#ga313760e876d0cbc766b41f6b192544bb" class="m-dox">when_any</a>(</span><span class="m-dox-wrap">Args && ... args) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with an any logic. All continuables contained inside the given nested pack are invoked at once. On completion of one continuable the final handler is called with the result of the resolved continuable.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Iterator, std::enable_if_t<detail::range::is_iterator<Iterator>::value>* = nullptr></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___connections.html#ga580b6b0d4fd31371b2f37e0dc5bf039b" class="m-dox">when_any</a>(</span><span class="m-dox-wrap">Iterator begin,
|
||||
Iterator end) -> auto</span>
|
||||
</dt>
|
||||
<dd>Connects the given arguments with an any logic. The content of the iterator is moved out and converted to a temporary <code>std::vector</code> which is then passed to when_all.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<template<typename, typename> class C = std::vector, typename First, typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___connections.html#ga4f6ecedf4b4ccd5e1c28d937ad717b32" class="m-dox">populate</a>(</span><span class="m-dox-wrap">First&& first,
|
||||
Args && ... args) -> C<std::decay_t<First>, std::allocator<std::decay_t<First>>></span>
|
||||
</dt>
|
||||
<dd>Populates a homogeneous container from the given arguments. All arguments need to be convertible to the first one, by default <code>std::vector</code> is used as container type.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<std::size_t I, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___result.html#ga8c47cc24b02abb222a8bd7739ec3920e" class="m-dox">get</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1result.html" class="m-dox">result</a><T...>& result) -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the value at position I of the given result.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<std::size_t I, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___result.html#ga6d638c96597a30798bf74eb5a7968730" class="m-dox">get</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1result.html" class="m-dox">result</a><T...> const& result) -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the value at position I of the given result.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<std::size_t I, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___result.html#ga61a97fe8e93c19e42f97396c6262281b" class="m-dox">get</a>(</span><span class="m-dox-wrap"><a href="classcti_1_1result.html" class="m-dox">result</a><T...>&& result) -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Returns the value at position I of the given result.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... T, typename Result = result<detail::traits::unrefcv_t<T>...>></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___result.html#ga2852fa60e4e34409e35a9f6e8ff5c816" class="m-dox">make_result</a>(</span><span class="m-dox-wrap">T && ... values) -> Result</span>
|
||||
</dt>
|
||||
<dd>Creates a present result from the given values.</dd>
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___result.html#gae70b4f9c3ca8e28e559363a4bb9fee00" class="m-dox">make_result</a>(</span><span class="m-dox-wrap"><a href="structcti_1_1exception__arg__t.html" class="m-dox">exception_<wbr />arg_<wbr />t</a>,
|
||||
<a href="group___primitives.html#ga9fa0d3597f70a7b9e763639f0b30dee1" class="m-dox">exception_<wbr />t</a> exception) -> <a href="classcti_1_1exceptional__result.html" class="m-dox">exceptional_<wbr />result</a></span>
|
||||
</dt>
|
||||
<dd>Creates an <a href="classcti_1_1exceptional__result.html" class="m-dox">exceptional_<wbr />result</a> from the given exception.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Visitor, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___traversal.html#ga02922d0c5bf7a18340069b3500a0cf90" class="m-dox">traverse_pack_async</a>(</span><span class="m-dox-wrap">Visitor&& visitor,
|
||||
T && ... pack) -> auto</span>
|
||||
</dt>
|
||||
<dd>Traverses the pack with the given visitor in an asynchronous way.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Mapper, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___traversal.html#gace27f8127eb5eba0f4ab753daacf6a57" class="m-dox">map_pack</a>(</span><span class="m-dox-wrap">Mapper&& mapper,
|
||||
T && ... pack) -> decltype(auto)</span>
|
||||
</dt>
|
||||
<dd>Maps the pack with the given mapper.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="group___traversal.html#ga7c14358f4d11803b50ab9687dfcb11c5" class="m-dox">spread_this</a>(</span><span class="m-dox-wrap">T && ... args) -> detail::traversal::spreading::spread_box<std::decay_t<T>...> <span class="m-label m-flat m-primary">constexpr</span> <span class="m-label m-flat m-success">noexcept(…)</span></span>
|
||||
</dt>
|
||||
<dd>Indicate that the result shall be spread across the parent container if possible. This can be used to create a mapper function used in map_pack that maps one element to an arbitrary count (1:n).</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Mapper, typename... T></div>
|
||||
<span class="m-dox-wrap-bumper">void <a href="group___traversal.html#gab497ec8ef4cf8532703fcb9852846a2e" class="m-dox">traverse_pack</a>(</span><span class="m-dox-wrap">Mapper&& mapper,
|
||||
T && ... pack)</span>
|
||||
</dt>
|
||||
<dd>Traverses the pack with the given visitor.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename... Args></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#ac13f891e5cf5d6f668ff92bf07c765a6" class="m-dox">use_continuable_ignoring</a>(</span><span class="m-dox-wrap">Args && ... args) -> auto <span class="m-label m-flat m-success">noexcept</span></span>
|
||||
</dt>
|
||||
<dd>Represents a special asio completion token which treats the given asio basic error codes as success instead of failure.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section id="var-members">
|
||||
<h2><a href="#var-members">Variables</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<a href="structcti_1_1use__continuable__t.html" class="m-dox">use_<wbr />continuable_<wbr />t</a> <a href="#a0e7f3cb9a77364e61bb38b13007ee10f" class="m-dox">use_continuable</a> <span class="m-label m-flat m-primary">constexpr</span>
|
||||
</dt>
|
||||
<dd>Special value for instance of <a href="structcti_1_1use__continuable__t.html" class="m-dox">use_<wbr />continuable_<wbr />t</a> which performs remapping of asio error codes to align the cancellation behaviour with the library.</dd>
|
||||
<dt>
|
||||
<a href="namespacecti.html#a4d0da7830d56f4e638a2dc23d1bc27db" class="m-dox">use_<wbr />continuable_<wbr />raw_<wbr />t</a> <a href="#a955b9fd72a56b34657664e490f995481" class="m-dox">use_continuable_raw</a> <span class="m-label m-flat m-primary">constexpr</span>
|
||||
</dt>
|
||||
<dd>Special value for instance of use_continuable_raw_t which doesn't perform remapping of asio error codes and rethrows the raw error code.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Typedef documentation</h2>
|
||||
<section class="m-dox-details" id="a637f3ade8400faa575b4a6ef584f4431"><div>
|
||||
<h3>
|
||||
using cti::<wbr /><a href="#a637f3ade8400faa575b4a6ef584f4431" class="m-dox-self">asio_error_code_t</a> = detail::asio::error_code_t
|
||||
</h3>
|
||||
<p>The error code type used by your asio distribution.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.1.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a33044c007ff02f6324954167003f5c36"><div>
|
||||
<h3>
|
||||
using cti::<wbr /><a href="#a33044c007ff02f6324954167003f5c36" class="m-dox-self">asio_basic_errors_t</a> = detail::asio::basic_errors_t
|
||||
</h3>
|
||||
<p>The basic error code enum used by your asio distribution.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.1.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a8681a592a8360d66100a7e72e555bf4f"><div>
|
||||
<h3>
|
||||
using cti::<wbr /><a href="#a8681a592a8360d66100a7e72e555bf4f" class="m-dox-self">asio_system_error_t</a> = detail::asio::system_error_t
|
||||
</h3>
|
||||
<p>The system error type used by your asio distribution.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.1.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a4d0da7830d56f4e638a2dc23d1bc27db"><div>
|
||||
<h3>
|
||||
using cti::<wbr /><a href="#a4d0da7830d56f4e638a2dc23d1bc27db" class="m-dox-self">use_continuable_raw_t</a> = <a href="structcti_1_1use__continuable__t.html" class="m-dox">use_<wbr />continuable_<wbr />t</a><detail::asio::map_none>
|
||||
</h3>
|
||||
<p>Type used as an ASIO completion token to specify an asynchronous operation that should return a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p>
|
||||
<ul><li>Boost 1.70 or asio 1.13.0 is required for the async initiation</li><li>Until boost 1.72 or asio 1.16.0 overhead through an additional type erasure is added. It is recommended to update to those versions.</li></ul><p>The special static variable use_continuable can be appended to any (boost) asio function that accepts a callback to make it return a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p><pre class="m-code"><span class="cp">#include</span> <span class="cpf"><continuable/continuable.hpp></span><span class="cp"></span>
|
||||
<span class="cp">#include</span> <span class="cpf"><continuable/external/asio.hpp></span><span class="cp"></span>
|
||||
<span class="cp">#include</span> <span class="cpf"><asio.hpp></span><span class="cp"></span>
|
||||
|
||||
<span class="c1">// ...</span>
|
||||
|
||||
<span class="n">asio</span><span class="o">::</span><span class="n">tcp</span><span class="o">::</span><span class="n">resolver</span> <span class="n">resolver</span><span class="p">(...);</span>
|
||||
<span class="n">resolver</span><span class="p">.</span><span class="n">async_resolve</span><span class="p">(</span><span class="s">"127.0.0.1"</span><span class="p">,</span> <span class="s">"daytime"</span><span class="p">,</span> <span class="n">cti</span><span class="o">::</span><span class="n">use_continuable</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">asio</span><span class="o">::</span><span class="n">udp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span> <span class="n">iterator</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-warning"><h4>Attention</h4><p><code>asio::error::basic_errors::operation_aborted</code> errors returned by asio are automatically transformed into a default constructed exception type which represents "operation canceled" by the user or program. If you intend to retrieve the full asio::error_code without remapping use the use_continuable_raw_t completion token instead!</p></aside><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside><p>The raw async completion handler token does not remap the asio error <code>asio::error::basic_errors::operation_aborted</code> to a default constructed exception type.</p><aside class="m-note m-default"><h4>Since</h4><p>4.1.0</p></aside>
|
||||
</div></section>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Function documentation</h2>
|
||||
<section class="m-dox-details" id="ac13f891e5cf5d6f668ff92bf07c765a6"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename... Args>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#ac13f891e5cf5d6f668ff92bf07c765a6" class="m-dox-self">use_continuable_ignoring</a>(</span><span class="m-dox-wrap">Args && ... args) <span class="m-label m-success">noexcept</span></span></span>
|
||||
</h3>
|
||||
<p>Represents a special asio completion token which treats the given asio basic error codes as success instead of failure.</p>
|
||||
<p><code>asio::error::basic_errors::operation_aborted</code> is mapped as cancellation token.</p><aside class="m-note m-default"><h4>Since</h4><p>4.1.0</p></aside>
|
||||
</div></section>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Variable documentation</h2>
|
||||
<section class="m-dox-details" id="a0e7f3cb9a77364e61bb38b13007ee10f"><div>
|
||||
<h3>
|
||||
<a href="structcti_1_1use__continuable__t.html" class="m-dox">use_<wbr />continuable_<wbr />t</a> cti::<wbr /><a href="#a0e7f3cb9a77364e61bb38b13007ee10f" class="m-dox-self">use_continuable</a> <span class="m-label m-primary">constexpr</span>
|
||||
</h3>
|
||||
<p>Special value for instance of <a href="structcti_1_1use__continuable__t.html" class="m-dox">use_<wbr />continuable_<wbr />t</a> which performs remapping of asio error codes to align the cancellation behaviour with the library.</p>
|
||||
<ul><li>Boost 1.70 or asio 1.13.0 is required for the async initiation</li><li>Until boost 1.72 or asio 1.16.0 overhead through an additional type erasure is added. It is recommended to update to those versions.</li></ul><p>The special static variable use_continuable can be appended to any (boost) asio function that accepts a callback to make it return a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p><pre class="m-code"><span class="cp">#include</span> <span class="cpf"><continuable/continuable.hpp></span><span class="cp"></span>
|
||||
<span class="cp">#include</span> <span class="cpf"><continuable/external/asio.hpp></span><span class="cp"></span>
|
||||
<span class="cp">#include</span> <span class="cpf"><asio.hpp></span><span class="cp"></span>
|
||||
|
||||
<span class="c1">// ...</span>
|
||||
|
||||
<span class="n">asio</span><span class="o">::</span><span class="n">tcp</span><span class="o">::</span><span class="n">resolver</span> <span class="n">resolver</span><span class="p">(...);</span>
|
||||
<span class="n">resolver</span><span class="p">.</span><span class="n">async_resolve</span><span class="p">(</span><span class="s">"127.0.0.1"</span><span class="p">,</span> <span class="s">"daytime"</span><span class="p">,</span> <span class="n">cti</span><span class="o">::</span><span class="n">use_continuable</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">asio</span><span class="o">::</span><span class="n">udp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span> <span class="n">iterator</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-warning"><h4>Attention</h4><p><code>asio::error::basic_errors::operation_aborted</code> errors returned by asio are automatically transformed into a default constructed exception type which represents "operation canceled" by the user or program. If you intend to retrieve the full asio::error_code without remapping use the use_continuable_raw_t completion token instead!</p></aside><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a955b9fd72a56b34657664e490f995481"><div>
|
||||
<h3>
|
||||
<a href="namespacecti.html#a4d0da7830d56f4e638a2dc23d1bc27db" class="m-dox">use_<wbr />continuable_<wbr />raw_<wbr />t</a> cti::<wbr /><a href="#a955b9fd72a56b34657664e490f995481" class="m-dox-self">use_continuable_raw</a> <span class="m-label m-primary">constexpr</span>
|
||||
</h3>
|
||||
<p>Special value for instance of use_continuable_raw_t which doesn't perform remapping of asio error codes and rethrows the raw error code.</p>
|
||||
<ul><li>Boost 1.70 or asio 1.13.0 is required for the async initiation</li><li>Until boost 1.72 or asio 1.16.0 overhead through an additional type erasure is added. It is recommended to update to those versions.</li></ul><p>The special static variable use_continuable can be appended to any (boost) asio function that accepts a callback to make it return a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p><pre class="m-code"><span class="cp">#include</span> <span class="cpf"><continuable/continuable.hpp></span><span class="cp"></span>
|
||||
<span class="cp">#include</span> <span class="cpf"><continuable/external/asio.hpp></span><span class="cp"></span>
|
||||
<span class="cp">#include</span> <span class="cpf"><asio.hpp></span><span class="cp"></span>
|
||||
|
||||
<span class="c1">// ...</span>
|
||||
|
||||
<span class="n">asio</span><span class="o">::</span><span class="n">tcp</span><span class="o">::</span><span class="n">resolver</span> <span class="n">resolver</span><span class="p">(...);</span>
|
||||
<span class="n">resolver</span><span class="p">.</span><span class="n">async_resolve</span><span class="p">(</span><span class="s">"127.0.0.1"</span><span class="p">,</span> <span class="s">"daytime"</span><span class="p">,</span> <span class="n">cti</span><span class="o">::</span><span class="n">use_continuable</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">asio</span><span class="o">::</span><span class="n">udp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span> <span class="n">iterator</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-warning"><h4>Attention</h4><p><code>asio::error::basic_errors::operation_aborted</code> errors returned by asio are automatically transformed into a default constructed exception type which represents "operation canceled" by the user or program. If you intend to retrieve the full asio::error_code without remapping use the use_continuable_raw_t completion token instead!</p></aside><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside><p>The raw async completion handler token does not remap the asio error <code>asio::error::basic_errors::operation_aborted</code> to a default constructed exception type.</p><aside class="m-note m-default"><h4>Since</h4><p>4.1.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>
|
||||
286
namespacecti_1_1transforms.html
Normal file
286
namespacecti_1_1transforms.html
Normal file
@ -0,0 +1,286 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::transforms namespace | 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" id="m-navbar-current">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>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>transforms <span class="m-thin">namespace</span>
|
||||
</h1>
|
||||
<p>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.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Reference
|
||||
<ul>
|
||||
<li><a href="#func-members">Functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>Transforms can be applied to continuables through using the <a href="classcti_1_1continuable__base.html#abcf4cf105aa17826bcc3c2278f6ea1b5" class="m-dox">cti::<wbr />continuable_base::<wbr />apply</a> method accordingly.</p>
|
||||
<section id="func-members">
|
||||
<h2><a href="#func-members">Functions</a></h2>
|
||||
<dl class="m-dox">
|
||||
<dt>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a4b98e7d3680486c926b64cd07a6adadb" class="m-dox">to_future</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="#a087d7b1c359b9f7d4a89d201d8493416" class="m-dox">wait</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 result synchronously. The current thread is blocked until the continuation chain is finished.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Rep, typename Period></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#a46d91cdd1e5153ca4a7f42fda616dd34" class="m-dox">wait_for</a>(</span><span class="m-dox-wrap">std::chrono::duration<Rep, Period> duration) -> auto</span>
|
||||
</dt>
|
||||
<dd>Returns a transform that if applied to a continuable, it will start the continuation chain and returns the result synchronously. The current thread is blocked until the continuation chain is finished.</dd>
|
||||
<dt>
|
||||
<div class="m-dox-template">template<typename Clock, typename Duration></div>
|
||||
<span class="m-dox-wrap-bumper">auto <a href="#aad924bf66494a6bb199192d7af2b8aea" class="m-dox">wait_until</a>(</span><span class="m-dox-wrap">std::chrono::time_point<Clock, Duration> time_point) -> auto</span>
|
||||
</dt>
|
||||
<dd>Returns a transform that if applied to a continuable, it will start the continuation chain and returns the result synchronously. The current thread is blocked until the continuation chain is finished.</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Function documentation</h2>
|
||||
<section class="m-dox-details" id="a4b98e7d3680486c926b64cd07a6adadb"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />transforms::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a4b98e7d3680486c926b64cd07a6adadb" class="m-dox-self">to_future</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="a087d7b1c359b9f7d4a89d201d8493416"><div>
|
||||
<h3>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />transforms::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a087d7b1c359b9f7d4a89d201d8493416" class="m-dox-self">wait</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 result synchronously. The current thread is blocked until the continuation chain is finished.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 1%">Returns</th>
|
||||
<td><p>Returns a value that is available immediately. 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>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>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::tuple<Args...></code></td></tr></tbody></table></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead>
|
||||
<tr><th colspan="2">Exceptions</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>wait_transform_canceled_exception</td>
|
||||
<td>if the awaited <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is cancelled, and thus was resolved with a default constructed exception type.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<aside class="m-note m-warning"><h4>Attention</h4><p>If exceptions are used, exceptions that are thrown, are rethrown synchronously.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="a46d91cdd1e5153ca4a7f42fda616dd34"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Rep, typename Period>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />transforms::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a46d91cdd1e5153ca4a7f42fda616dd34" class="m-dox-self">wait_for</a>(</span><span class="m-dox-wrap">std::chrono::duration<Rep, Period> duration)</span></span>
|
||||
</h3>
|
||||
<p>Returns a transform that if applied to a continuable, it will start the continuation chain and returns the result synchronously. The current thread is blocked until the continuation chain is finished.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="width: 1%">Returns</th>
|
||||
<td><p>Returns a result that is available immediately. 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>result<></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>result<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>result<Args...></code></td></tr></tbody></table></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-warning"><h4>Attention</h4><p>Thrown exceptions returned through the result, also make sure to check for a valid result value in case the underlying time constraint timed out.</p></aside><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</div></section>
|
||||
<section class="m-dox-details" id="aad924bf66494a6bb199192d7af2b8aea"><div>
|
||||
<h3>
|
||||
<div class="m-dox-template">
|
||||
template<typename Clock, typename Duration>
|
||||
</div>
|
||||
<span class="m-dox-wrap-bumper">auto cti::<wbr />transforms::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#aad924bf66494a6bb199192d7af2b8aea" class="m-dox-self">wait_until</a>(</span><span class="m-dox-wrap">std::chrono::time_point<Clock, Duration> time_point)</span></span>
|
||||
</h3>
|
||||
<p>Returns a transform that if applied to a continuable, it will start the continuation chain and returns the result synchronously. The current thread is blocked until the continuation chain is finished.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th style="width: 1%">Returns</th>
|
||||
<td><p>Returns a result that is available immediately. 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>result<></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>result<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>result<Args...></code></td></tr></tbody></table></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<aside class="m-note m-warning"><h4>Attention</h4><p>Thrown exceptions returned through the result, also make sure to check for a valid result value in case the underlying time constraint timed out.</p></aside><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>
|
||||
194
namespaces.html
Normal file
194
namespaces.html
Normal file
@ -0,0 +1,194 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>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>Namespaces</h2>
|
||||
<ul class="m-dox">
|
||||
<li class="m-dox-collapsible">
|
||||
<a href="#" onclick="return toggle(this)">namespace</a> <a href="namespacecti.html" class="m-dox">cti</a> <span class="m-dox">Declares the continuable library namespace.</span>
|
||||
<ul class="m-dox">
|
||||
<li>namespace <a href="namespacecti_1_1transforms.html" class="m-dox">transforms</a> <span class="m-dox">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.</span></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<script>
|
||||
function toggle(e) {
|
||||
e.parentElement.className = e.parentElement.className == 'm-dox-collapsible' ?
|
||||
'm-dox-expansible' : 'm-dox-collapsible';
|
||||
return false;
|
||||
}
|
||||
/* Collapse all nodes marked as such. Doing it via JS instead of directly in
|
||||
markup so disabling it doesn't harm usability. The list is somehow
|
||||
regenerated on every iteration and shrinks as I change the classes. It's not
|
||||
documented anywhere and I'm not sure if this is the same across browsers, so
|
||||
I am going backwards in that list to be sure. */
|
||||
var collapsed = document.getElementsByClassName("collapsed");
|
||||
for(var i = collapsed.length - 1; i >= 0; --i)
|
||||
collapsed[i].className = 'm-dox-expansible';
|
||||
</script>
|
||||
</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>
|
||||
203
pages.html
Normal file
203
pages.html
Normal file
@ -0,0 +1,203 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>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" id="m-navbar-current">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>Pages</h2>
|
||||
<ul class="m-dox">
|
||||
<li><a href="changelog.html" class="m-dox">Changelog</a> <span class="m-dox">A description of the changes made to continuable.</span></li>
|
||||
<li><a href="configuration.html" class="m-dox">Configuration</a> <span class="m-dox">Covers optional preprocessor macros that change the libraries behaviour.</span></li>
|
||||
<li><a href="installation.html" class="m-dox">Installation</a> <span class="m-dox">An explanation on how to install continuable on various platforms.</span></li>
|
||||
<li class="m-dox-collapsible">
|
||||
<a href="#" onclick="return toggle(this)"></a><a href="tutorial.html" class="m-dox">Tutorial</a> <span class="m-dox">An introduction for using the continuable library.</span>
|
||||
<ul class="m-dox">
|
||||
<li><a href="tutorial-creating-continuables.html" class="m-dox">Creating continuables</a> <span class="m-dox">Explains how to create a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</span></li>
|
||||
<li><a href="tutorial-chaining-continuables.html" class="m-dox">Chaining continuables</a> <span class="m-dox">Explains how to chain multiple <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects together.</span></li>
|
||||
<li><a href="tutorial-connecting-continuables.html" class="m-dox">Connecting continuables</a> <span class="m-dox">Explains how to connect various <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects together.</span></li>
|
||||
<li><a href="tutorial-transforming-continuables.html" class="m-dox">Transforming continuables</a> <span class="m-dox">Explains the conversion into other types such as <code>std::future</code>.</span></li>
|
||||
<li><a href="tutorial-awaiting-continuables.html" class="m-dox">Awaiting continuables</a> <span class="m-dox">Explains how to use the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> together with <code>co_await</code>.</span></li>
|
||||
<li><a href="tutorial-promisify-continuables.html" class="m-dox">Promisify functions</a> <span class="m-dox">Explains how to promisify callback taking functions into a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</span></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="deprecated.html" class="m-dox">Deprecated List</a> <span class="m-dox"></span></li>
|
||||
</ul>
|
||||
<script>
|
||||
function toggle(e) {
|
||||
e.parentElement.className = e.parentElement.className == 'm-dox-collapsible' ?
|
||||
'm-dox-expansible' : 'm-dox-collapsible';
|
||||
return false;
|
||||
}
|
||||
/* Collapse all nodes marked as such. Doing it via JS instead of directly in
|
||||
markup so disabling it doesn't harm usability. The list is somehow
|
||||
regenerated on every iteration and shrinks as I change the classes. It's not
|
||||
documented anywhere and I'm not sure if this is the same across browsers, so
|
||||
I am going backwards in that list to be sure. */
|
||||
var collapsed = document.getElementsByClassName("collapsed");
|
||||
for(var i = collapsed.length - 1; i >= 0; --i)
|
||||
collapsed[i].className = 'm-dox-expansible';
|
||||
</script>
|
||||
</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>
|
||||
786
search.js
Normal file
786
search.js
Normal file
@ -0,0 +1,786 @@
|
||||
/*
|
||||
This file is part of m.css.
|
||||
|
||||
Copyright © 2017, 2018, 2019 Vladimír Vondruš <mosra@centrum.cz>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
"use strict"; /* it summons the Cthulhu in a proper way, they say */
|
||||
|
||||
var Search = {
|
||||
trie: null,
|
||||
map: null,
|
||||
dataSize: 0,
|
||||
symbolCount: 0,
|
||||
maxResults: 0,
|
||||
|
||||
/* Always contains at least the root node offset and then one node offset
|
||||
per entered character */
|
||||
searchString: '',
|
||||
searchStack: [],
|
||||
|
||||
/* So items don't get selected right away when a cursor is over results but
|
||||
only after mouse moves */
|
||||
mouseMovedSinceLastRender: false,
|
||||
|
||||
/* Whether we can go back in history in order to hide the search box or
|
||||
not. We can't do that if we arrived directly on #search from outside. */
|
||||
canGoBackToHideSearch: false,
|
||||
|
||||
/* Autocompletion in the input field is whitelisted only for character
|
||||
input (so not deletion, cut, or anything else). This is flipped in the
|
||||
onkeypress event and reset after each oninput event. */
|
||||
autocompleteNextInputEvent: false,
|
||||
|
||||
init: function(buffer, maxResults) {
|
||||
let view = new DataView(buffer);
|
||||
|
||||
/* The file is too short to contain at least the headers */
|
||||
if(view.byteLength < 20) {
|
||||
console.error("Search data too short");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(view.getUint8(0) != 'M'.charCodeAt(0) ||
|
||||
view.getUint8(1) != 'C'.charCodeAt(0) ||
|
||||
view.getUint8(2) != 'S'.charCodeAt(0)) {
|
||||
console.error("Invalid search data signature");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(view.getUint8(3) != 0) {
|
||||
console.error("Invalid search data version");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Separate the data into the trie and the result map */
|
||||
let mapOffset = view.getUint32(6, true);
|
||||
this.trie = new DataView(buffer, 10, mapOffset - 10);
|
||||
this.map = new DataView(buffer, mapOffset);
|
||||
|
||||
/* Set initial properties */
|
||||
this.dataSize = buffer.byteLength;
|
||||
this.symbolCount = view.getUint16(4, true);
|
||||
this.maxResults = maxResults ? maxResults : 100;
|
||||
this.searchString = '';
|
||||
this.searchStack = [this.trie.getUint32(0, true)];
|
||||
|
||||
/* istanbul ignore if */
|
||||
if(typeof document !== 'undefined') {
|
||||
document.getElementById('search-symbolcount').innerHTML =
|
||||
this.symbolCount + " symbols (" + Math.round(this.dataSize/102.4)/10 + " kB)";
|
||||
document.getElementById('search-input').disabled = false;
|
||||
document.getElementById('search-input').placeholder = "Type something here …";
|
||||
document.getElementById('search-input').focus();
|
||||
|
||||
/* Search for the input value (there might be something already,
|
||||
for example when going back in the browser) */
|
||||
let value = document.getElementById('search-input').value;
|
||||
|
||||
/* Otherwise check the GET parameters for `q` and fill the input
|
||||
with that */
|
||||
if(!value.length) {
|
||||
var args = decodeURIComponent(window.location.search.substr(1)).trim().split('&');
|
||||
for(var i = 0; i != args.length; ++i) {
|
||||
if(args[i].substring(0, 2) != 'q=') continue;
|
||||
|
||||
value = document.getElementById('search-input').value = args[i].substring(2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(value.length) Search.searchAndRender(value);
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
download: /* istanbul ignore next */ function(url) {
|
||||
var req = window.XDomainRequest ? new XDomainRequest() : new XMLHttpRequest();
|
||||
if(!req) return;
|
||||
|
||||
req.open("GET", url, true);
|
||||
req.responseType = 'arraybuffer';
|
||||
req.onreadystatechange = function() {
|
||||
if(req.readyState != 4) return;
|
||||
|
||||
Search.init(req.response);
|
||||
}
|
||||
req.send();
|
||||
},
|
||||
|
||||
base85decode: function(base85string) {
|
||||
function charValue(char) {
|
||||
if(char >= 48 && char < 58) /* 0-9 -> 0-9 */
|
||||
return char - 48 + 0;
|
||||
if(char >= 65 && char < 91) /* A-Z -> 10-35 */
|
||||
return char - 65 + 10;
|
||||
if(char >= 97 && char < 123) /* a-z -> 36-61 */
|
||||
return char - 97 + 36;
|
||||
if(char == 33) /* ! -> 62 */
|
||||
return 62;
|
||||
/* skipping 34 (') */
|
||||
if(char >= 35 && char < 39) /* #-& -> 63-66 */
|
||||
return char - 35 + 63;
|
||||
/* skipping 39 (") */
|
||||
if(char >= 40 && char < 44) /* (-+ -> 67-70 */
|
||||
return char - 40 + 67;
|
||||
/* skipping 44 (,) */
|
||||
if(char == 45) /* - -> 71 */
|
||||
return 71;
|
||||
if(char >= 59 && char < 65) /* ;-@ -> 72-77 */
|
||||
return char - 59 + 72;
|
||||
if(char >= 94 && char < 97) /* ^-` -> 78-80 */
|
||||
return char - 94 + 78;
|
||||
if(char >= 123 && char < 127) /* {-~ -> 81-84 */
|
||||
return char - 123 + 81;
|
||||
|
||||
return 0; /* Interpret padding values as zeros */
|
||||
}
|
||||
|
||||
/* Pad the string for easier decode later. We don't read past the file
|
||||
end, so it doesn't matter what garbage is there. */
|
||||
if(base85string.length % 5) {
|
||||
console.log("Expected properly padded base85 data");
|
||||
return;
|
||||
}
|
||||
|
||||
let buffer = new ArrayBuffer(base85string.length*4/5);
|
||||
let data8 = new DataView(buffer);
|
||||
for(let i = 0; i < base85string.length; i += 5) {
|
||||
let char1 = charValue(base85string.charCodeAt(i + 0));
|
||||
let char2 = charValue(base85string.charCodeAt(i + 1));
|
||||
let char3 = charValue(base85string.charCodeAt(i + 2));
|
||||
let char4 = charValue(base85string.charCodeAt(i + 3));
|
||||
let char5 = charValue(base85string.charCodeAt(i + 4));
|
||||
|
||||
data8.setUint32(i*4/5, char5 +
|
||||
char4*85 +
|
||||
char3*85*85 +
|
||||
char2*85*85*85 +
|
||||
char1*85*85*85*85, false); /* BE, yes */
|
||||
}
|
||||
|
||||
return buffer;
|
||||
},
|
||||
|
||||
load: function(base85string) {
|
||||
return this.init(this.base85decode(base85string));
|
||||
},
|
||||
|
||||
/* http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html */
|
||||
toUtf8: function(string) { return unescape(encodeURIComponent(string)); },
|
||||
fromUtf8: function(string) { return decodeURIComponent(escape(string)); },
|
||||
|
||||
autocompletedCharsToString: function(chars) {
|
||||
/* Strip incomplete UTF-8 chars from the autocompletion end */
|
||||
for(let i = chars.length - 1; i >= 0; --i) {
|
||||
let c = chars[i];
|
||||
|
||||
/* We're safe, finish */
|
||||
if(
|
||||
/* ASCII value at the end */
|
||||
(c < 128 && i + 1 == chars.length) ||
|
||||
|
||||
/* Full two-byte character at the end */
|
||||
((c & 0xe0) == 0xc0 && i + 2 == chars.length) ||
|
||||
|
||||
/* Full three-byte character at the end */
|
||||
((c & 0xf0) == 0xe0 && i + 3 == chars.length) ||
|
||||
|
||||
/* Full four-byte character at the end */
|
||||
((c & 0xf8) == 0xf0 && i + 4 == chars.length)
|
||||
) break;
|
||||
|
||||
/* Continuing UTF-8 character, go further back */
|
||||
if((c & 0xc0) == 0x80) continue;
|
||||
|
||||
/* Otherwise the character is not complete, drop it from the end */
|
||||
chars.length = i;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Convert the autocompleted UTF-8 sequence to a string */
|
||||
let suggestedTabAutocompletionString = '';
|
||||
for(let i = 0; i != chars.length; ++i)
|
||||
suggestedTabAutocompletionString += String.fromCharCode(chars[i]);
|
||||
return this.fromUtf8(suggestedTabAutocompletionString);
|
||||
},
|
||||
|
||||
/* Returns the values in UTF-8, but input is in whatever shitty 16bit
|
||||
encoding JS has */
|
||||
search: function(searchString) {
|
||||
/* Normalize the search string first, convert to UTF-8 */
|
||||
searchString = this.toUtf8(searchString.toLowerCase().trim());
|
||||
|
||||
/* TODO: maybe i could make use of InputEvent.data and others here */
|
||||
|
||||
/* Find longest common prefix of previous and current value so we don't
|
||||
need to needlessly search again */
|
||||
let max = Math.min(searchString.length, this.searchString.length);
|
||||
let commonPrefix = 0;
|
||||
for(; commonPrefix != max; ++commonPrefix)
|
||||
if(searchString[commonPrefix] != this.searchString[commonPrefix]) break;
|
||||
|
||||
/* Drop items off the stack if it has has more than is needed for the
|
||||
common prefix (it needs to have at least one item, though) */
|
||||
if(commonPrefix + 1 < this.searchStack.length)
|
||||
this.searchStack.splice(commonPrefix + 1, this.searchStack.length - commonPrefix - 1);
|
||||
|
||||
/* Add new characters from the search string */
|
||||
let foundPrefix = commonPrefix;
|
||||
for(; foundPrefix != searchString.length; ++foundPrefix) {
|
||||
/* Calculate offset and count of children */
|
||||
let offset = this.searchStack[this.searchStack.length - 1];
|
||||
let relChildOffset = 2 + this.trie.getUint8(offset)*2;
|
||||
let childCount = this.trie.getUint8(offset + 1);
|
||||
|
||||
/* Go through all children and find the next offset */
|
||||
let childOffset = offset + relChildOffset;
|
||||
let found = false;
|
||||
for(let j = 0; j != childCount; ++j) {
|
||||
if(String.fromCharCode(this.trie.getUint8(childOffset + j*4 + 3)) != searchString[foundPrefix])
|
||||
continue;
|
||||
|
||||
this.searchStack.push(this.trie.getUint32(childOffset + j*4, true) & 0x007fffff);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Character not found, exit */
|
||||
if(!found) break;
|
||||
}
|
||||
|
||||
/* Save the whole found prefix for next time */
|
||||
this.searchString = searchString.substr(0, foundPrefix);
|
||||
|
||||
/* If the whole thing was not found, return an empty result and offer
|
||||
external search */
|
||||
if(foundPrefix != searchString.length) {
|
||||
/* istanbul ignore if */
|
||||
if(typeof document !== 'undefined') {
|
||||
let link = document.getElementById('search-external');
|
||||
if(link)
|
||||
link.href = link.dataset.searchEngine.replace('{query}', encodeURIComponent(searchString));
|
||||
}
|
||||
return [[], ''];
|
||||
}
|
||||
|
||||
/* Otherwise gather the results */
|
||||
let suggestedTabAutocompletionChars = [];
|
||||
let results = [];
|
||||
let leaves = [[this.searchStack[this.searchStack.length - 1], 0]];
|
||||
while(leaves.length) {
|
||||
/* Pop offset from the queue */
|
||||
let current = leaves.shift();
|
||||
let offset = current[0];
|
||||
let suffixLength = current[1];
|
||||
|
||||
/* Populate the results with all values associated with this node */
|
||||
let resultCount = this.trie.getUint8(offset);
|
||||
for(let i = 0; i != resultCount; ++i) {
|
||||
let index = this.trie.getUint16(offset + (i + 1)*2, true);
|
||||
results.push(this.gatherResult(index, suffixLength, 0xffffff)); /* should be enough haha */
|
||||
|
||||
/* 'nuff said. */
|
||||
if(results.length >= this.maxResults)
|
||||
return [results, this.autocompletedCharsToString(suggestedTabAutocompletionChars)];
|
||||
}
|
||||
|
||||
/* Dig deeper */
|
||||
/* TODO: hmmm. this is helluvalot duplicated code. hmm. */
|
||||
let relChildOffset = 2 + this.trie.getUint8(offset)*2;
|
||||
let childCount = this.trie.getUint8(offset + 1);
|
||||
let childOffset = offset + relChildOffset;
|
||||
for(let j = 0; j != childCount; ++j) {
|
||||
let offsetBarrier = this.trie.getUint32(childOffset + j*4, true);
|
||||
|
||||
/* Lookahead barrier, don't dig deeper */
|
||||
if(offsetBarrier & 0x00800000) continue;
|
||||
|
||||
/* Append to the queue */
|
||||
leaves.push([offsetBarrier & 0x007fffff, suffixLength + 1]);
|
||||
|
||||
/* We don't have anything yet and this is the only path
|
||||
forward, add the char to suggested Tab autocompletion. Can't
|
||||
extract it from the leftmost 8 bits of offsetBarrier because
|
||||
that would make it negative, have to load as Uint8 instead.
|
||||
Also can't use String.fromCharCode(), because later doing
|
||||
str.charCodeAt() would give me back UTF-16 values, which is
|
||||
absolutely unwanted when all I want is check for truncated
|
||||
UTF-8. */
|
||||
if(!results.length && leaves.length == 1 && childCount == 1)
|
||||
suggestedTabAutocompletionChars.push(this.trie.getUint8(childOffset + j*4 + 3));
|
||||
}
|
||||
}
|
||||
|
||||
return [results, this.autocompletedCharsToString(suggestedTabAutocompletionChars)];
|
||||
},
|
||||
|
||||
gatherResult: function(index, suffixLength, maxUrlPrefix) {
|
||||
let flags = this.map.getUint8(index*4 + 3);
|
||||
let resultOffset = this.map.getUint32(index*4, true) & 0x00ffffff;
|
||||
|
||||
/* The result is an alias, parse the aliased prefix */
|
||||
let aliasedIndex = null;
|
||||
if((flags & 0xf0) == 0x00) {
|
||||
aliasedIndex = this.map.getUint16(resultOffset, true);
|
||||
resultOffset += 2;
|
||||
}
|
||||
|
||||
/* The result has a prefix, parse that first, recursively */
|
||||
let name = '';
|
||||
let url = '';
|
||||
if(flags & (1 << 3)) {
|
||||
let prefixIndex = this.map.getUint16(resultOffset, true);
|
||||
let prefixUrlPrefixLength = Math.min(this.map.getUint8(resultOffset + 2), maxUrlPrefix);
|
||||
|
||||
let prefix = this.gatherResult(prefixIndex, 0 /*ignored*/, prefixUrlPrefixLength);
|
||||
name = prefix.name;
|
||||
url = prefix.url;
|
||||
|
||||
resultOffset += 3;
|
||||
}
|
||||
|
||||
/* The result has a suffix, extract its length */
|
||||
let resultSuffixLength = 0;
|
||||
if(flags & (1 << 0)) {
|
||||
resultSuffixLength = this.map.getUint8(resultOffset);
|
||||
++resultOffset;
|
||||
}
|
||||
|
||||
let nextResultOffset = this.map.getUint32((index + 1)*4, true) & 0x00ffffff;
|
||||
|
||||
/* Extract name */
|
||||
let j = resultOffset;
|
||||
for(; j != nextResultOffset; ++j) {
|
||||
let c = this.map.getUint8(j);
|
||||
|
||||
/* End of null-delimited name */
|
||||
if(!c) {
|
||||
++j;
|
||||
break; /* null-delimited */
|
||||
}
|
||||
|
||||
name += String.fromCharCode(c); /* eheh. IS THIS FAST?! */
|
||||
}
|
||||
|
||||
/* The result is an alias and we're not deep inside resolving a prefix,
|
||||
extract the aliased name and URL */
|
||||
/* TODO: this abuses 0xffffff to guess how the call stack is deep and
|
||||
that's just wrong, fix! */
|
||||
if(aliasedIndex != null && maxUrlPrefix == 0xffffff) {
|
||||
let alias = this.gatherResult(aliasedIndex, 0 /* ignored */, 0xffffff); /* should be enough haha */
|
||||
url = alias.url;
|
||||
flags = alias.flags;
|
||||
|
||||
/* Keeping in UTF-8, as we need that for proper slicing (and concatenating) */
|
||||
return {name: name,
|
||||
alias: alias.name,
|
||||
url: alias.url,
|
||||
flags: alias.flags,
|
||||
suffixLength: suffixLength + resultSuffixLength};
|
||||
}
|
||||
|
||||
/* Otherwise extract URL from here */
|
||||
let max = Math.min(j + maxUrlPrefix - url.length, nextResultOffset);
|
||||
for(; j != max; ++j) {
|
||||
url += String.fromCharCode(this.map.getUint8(j));
|
||||
}
|
||||
|
||||
/* Keeping in UTF-8, as we need that for proper slicing (and concatenating) */
|
||||
return {name: name,
|
||||
url: url,
|
||||
flags: flags,
|
||||
suffixLength: suffixLength + resultSuffixLength};
|
||||
},
|
||||
|
||||
escape: function(name) {
|
||||
return name.replace(/[\"&<>]/g, function (a) {
|
||||
return { '"': '"', '&': '&', '<': '<', '>': '>' }[a];
|
||||
});
|
||||
},
|
||||
escapeForRtl: function(name) {
|
||||
/* Besides the obvious escaping of HTML entities we also need
|
||||
to escape punctuation, because due to the RTL hack to cut
|
||||
text off on left side the punctuation characters get
|
||||
reordered (of course). Prepending ‎ works for most
|
||||
characters, parentheses we need to *soak* in it. But only
|
||||
the right ones. And that for some reason needs to be also for &.
|
||||
Huh. https://en.wikipedia.org/wiki/Right-to-left_mark */
|
||||
return this.escape(name).replace(/[:=]/g, '‎$&').replace(/(\)|>|&|\/)/g, '‎$&‎');
|
||||
},
|
||||
|
||||
renderResults: /* istanbul ignore next */ function(value, resultsSuggestedTabAutocompletion) {
|
||||
/* Normalize the value and encode as UTF-8 so the slicing works
|
||||
properly */
|
||||
value = this.toUtf8(value.trim());
|
||||
|
||||
if(!value.length) {
|
||||
document.getElementById('search-help').style.display = 'block';
|
||||
document.getElementById('search-results').style.display = 'none';
|
||||
document.getElementById('search-notfound').style.display = 'none';
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('search-help').style.display = 'none';
|
||||
|
||||
/* Results found */
|
||||
if(resultsSuggestedTabAutocompletion[0].length) {
|
||||
let results = resultsSuggestedTabAutocompletion[0];
|
||||
|
||||
document.getElementById('search-results').style.display = 'block';
|
||||
document.getElementById('search-notfound').style.display = 'none';
|
||||
|
||||
let list = '';
|
||||
for(let i = 0; i != results.length; ++i) {
|
||||
let type = '';
|
||||
let color = '';
|
||||
switch(results[i].flags >> 4) {
|
||||
/* Keep in sync with dox2html5.py */
|
||||
case 1:
|
||||
type = 'page';
|
||||
color = 'm-success';
|
||||
break;
|
||||
case 2:
|
||||
type = 'namespace';
|
||||
color = 'm-primary';
|
||||
break;
|
||||
case 3:
|
||||
type = 'group';
|
||||
color = 'm-success';
|
||||
break;
|
||||
case 4:
|
||||
type = 'class';
|
||||
color = 'm-primary';
|
||||
break;
|
||||
case 5:
|
||||
type = 'struct';
|
||||
color = 'm-primary';
|
||||
break;
|
||||
case 6:
|
||||
type = 'union';
|
||||
color = 'm-primary';
|
||||
break;
|
||||
case 7:
|
||||
type = 'typedef';
|
||||
color = 'm-primary';
|
||||
break;
|
||||
case 8:
|
||||
type = 'dir';
|
||||
color = 'm-warning';
|
||||
break;
|
||||
case 9:
|
||||
type = 'file';
|
||||
color = 'm-warning';
|
||||
break;
|
||||
case 10:
|
||||
type = 'func';
|
||||
color = 'm-info';
|
||||
break;
|
||||
case 11:
|
||||
type = 'define';
|
||||
color = 'm-info';
|
||||
break;
|
||||
case 12:
|
||||
type = 'enum';
|
||||
color = 'm-primary';
|
||||
break;
|
||||
case 13:
|
||||
type = 'enum val';
|
||||
color = 'm-default';
|
||||
break;
|
||||
case 14:
|
||||
type = 'var';
|
||||
color = 'm-default';
|
||||
break;
|
||||
}
|
||||
|
||||
/* Labels + */
|
||||
list += '<li' + (i ? '' : ' id="search-current"') + '><a href="' + results[i].url + '" onmouseover="selectResult(event)" data-md-link-title="' + this.escape(results[i].name.substr(results[i].name.length - value.length - results[i].suffixLength)) + '"><div class="m-label m-flat ' + color + '">' + type + '</div>' + (results[i].flags & 2 ? '<div class="m-label m-danger">deprecated</div>' : '') + (results[i].flags & 4 ? '<div class="m-label m-danger">deleted</div>' : '');
|
||||
|
||||
/* Render the alias (cut off from the right) */
|
||||
if(results[i].alias) {
|
||||
list += '<div class="m-dox-search-alias"><span class="m-text m-dim">' + this.escape(results[i].name.substr(0, results[i].name.length - value.length - results[i].suffixLength)) + '</span><span class="m-dox-search-typed">' + this.escape(results[i].name.substr(results[i].name.length - value.length - results[i].suffixLength, value.length)) + '</span>' + this.escapeForRtl(results[i].name.substr(results[i].name.length - results[i].suffixLength)) + '<span class="m-text m-dim">: ' + this.escape(results[i].alias) + '</span>';
|
||||
|
||||
/* Render the normal thing (cut off from the left, have to
|
||||
escape for RTL) */
|
||||
} else {
|
||||
list += '<div><span class="m-text m-dim">' + this.escapeForRtl(results[i].name.substr(0, results[i].name.length - value.length - results[i].suffixLength)) + '</span><span class="m-dox-search-typed">' + this.escapeForRtl(results[i].name.substr(results[i].name.length - value.length - results[i].suffixLength, value.length)) + '</span>' + this.escapeForRtl(results[i].name.substr(results[i].name.length - results[i].suffixLength));
|
||||
}
|
||||
|
||||
/* The closing */
|
||||
list += '</div></a></li>';
|
||||
}
|
||||
document.getElementById('search-results').innerHTML = this.fromUtf8(list);
|
||||
document.getElementById('search-current').scrollIntoView(true);
|
||||
|
||||
/* Append the suggested tab autocompletion, if any, and if the user
|
||||
didn't just delete it */
|
||||
let searchInput = document.getElementById('search-input');
|
||||
if(this.autocompleteNextInputEvent && resultsSuggestedTabAutocompletion[1].length && searchInput.selectionEnd == searchInput.value.length) {
|
||||
let suggestedTabAutocompletion = this.fromUtf8(resultsSuggestedTabAutocompletion[1]);
|
||||
|
||||
let lengthBefore = searchInput.value.length;
|
||||
searchInput.value += suggestedTabAutocompletion;
|
||||
searchInput.setSelectionRange(lengthBefore, searchInput.value.length);
|
||||
}
|
||||
|
||||
/* Nothing found */
|
||||
} else {
|
||||
document.getElementById('search-results').innerHTML = '';
|
||||
document.getElementById('search-results').style.display = 'none';
|
||||
document.getElementById('search-notfound').style.display = 'block';
|
||||
}
|
||||
|
||||
/* Don't allow things to be selected just by motionless mouse cursor
|
||||
suddenly appearing over a search result */
|
||||
this.mouseMovedSinceLastRender = false;
|
||||
|
||||
/* Reset autocompletion, if it was allowed. It'll get whitelisted next
|
||||
time a character gets inserted. */
|
||||
this.autocompleteNextInputEvent = false;
|
||||
},
|
||||
|
||||
searchAndRender: /* istanbul ignore next */ function(value) {
|
||||
let prev = performance.now();
|
||||
let results = this.search(value);
|
||||
let after = performance.now();
|
||||
this.renderResults(value, results);
|
||||
if(value.trim().length) {
|
||||
document.getElementById('search-symbolcount').innerHTML =
|
||||
results[0].length + (results.length >= this.maxResults ? '+' : '') + " results (" + Math.round((after - prev)*10)/10 + " ms)";
|
||||
} else
|
||||
document.getElementById('search-symbolcount').innerHTML =
|
||||
this.symbolCount + " symbols (" + Math.round(this.dataSize/102.4)/10 + " kB)";
|
||||
},
|
||||
};
|
||||
|
||||
/* istanbul ignore next */
|
||||
function selectResult(event) {
|
||||
if(!Search.mouseMovedSinceLastRender) return;
|
||||
|
||||
if(event.currentTarget.parentNode.id == 'search-current') return;
|
||||
|
||||
let current = document.getElementById('search-current');
|
||||
current.removeAttribute('id');
|
||||
event.currentTarget.parentNode.id = 'search-current';
|
||||
}
|
||||
|
||||
/* This is separated from showSearch() because we need non-destructive behavior
|
||||
when appearing directly on a URL with #search */ /* istanbul ignore next */
|
||||
function updateForSearchVisible() {
|
||||
/* Prevent accidental scrolling of the body, prevent page layout jumps */
|
||||
let scrolledBodyWidth = document.body.offsetWidth;
|
||||
document.body.style.overflow = 'hidden';
|
||||
document.body.style.paddingRight = (document.body.offsetWidth - scrolledBodyWidth) + 'px';
|
||||
|
||||
document.getElementById('search-input').value = '';
|
||||
document.getElementById('search-input').focus();
|
||||
document.getElementById('search-results').style.display = 'none';
|
||||
document.getElementById('search-notfound').style.display = 'none';
|
||||
document.getElementById('search-help').style.display = 'block';
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
function showSearch() {
|
||||
window.location.hash = '#search';
|
||||
Search.canGoBackToHideSearch = true;
|
||||
|
||||
updateForSearchVisible();
|
||||
return false;
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
function hideSearch() {
|
||||
/* If the search box was opened using showSearch(), we can go back in the
|
||||
history. Otherwise (for example when we landed to #search from a
|
||||
bookmark or another server), going back would not do the right thing and
|
||||
in that case we simply replace the current history state. */
|
||||
if(Search.canGoBackToHideSearch) {
|
||||
Search.canGoBackToHideSearch = false;
|
||||
window.history.back();
|
||||
} else {
|
||||
window.location.hash = '#!';
|
||||
window.history.replaceState('', '', window.location.pathname);
|
||||
}
|
||||
|
||||
/* Restore scrollbar, prevent page layout jumps */
|
||||
document.body.style.overflow = 'auto';
|
||||
document.body.style.paddingRight = '0';
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
function copyToKeyboard(text) {
|
||||
/* Append to the popup, appending to document.body would cause it to
|
||||
scroll when focused */
|
||||
let searchPopup = document.getElementsByClassName('m-dox-search')[0];
|
||||
let textarea = document.createElement("textarea");
|
||||
textarea.value = text;
|
||||
searchPopup.appendChild(textarea);
|
||||
textarea.focus();
|
||||
textarea.select();
|
||||
|
||||
document.execCommand('copy');
|
||||
|
||||
searchPopup.removeChild(textarea);
|
||||
document.getElementById('search-input').focus();
|
||||
}
|
||||
|
||||
/* Only in case we're running in a browser. Why a simple if(document) doesn't
|
||||
work is beyond me. */ /* istanbul ignore if */
|
||||
if(typeof document !== 'undefined') {
|
||||
document.getElementById('search-input').oninput = function(event) {
|
||||
Search.searchAndRender(document.getElementById('search-input').value);
|
||||
};
|
||||
|
||||
document.onkeydown = function(event) {
|
||||
/* Search shown */
|
||||
if(window.location.hash == '#search') {
|
||||
/* Close the search */
|
||||
if(event.key == 'Escape') {
|
||||
hideSearch();
|
||||
|
||||
/* Focus the search input, if not already, using T or Tab */
|
||||
} else if((!document.activeElement || document.activeElement.id != 'search-input') && (event.key.toLowerCase() == 't' || event.key == 'Tab') && !event.shiftKey && !event.ctrlKey && !event.altKey && !event.metaKey) {
|
||||
document.getElementById('search-input').focus();
|
||||
return false; /* so T doesn't get entered into the box */
|
||||
|
||||
/* Fill in the autocompleted selection */
|
||||
} else if(event.key == 'Tab' && !event.shiftKey && !event.ctrlKey && !event.altKey && !event.metaKey) {
|
||||
/* But only if the input has selection at the end */
|
||||
let input = document.getElementById('search-input');
|
||||
if(input.selectionEnd == input.value.length && input.selectionStart != input.selectionEnd)
|
||||
input.setSelectionRange(input.value.length, input.value.length);
|
||||
|
||||
/* Select next item */
|
||||
} else if(event.key == 'ArrowDown') {
|
||||
let current = document.getElementById('search-current');
|
||||
if(current) {
|
||||
let next = current.nextSibling;
|
||||
if(next) {
|
||||
current.id = '';
|
||||
next.id = 'search-current';
|
||||
next.scrollIntoView(false);
|
||||
}
|
||||
}
|
||||
return false; /* so the keypress doesn't affect input cursor */
|
||||
|
||||
/* Select prev item */
|
||||
} else if(event.key == 'ArrowUp') {
|
||||
let current = document.getElementById('search-current');
|
||||
if(current) {
|
||||
let prev = current.previousSibling;
|
||||
if(prev) {
|
||||
current.id = '';
|
||||
prev.id = 'search-current';
|
||||
prev.scrollIntoView(false);
|
||||
}
|
||||
}
|
||||
return false; /* so the keypress doesn't affect input cursor */
|
||||
|
||||
/* Go to result (if any) */
|
||||
} else if(event.key == 'Enter') {
|
||||
let result = document.getElementById('search-current');
|
||||
if(result) {
|
||||
result.firstElementChild.click();
|
||||
|
||||
/* We might be staying on the same page, so restore scrollbar,
|
||||
and prevent page layout jumps */
|
||||
document.body.style.overflow = 'auto';
|
||||
document.body.style.paddingRight = '0';
|
||||
}
|
||||
|
||||
return false; /* so the form doesn't get sent */
|
||||
|
||||
/* Copy (Markdown) link to keyboard */
|
||||
} else if((event.key.toLowerCase() == 'l' || event.key.toLowerCase() == 'm') && event.metaKey) {
|
||||
let result = document.getElementById('search-current');
|
||||
if(result) {
|
||||
let plain = event.key.toLowerCase() == 'l';
|
||||
let link = plain ? result.firstElementChild.href :
|
||||
'[' + result.firstElementChild.dataset.mdLinkTitle + '](' + result.firstElementChild.href + ')';
|
||||
|
||||
copyToKeyboard(link);
|
||||
|
||||
/* Add CSS class to the element for visual feedback (this
|
||||
will get removed on keyup), but only if it's not already
|
||||
there (in case of key repeat, e.g.) */
|
||||
if(result.className.indexOf('m-dox-search-copied') == -1)
|
||||
result.className += ' m-dox-search-copied';
|
||||
console.log("Copied " + (plain ? "link" : "Markdown link") + " to " + result.firstElementChild.dataset.mdLinkTitle);
|
||||
}
|
||||
|
||||
return false; /* so L doesn't get entered into the box */
|
||||
|
||||
/* Looks like the user is inserting some text (and not cutting,
|
||||
copying or whatever), allow autocompletion for the new
|
||||
character. The oninput event resets this back to false, so this
|
||||
basically whitelists only keyboard input, including Shift-key
|
||||
and special chars using right Alt (or equivalent on Mac), but
|
||||
excluding Ctrl-key, which is usually not for text input. In the
|
||||
worst case the autocompletion won't be allowed ever, which is
|
||||
much more acceptable behavior than having no ability to disable
|
||||
it and annoying the users. See also this WONTFIX Android bug:
|
||||
https://bugs.chromium.org/p/chromium/issues/detail?id=118639 */
|
||||
} else if(event.key != 'Backspace' && event.key != 'Delete' && !event.metaKey && (!event.ctrlKey || event.altKey)) {
|
||||
Search.autocompleteNextInputEvent = true;
|
||||
/* Otherwise reset the flag, because when the user would press e.g.
|
||||
the 'a' key and then e.g. ArrowRight (which doesn't trigger
|
||||
oninput), a Backspace after would still result in
|
||||
autocompleteNextInputEvent, because nothing reset it back. */
|
||||
} else {
|
||||
Search.autocompleteNextInputEvent = false;
|
||||
}
|
||||
|
||||
/* Search hidden */
|
||||
} else {
|
||||
/* Open the search on the T or Tab key */
|
||||
if((event.key.toLowerCase() == 't' || event.key == 'Tab') && !event.shiftKey && !event.ctrlKey && !event.altKey && !event.metaKey) {
|
||||
showSearch();
|
||||
return false; /* so T doesn't get entered into the box */
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
document.onkeyup = function(event) {
|
||||
/* Remove highlight after key is released after a link copy */
|
||||
if((event.key.toLowerCase() == 'l' || event.key.toLowerCase() == 'm') && event.metaKey) {
|
||||
let result = document.getElementById('search-current');
|
||||
if(result) result.className = result.className.replace(' m-dox-search-copied', '');
|
||||
}
|
||||
};
|
||||
|
||||
/* Allow selecting items by mouse hover only after it moves once the
|
||||
results are populated. This prevents a random item getting selected if
|
||||
the cursor is left motionless over the result area. */
|
||||
document.getElementById('search-results').onmousemove = function() {
|
||||
Search.mouseMovedSinceLastRender = true;
|
||||
};
|
||||
|
||||
/* If #search is already present in the URL, hide the scrollbar etc. for a
|
||||
consistent experience */
|
||||
if(window.location.hash == '#search') updateForSearchVisible();
|
||||
}
|
||||
|
||||
/* For Node.js testing */ /* istanbul ignore else */
|
||||
if(typeof module !== 'undefined') { module.exports = { Search: Search }; }
|
||||
2
searchdata.js
Normal file
2
searchdata.js
Normal file
File diff suppressed because one or more lines are too long
174
structcti_1_1cancellation__result.html
Normal file
174
structcti_1_1cancellation__result.html
Normal file
@ -0,0 +1,174 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::cancellation_result struct | 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>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>cancellation_result <span class="m-thin">struct</span>
|
||||
</h1>
|
||||
<p>A class which is convertible to any <a href="classcti_1_1result.html" class="m-dox">result</a> and that definitely holds a default constructed exception which signals the cancellation of the asynchronous control flow.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</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>
|
||||
174
structcti_1_1empty__result.html
Normal file
174
structcti_1_1empty__result.html
Normal file
@ -0,0 +1,174 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::empty_result struct | 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>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>empty_result <span class="m-thin">struct</span>
|
||||
</h1>
|
||||
<p>A class which is convertible to any <a href="classcti_1_1result.html" class="m-dox">result</a> and that definitely holds no value so the real result gets invalidated when this object is passed to it.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</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>
|
||||
174
structcti_1_1exception__arg__t.html
Normal file
174
structcti_1_1exception__arg__t.html
Normal file
@ -0,0 +1,174 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::exception_arg_t struct | 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>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>exception_arg_t <span class="m-thin">struct</span>
|
||||
</h1>
|
||||
<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>
|
||||
</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>
|
||||
174
structcti_1_1is__ready__arg__t.html
Normal file
174
structcti_1_1is__ready__arg__t.html
Normal file
@ -0,0 +1,174 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::is_ready_arg_t struct | 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>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>is_ready_arg_t <span class="m-thin">struct</span>
|
||||
</h1>
|
||||
<p>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.</p>
|
||||
<aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</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>
|
||||
174
structcti_1_1unpack__arg__t.html
Normal file
174
structcti_1_1unpack__arg__t.html
Normal file
@ -0,0 +1,174 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::unpack_arg_t struct | 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>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>unpack_arg_t <span class="m-thin">struct</span>
|
||||
</h1>
|
||||
<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>
|
||||
</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>
|
||||
207
structcti_1_1use__continuable__t.html
Normal file
207
structcti_1_1use__continuable__t.html
Normal file
@ -0,0 +1,207 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>cti::use_continuable_t struct | 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>
|
||||
<div class="m-dox-template">template<typename Mapper = detail::asio::map_default></div>
|
||||
<span class="m-breadcrumb"><a href="namespacecti.html">cti</a>::<wbr/></span>use_continuable_t <span class="m-thin">struct</span>
|
||||
</h1>
|
||||
<p>Type used as an ASIO completion token to specify an asynchronous operation that should return a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p>
|
||||
<table class="m-table m-fullwidth m-flat">
|
||||
<thead>
|
||||
<tr><th colspan="2">Template parameters</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%">Mapper</td>
|
||||
<td><p>The token can be instantiated with a custom mapper for asio error codes which makes it possible to ignore errors or treat them as cancellation types. The mapper has the following form:</p><pre class="m-code"><span class="k">struct</span> <span class="n">my_mapper</span> <span class="p">{</span>
|
||||
<span class="k">constexpr</span> <span class="n">my_mapper</span><span class="p">()</span> <span class="k">noexcept</span> <span class="p">{}</span>
|
||||
|
||||
<span class="c1">/// Returns true when the error_code_t is a type which represents</span>
|
||||
<span class="c1">/// cancellation and</span>
|
||||
<span class="kt">bool</span> <span class="n">is_cancellation</span><span class="p">(</span><span class="n">error_code_t</span> <span class="k">const</span><span class="o">&</span> <span class="cm">/*ec*/</span><span class="p">)</span> <span class="k">const</span> <span class="k">noexcept</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="nb">false</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
<span class="kt">bool</span> <span class="n">is_ignored</span><span class="p">(</span><span class="n">error_code_t</span> <span class="k">const</span><span class="o">&</span> <span class="cm">/*ec*/</span><span class="p">)</span> <span class="k">const</span> <span class="k">noexcept</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="nb">false</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">};</span></pre></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<ul><li>Boost 1.70 or asio 1.13.0 is required for the async initiation</li><li>Until boost 1.72 or asio 1.16.0 overhead through an additional type erasure is added. It is recommended to update to those versions.</li></ul><p>The special static variable use_continuable can be appended to any (boost) asio function that accepts a callback to make it return a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p><pre class="m-code"><span class="cp">#include</span> <span class="cpf"><continuable/continuable.hpp></span><span class="cp"></span>
|
||||
<span class="cp">#include</span> <span class="cpf"><continuable/external/asio.hpp></span><span class="cp"></span>
|
||||
<span class="cp">#include</span> <span class="cpf"><asio.hpp></span><span class="cp"></span>
|
||||
|
||||
<span class="c1">// ...</span>
|
||||
|
||||
<span class="n">asio</span><span class="o">::</span><span class="n">tcp</span><span class="o">::</span><span class="n">resolver</span> <span class="n">resolver</span><span class="p">(...);</span>
|
||||
<span class="n">resolver</span><span class="p">.</span><span class="n">async_resolve</span><span class="p">(</span><span class="s">"127.0.0.1"</span><span class="p">,</span> <span class="s">"daytime"</span><span class="p">,</span> <span class="n">cti</span><span class="o">::</span><span class="n">use_continuable</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">asio</span><span class="o">::</span><span class="n">udp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span> <span class="n">iterator</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-warning"><h4>Attention</h4><p><code>asio::error::basic_errors::operation_aborted</code> errors returned by asio are automatically transformed into a default constructed exception type which represents "operation canceled" by the user or program. If you intend to retrieve the full asio::error_code without remapping use the use_continuable_raw_t completion token instead!</p></aside><aside class="m-note m-default"><h4>Since</h4><p>4.0.0</p></aside>
|
||||
</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>
|
||||
85
terminal.css
Normal file
85
terminal.css
Normal file
@ -0,0 +1,85 @@
|
||||
.terminal {
|
||||
box-shadow: rgba(0, 0, 0, 0.8) 0px 20px 70px;
|
||||
box-sizing: border-box;
|
||||
max-width: 550px;
|
||||
height: 210px;
|
||||
margin: 0 auto;
|
||||
background-color: #272a3aa6;
|
||||
}
|
||||
|
||||
.terminal > .fakeMenu {
|
||||
box-sizing: border-box;
|
||||
height: 25px;
|
||||
background-color: #1b1e2d;
|
||||
margin: 0 auto;
|
||||
border-top-right-radius: 5px;
|
||||
border-top-left-radius: 5px;
|
||||
font-family: initial;
|
||||
}
|
||||
|
||||
.terminal > .fakeMenu > .fakeButtons {
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid #000;
|
||||
position: relative;
|
||||
top: 6px;
|
||||
left: 6px;
|
||||
background-color: #ff3b47;
|
||||
border-color: #9d252b;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.terminal > .fakeMenu > .fakeMinimize {
|
||||
left: 11px;
|
||||
background-color: #ffc100;
|
||||
border-color: #9d802c;
|
||||
}
|
||||
|
||||
.terminal > .fakeMenu > .fakeZoom {
|
||||
left: 16px;
|
||||
background-color: #00d742;
|
||||
border-color: #049931;
|
||||
}
|
||||
|
||||
.terminal > .fakeScreen {
|
||||
box-sizing: border-box;
|
||||
margin: 0 auto;
|
||||
padding: 10px;
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
}
|
||||
|
||||
.terminal > .fakeScreen > pre {
|
||||
background-color: initial;
|
||||
margin: initial;
|
||||
padding: initial;
|
||||
overflow-x: initial;
|
||||
}
|
||||
|
||||
.terminal > .fakeScreen > pre > code {
|
||||
background: initial;
|
||||
background-color: initial;
|
||||
overflow: hidden;
|
||||
margin: initial;
|
||||
padding: initial;
|
||||
}
|
||||
|
||||
.terminal > .fakeScreen > p {
|
||||
color: #9CD9F0;
|
||||
position: relative;
|
||||
left: 50%;
|
||||
margin-left: -8.5em;
|
||||
text-align: left;
|
||||
font-size: 1.25em;
|
||||
font-family: monospace;
|
||||
white-space: normal;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.starbar {
|
||||
max-width: 550px;
|
||||
margin: 0 auto;
|
||||
padding-top: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
44
terminal.js
Normal file
44
terminal.js
Normal file
@ -0,0 +1,44 @@
|
||||
(function() {
|
||||
var backend = '// Continuable for backend developers:\n(http_request("github.com/Naios") && http_request("atom.io"))\n .then([] (std::string github, std::string atom) {\n // ...\n return mysql_query("SELECT * FROM `users`");\n })\n .then([] (ResultSet result) {\n // ...\n }, executor->post());';
|
||||
var game = '// Continuable for game developers:\nme->WaitForPlayer()\n .then([&] (Player* player) {\n return me->MoveTo(player->GetPosition());\n })\n .then(me->Say("Hello friend!"))\n .then(me->Wait(3s)))\n .then(me->MoveTo(me->GetHomePosition()));';
|
||||
var adventurous = '// Continuable for the adventurous:\ntry {\n auto response = co_await http_request("github.com/Naios");\n} catch (std::exception const& e) {\n // ...\n}\nauto c = cti::make_ready_continuable(0, 1);\nauto [ first, second ] = co_await std::move(c);\nco_return first + second;';
|
||||
var coroutines = '// Continuable for mastering coroutines:\ncti::when_all(\n []() -> cti::continuable<int, int> {\n co_return std::make_tuple(0, 1); // ...\n }(), []() -> cti::continuable<int, int> {\n co_return std::make_tuple(2, 3); // ...\n }()).then([](int, int, int, int) {\n // ...\n });';
|
||||
|
||||
// Teach hljs some new keywords...
|
||||
var cpp = hljs.getLanguage('cpp').exports.k;
|
||||
cpp.built_in +=
|
||||
" http_request mysql_query then exception post make_continuable cti make_ready_continuable ResultSet move WaitForPlayer MoveTo Player GetPosition GetHomePosition Wait Say when_all continuable make_tuple";
|
||||
cpp.keyword +=
|
||||
" co_await co_return";
|
||||
cpp.literal +=
|
||||
" 3s";
|
||||
|
||||
hljs.configure({
|
||||
tabReplace: ' ',
|
||||
// classPrefix: '',
|
||||
languages: ['cpp'],
|
||||
});
|
||||
|
||||
function highlight(code) {
|
||||
return hljs.highlight('cpp', code, "", null).value;
|
||||
};
|
||||
|
||||
var typed = new Typed('#typedterminal', {
|
||||
strings: [
|
||||
highlight(backend),
|
||||
highlight(game),
|
||||
highlight(adventurous),
|
||||
highlight(coroutines),
|
||||
],
|
||||
typeSpeed: 6,
|
||||
backSpeed: 4,
|
||||
startDelay: 1100,
|
||||
loop: true,
|
||||
shuffle: true,
|
||||
backDelay: 5500,
|
||||
// smartBackspace: true,
|
||||
// fadeOut: true,
|
||||
// fadeOutClass: 'typed-fade-out',
|
||||
// fadeOutDelay: 5500,
|
||||
});
|
||||
})();
|
||||
219
tutorial-awaiting-continuables.html
Normal file
219
tutorial-awaiting-continuables.html
Normal file
@ -0,0 +1,219 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Tutorial » Awaiting continuables | 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" id="m-navbar-current">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>
|
||||
<span class="m-breadcrumb"><a href="tutorial.html">Tutorial</a> »</span>
|
||||
|
||||
Awaiting continuables
|
||||
</h1>
|
||||
|
||||
<p>Explains how to use the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> together with <code>co_await</code>.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li><a href="#tutorial-awaiting-continuables-usage">Using co_await on continuables</a></li>
|
||||
<li><a href="#tutorial-awaiting-continuables-await">Using co_await with exceptions</a></li>
|
||||
<li><a href="#tutorial-awaiting-continuables-noexcept">Using co_await with disabled exceptions</a></li>
|
||||
<li><a href="#tutorial-awaiting-continuables-return">Using continuables as return type from coroutines</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="tutorial-awaiting-continuables-usage"><h2><a href="#tutorial-awaiting-continuables-usage">Using co_await on continuables</a></h2><p>Coroutines (<code>co_await</code>) are supported by continuables when the underlying toolchain supports the TS. Currently this works in MSVC 2017 and Clang 5.0.</p><aside class="m-note m-warning"><h4>Attention</h4><p>You have to enable this feature through defining the <code>CONTINUABLE_WITH_EXPERIMENTAL_COROUTINE</code> preprocessor definition.</p></aside><p>It is possible to await for any <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> as shown below:</p><pre class="m-code"><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="n">co_await</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="kt">int</span><span class="o">></span><span class="p">([](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
|
||||
<span class="p">});</span></pre><p>As described in <a href="classcti_1_1continuable__base.html#ac79b103d5c000a3a3d1b98d8adcf58e8" class="m-dox">continuable_base::<wbr />operator co_await()</a> a continuable with multiple arguments as result will wrap its result into a <code>std::tuple</code>:</p><pre class="m-code"><span class="n">std</span><span class="o">::</span><span class="n">tuple</span><span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">i</span> <span class="o">=</span> <span class="n">co_await</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span></pre></section><section id="tutorial-awaiting-continuables-await"><h2><a href="#tutorial-awaiting-continuables-await">Using co_await with exceptions</a></h2><p>When a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> was resolved through an exception the exception is rethrown from the <code>co_await</code> expression:</p><pre class="m-code"><span class="k">try</span> <span class="p">{</span>
|
||||
<span class="k">auto</span> <span class="n">response</span> <span class="o">=</span> <span class="n">co_await</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">);</span>
|
||||
<span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span> <span class="k">const</span><span class="o">&</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Handle the exception</span>
|
||||
<span class="p">}</span></pre></section><section id="tutorial-awaiting-continuables-noexcept"><h2><a href="#tutorial-awaiting-continuables-noexcept">Using co_await with disabled exceptions</a></h2><p>In case the library is configured to use error codes or a custom error type the return type of the co_await expression is changed.</p><p>The result is returned through an internal proxy object which may be queried for the error object:</p><table class="m-table"><thead><tr><th>Continuation type</th><th>co_await returns</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>unspecified<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>unspecified<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>unspecified<std::tuple<Args...>></code></td></tr></tbody></table><p>The interface of the proxy object is similar to the one proposed in the <code>std::expected</code> proposal:</p><pre class="m-code"><span class="k">if</span> <span class="p">(</span><span class="k">auto</span><span class="o">&&</span> <span class="n">result</span> <span class="o">=</span> <span class="n">co_await</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">))</span> <span class="p">{</span>
|
||||
<span class="k">auto</span> <span class="n">value</span> <span class="o">=</span> <span class="o">*</span><span class="n">result</span><span class="p">;</span>
|
||||
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">error_type</span> <span class="n">error</span> <span class="o">=</span> <span class="n">result</span><span class="p">.</span><span class="n">get_exception</span><span class="p">();</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="k">auto</span> <span class="n">result</span> <span class="o">=</span> <span class="n">co_await</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">);</span>
|
||||
|
||||
<span class="kt">bool</span><span class="p">(</span><span class="n">result</span><span class="p">);</span>
|
||||
<span class="n">result</span><span class="p">.</span><span class="n">is_value</span><span class="p">();</span>
|
||||
<span class="n">result</span><span class="p">.</span><span class="n">is_exception</span><span class="p">();</span>
|
||||
<span class="o">*</span><span class="n">result</span><span class="p">;</span> <span class="c1">// Same as result.get_value()</span>
|
||||
<span class="n">result</span><span class="p">.</span><span class="n">get_value</span><span class="p">();</span>
|
||||
<span class="n">result</span><span class="p">.</span><span class="n">get_exception</span><span class="p">();</span></pre></section><section id="tutorial-awaiting-continuables-return"><h2><a href="#tutorial-awaiting-continuables-return">Using continuables as return type from coroutines</a></h2><p>It is possible to use a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> as return type from coroutines.</p><pre class="m-code"><span class="n">cti</span><span class="o">::</span><span class="n">continuable</span><span class="o"><></span> <span class="n">resolve_async_void</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="n">co_await</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">);</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="n">co_return</span><span class="p">;</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">continuable</span><span class="o"><</span><span class="kt">int</span><span class="o">></span> <span class="n">resolve_async</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="n">co_await</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">);</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="n">co_return</span> <span class="mi">0</span><span class="p">;</span>
|
||||
<span class="p">}</span></pre><p>Additionally it's possible to return multiple return values from coroutines by wrapping those in a tuple like type:</p><pre class="m-code"><span class="n">cti</span><span class="o">::</span><span class="n">continuable</span><span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="o">></span> <span class="n">resolve_async_multiple</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="n">co_await</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">);</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="n">co_return</span> <span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span>
|
||||
<span class="p">}</span></pre></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>
|
||||
276
tutorial-chaining-continuables.html
Normal file
276
tutorial-chaining-continuables.html
Normal file
@ -0,0 +1,276 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Tutorial » Chaining continuables | 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" id="m-navbar-current">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>
|
||||
<span class="m-breadcrumb"><a href="tutorial.html">Tutorial</a> »</span>
|
||||
|
||||
Chaining continuables
|
||||
</h1>
|
||||
|
||||
<p>Explains how to chain multiple <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects together.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#tutorial-chaining-continuables-then">Using then and results</a>
|
||||
<ul>
|
||||
<li><a href="#tutorial-chaining-continuables-then-partial">Making use of partial argument application</a></li>
|
||||
<li><a href="#tutorial-chaining-continuables-then-executors">Assigning a specific executor to then</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#tutorial-chaining-continuables-fail">Using fail and exceptions</a></li>
|
||||
<li><a href="#tutorial-chaining-continuables-next">Using next to handle all paths</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="tutorial-chaining-continuables-then"><h2><a href="#tutorial-chaining-continuables-then">Using then and results</a></h2><p>A <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> provides various methods to continue the asynchronous call hierarchy. The most important method therefor is <a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">continuable_base::<wbr />then</a> which changes the object through attaching a result handler:</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([]</span> <span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">result</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Do something...</span>
|
||||
<span class="p">});</span></pre><p>A new <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is created which result depends on the return type of the handler. For instance it is possible to return plain values or the next <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> to continue the call hierarchy. See <a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">continuable_base::<wbr />then</a> for details.</p><pre class="m-code"><span class="n">mysql_query</span><span class="p">(</span><span class="s">"SELECT `id`, `name` FROM `users`"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">ResultSet</span> <span class="n">users</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Return the next continuable to process ...</span>
|
||||
<span class="k">return</span> <span class="n">mysql_query</span><span class="p">(</span><span class="s">"SELECT `id` name FROM `sessions`"</span><span class="p">);</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">ResultSet</span> <span class="n">sessions</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ... or pass multiple values to the next callback using tuples or pairs ...</span>
|
||||
<span class="k">return</span> <span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">sessions</span><span class="p">),</span> <span class="nb">true</span><span class="p">);</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">ResultSet</span> <span class="n">sessions</span><span class="p">,</span> <span class="kt">bool</span> <span class="n">is_ok</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ... or pass a single value to the next callback ...</span>
|
||||
<span class="k">return</span> <span class="mi">10</span><span class="p">;</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="k">auto</span> <span class="n">value</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ^^^^ Templated callbacks are possible too</span>
|
||||
<span class="p">})</span>
|
||||
<span class="c1">// ... you may even pass continuables to the `then` method directly:</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">(</span><span class="n">mysql_query</span><span class="p">(</span><span class="s">"SELECT * FROM `statistics`"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">ResultSet</span> <span class="n">result</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre><section id="tutorial-chaining-continuables-then-partial"><h3><a href="#tutorial-chaining-continuables-then-partial">Making use of partial argument application</a></h3><p>Callbacks passed to <a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">then</a> are only called with the amount of arguments that are accepted.</p><pre class="m-code"><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">&&</span> <span class="n">read_file</span><span class="p">(</span><span class="s">"entries.csv"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([]</span> <span class="p">{</span>
|
||||
<span class="c1">// ^^^^^^ The original signature was <std::string, Buffer>,</span>
|
||||
<span class="c1">// however, the callback is only invoked with the amount of</span>
|
||||
<span class="c1">// arguments it's accepting.</span>
|
||||
<span class="p">});</span></pre><p>This makes it possible to attach a callback accepting nothing to every <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p></section><section id="tutorial-chaining-continuables-then-executors"><h3><a href="#tutorial-chaining-continuables-then-executors">Assigning a specific executor to then</a></h3><p>Dispatching a callback through a specific executor is a common usage scenario and supported through the second argument of <a href="classcti_1_1continuable__base.html#adf02030d7211ffc4610f3bcb13d2a149" class="m-dox">then</a>:</p><pre class="m-code"><span class="k">auto</span> <span class="n">executor</span> <span class="o">=</span> <span class="p">[](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">work</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Dispatch the work here, store it for later</span>
|
||||
<span class="c1">// invocation or move it to another thread.</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">forward</span><span class="o"><</span><span class="k">decltype</span><span class="p">(</span><span class="n">work</span><span class="p">)</span><span class="o">></span><span class="p">(</span><span class="n">work</span><span class="p">)();</span>
|
||||
<span class="p">};</span>
|
||||
|
||||
<span class="n">read_file</span><span class="p">(</span><span class="s">"entries.csv"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">Buffer</span> <span class="n">buffer</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">},</span> <span class="n">executor</span><span class="p">);</span>
|
||||
<span class="c1">// ^^^^^^^^</span></pre><p>The supplied <code>work</code> callable may be stored and moved for later usage on a possible different thread or execution context.</p><aside class="m-note m-info"><h4>Note</h4><p>If you are intending to change the context the asynchronous task is running, you need to specify this inside the function that supplies the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> through moving the <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a>.</p><pre class="m-code"><span class="k">auto</span> <span class="nf">http_request</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">url</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">(</span>
|
||||
<span class="p">[</span><span class="n">url</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">url</span><span class="p">)](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">async</span><span class="p">([</span><span class="n">promise</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">forward</span><span class="o"><</span><span class="k">decltype</span><span class="p">(</span><span class="n">promise</span><span class="p">)</span><span class="o">></span><span class="p">(</span><span class="n">promise</span><span class="p">)]</span>
|
||||
<span class="p">()</span> <span class="k">mutable</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="s">"<html> ... </html>"</span><span class="p">);</span>
|
||||
<span class="p">});</span>
|
||||
<span class="p">});</span>
|
||||
<span class="p">}</span></pre></aside></section></section><section id="tutorial-chaining-continuables-fail"><h2><a href="#tutorial-chaining-continuables-fail">Using fail and exceptions</a></h2><p>Asynchronous exceptions are supported too. Exceptions that were set through <a href="classcti_1_1promise__base.html#a449356e97645d44cf4194932cc2006d7" class="m-dox">promise_base::<wbr />set_exception</a> are forwarded to the first available registered handler that was attached through <a href="classcti_1_1continuable__base.html#a7001122101ed32f729e39c53d6cb9c7f" class="m-dox">continuable_base::<wbr />fail</a> :</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([]</span> <span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">result</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Is never called if an error occurs</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">([]</span> <span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception_ptr</span> <span class="n">ptr</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">try</span> <span class="p">{</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">rethrow_exception</span><span class="p">(</span><span class="n">ptr</span><span class="p">);</span>
|
||||
<span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span> <span class="k">const</span><span class="o">&</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Handle the exception or error code here</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">});</span></pre><p>Multiple handlers are allowed to be registered, however the asynchronous call hierarchy is aborted after the first called fail handler and only the closest handler below is called.</p><aside class="m-note m-info"><h4>Note</h4><p>Retrieving a <code>std::exception_ptr</code> from a current exception may be done as shown below:</p><pre class="m-code"><span class="k">auto</span> <span class="nf">do_sth</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="kt">void</span><span class="o">></span><span class="p">([</span><span class="o">=</span><span class="p">]</span> <span class="p">(</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">try</span> <span class="p">{</span>
|
||||
<span class="c1">// Usually the exception is thrown by another expression</span>
|
||||
<span class="k">throw</span> <span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="p">{};</span>
|
||||
<span class="p">}</span> <span class="k">catch</span><span class="p">(...)</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_exception</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">current_exception</span><span class="p">());</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">});</span>
|
||||
<span class="p">}</span></pre></aside><p>Continuable also supports error codes automatically if exceptions are disabled. Additionally it is possible to specify a custom error type through defining.</p><pre class="m-code"><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([]</span> <span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">result</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Is never called if an error occurs</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">fail</span><span class="p">([]</span> <span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">error_condition</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">error</span><span class="p">.</span><span class="n">value</span><span class="p">();</span>
|
||||
<span class="n">error</span><span class="p">.</span><span class="n">category</span><span class="p">();</span>
|
||||
<span class="p">});</span></pre><p>The <a href="group___primitives.html#ga0220315293d1e2ebbda6be95fb3b2eeb" class="m-dox">error_<wbr />type</a> will be <code>std::exception_ptr</code> except if any of the following definitions is defined:</p><ul><li><code>CONTINUABLE_WITH_NO_EXCEPTIONS</code>: Define this to use <code>std::error_condition</code> as <a href="group___primitives.html#ga0220315293d1e2ebbda6be95fb3b2eeb" class="m-dox">error_<wbr />type</a> and to disable exception support. When exceptions are disabled this definition is set automatically.</li><li><code>CONTINUABLE_WITH_CUSTOM_ERROR_TYPE</code>: Define this to use a user defined error type.</li></ul><aside class="m-note m-warning"><h4>Attention</h4><p>By default unhandled exceptions or errors will trigger a built-in trap that causes abnormal application shutdown. In order to prevent this and to allow unhandled errors define <code>CONTINUABLE_WITH_UNHANDLED_EXCEPTIONS</code>.</p></aside></section><section id="tutorial-chaining-continuables-next"><h2><a href="#tutorial-chaining-continuables-next">Using next to handle all paths</a></h2><p>Sometimes it's required to provide a continuation and error handler from the same object. In order to avoid overloading conflicts there is the special method <a href="classcti_1_1continuable__base.html#ad4960d0794abb800f1dfd9a668900149" class="m-dox">continuable_base::<wbr />next</a> provided. The exception path overload is marked through the <a href="group___primitives.html#gab374e033adf83bc3883410b9857cca41" class="m-dox">dispatch_<wbr />error_<wbr />tag</a> :</p><pre class="m-code"><span class="k">struct</span> <span class="n">handle_all_paths</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">std</span><span class="o">::</span><span class="n">string</span> <span class="n">result</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</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">cti</span><span class="o">::</span><span class="n">dispatch_error_tag</span><span class="p">,</span> <span class="n">cti</span><span class="o">::</span><span class="n">error_type</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">}</span>
|
||||
<span class="p">};</span>
|
||||
|
||||
<span class="c1">// ...</span>
|
||||
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">next</span><span class="p">(</span><span class="n">handle_all_paths</span><span class="p">{});</span></pre></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>
|
||||
256
tutorial-connecting-continuables.html
Normal file
256
tutorial-connecting-continuables.html
Normal file
@ -0,0 +1,256 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Tutorial » Connecting continuables | 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" id="m-navbar-current">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>
|
||||
<span class="m-breadcrumb"><a href="tutorial.html">Tutorial</a> »</span>
|
||||
|
||||
Connecting continuables
|
||||
</h1>
|
||||
|
||||
<p>Explains how to connect various <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects together.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li><a href="#tutorial-connecting-continuables-strategies">Connections and strategies</a></li>
|
||||
<li>
|
||||
<a href="#tutorial-connecting-continuables-aggregated">Using aggregated strategies</a>
|
||||
<ul>
|
||||
<li><a href="#tutorial-connecting-continuables-aggregated-all">Using the all connection</a></li>
|
||||
<li><a href="#tutorial-connecting-continuables-aggregated-seq">Using the sequential connection</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#tutorial-connecting-continuables-any">Using the any connection</a></li>
|
||||
<li><a href="#tutorial-connecting-continuables-mixed">Mixing different strategies</a></li>
|
||||
<li><a href="#tutorial-connecting-continuables-nested">Nested continuables and plain types</a></li>
|
||||
<li><a href="#tutorial-connecting-continuables-populate">Populating a container from arbitrary continuables</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="tutorial-connecting-continuables-strategies"><h2><a href="#tutorial-connecting-continuables-strategies">Connections and strategies</a></h2><p>Connections make it possible to describe the dependencies between an arbitrary count of <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects in order resolve a returned <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> as soon as the dependencies are fulfilled.</p><p>For each connection strategy <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> provides an operator for for instance <a href="classcti_1_1continuable__base.html#ad5cbff40fcd03a6451eae06d310f1439" class="m-dox">continuable_base::<wbr />operator &&</a> and a free function, <a href="group___connections.html#gaef652b8561f76cad49e83cfa21a71734" class="m-dox">when_<wbr />all</a> for example. Both work similar however the free functions are capable of working with nested sequences as described in <a href="tutorial-connecting-continuables.html#tutorial-connecting-continuables-nested" class="m-dox">Nested continuables and plain types</a>.</p><aside class="m-note m-info"><h4>Note</h4><p>Connections between <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects are ensured to be <strong>thread-safe</strong> and <strong>wait-free</strong> by library design (when assuming that <code>std::call_once</code> is wait-free - which depends on the toolchain).</p></aside></section><section id="tutorial-connecting-continuables-aggregated"><h2><a href="#tutorial-connecting-continuables-aggregated">Using aggregated strategies</a></h2><p>Aggregated strategies will call the result handler with the compound result of all connected <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects.</p><p>The compound result is deduced as following. Every <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> maps its result to the result itself as shown below. When multiple <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects are connected on the same depth, the result is joined. See <a href="tutorial-connecting-continuables.html#tutorial-connecting-continuables-nested" class="m-dox">Nested continuables and plain types</a> for details.</p><table class="m-table"><thead><tr><th>Continuation type</th><th>In tuple like</th><th>In container (<code>std::vector</code>)</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><none></code></td><td><code><none></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>Arg</code></td><td><code>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>Args...</code></td><td><code>std::tuple<Args...></code></td></tr></tbody></table><section id="tutorial-connecting-continuables-aggregated-all"><h3><a href="#tutorial-connecting-continuables-aggregated-all">Using the all connection</a></h3><p>The <em>all</em> strategy invokes all connected continuable at once, it tries to resolve the connected <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects as fast as possible. It is possible to connect multiple <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects together through the <em>all</em> strategy by using <a href="classcti_1_1continuable__base.html#ad5cbff40fcd03a6451eae06d310f1439" class="m-dox">continuable_base::<wbr />operator &&</a> or <a href="group___connections.html#gaef652b8561f76cad49e83cfa21a71734" class="m-dox">when_<wbr />all</a>. In contrast to the operator the free functions are capable of workin with plain types and deeply nested <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects as described in <a href="tutorial-connecting-continuables.html#tutorial-connecting-continuables-nested" class="m-dox">Nested continuables and plain types</a> .</p><pre class="m-code"><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">&&</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"travis-ci.org"</span><span class="p">)</span> <span class="o">&&</span>
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">travis</span><span class="p">,</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">atom</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// The callback is called with the</span>
|
||||
<span class="c1">// response of github, travis and atom.</span>
|
||||
<span class="p">});</span></pre></section><section id="tutorial-connecting-continuables-aggregated-seq"><h3><a href="#tutorial-connecting-continuables-aggregated-seq">Using the sequential connection</a></h3><p>The <em>sequential</em> strategy invokes all connected continuable one after each other, it tries to resolve the next connected <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects as soon as the previous one was resolved. It is possible to connect multiple <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects together through the <em>sequential</em> strategy by using <a href="classcti_1_1continuable__base.html#abaaaf8a35827456fead299851268760e" class="m-dox">continuable_base::<wbr />operator>></a> or <a href="group___connections.html#ga481c31024079b6074617c64b16e615dd" class="m-dox">when_<wbr />seq</a>.</p><pre class="m-code"><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">>></span> <span class="n">http_request</span><span class="p">(</span><span class="s">"travis-ci.org"</span><span class="p">)</span> <span class="o">>></span>
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">travis</span><span class="p">,</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">atom</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// The requests are invoked sequentially instead</span>
|
||||
<span class="c1">// of requesting all at once.</span>
|
||||
<span class="p">});</span></pre></section></section><section id="tutorial-connecting-continuables-any"><h2><a href="#tutorial-connecting-continuables-any">Using the any connection</a></h2><p>The any connection strategy is completely different from the two introduces before: It calls the result handler with the first result or exception available. All <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects are required to have the same types of arguments.</p><pre class="m-code"><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">||</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"travis-ci.org"</span><span class="p">)</span> <span class="o">||</span>
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github_or_travis_or_atom</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// The callback is called with the first response</span>
|
||||
<span class="c1">// of either github, travis or atom.</span>
|
||||
<span class="p">});</span></pre></section><section id="tutorial-connecting-continuables-mixed"><h2><a href="#tutorial-connecting-continuables-mixed">Mixing different strategies</a></h2><p>Mixing different strategies through operators and free functions is natively supported as shown below:</p><pre class="m-code"><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span> <span class="o">&&</span>
|
||||
<span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"travis-ci.org"</span><span class="p">)</span> <span class="o">||</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">)))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">github</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">travis_or_atom</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// The callback is called with the response of</span>
|
||||
<span class="c1">// github for sure and the second parameter represents</span>
|
||||
<span class="c1">// the response of travis or atom.</span>
|
||||
<span class="p">});</span></pre></section><section id="tutorial-connecting-continuables-nested"><h2><a href="#tutorial-connecting-continuables-nested">Nested continuables and plain types</a></h2><p>For every operator that was shown above, there exists a free function that provides at least the same functionality:</p><pre class="m-code"><span class="n">cti</span><span class="o">::</span><span class="n">when_all</span><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">),</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"travis-ci.org"</span><span class="p">));</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">when_any</span><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">),</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"travis-ci.org"</span><span class="p">));</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">when_seq</span><span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">),</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"travis-ci.org"</span><span class="p">));</span></pre><p>Additionally the free functions are capable of working with continuables deeply nested inside tuple like objects (<code>std::tuple</code>, <code>std::pair</code> and <code>std::array</code>) as well as homogeneous containers (<code>std::vector</code>, <code>std::list</code> etc.).</p><pre class="m-code"><span class="n">std</span><span class="o">::</span><span class="n">tuple</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">cti</span><span class="o">::</span><span class="n">continuable</span><span class="o"><</span><span class="kt">int</span><span class="o">>>></span> <span class="n">outstanding</span><span class="p">;</span>
|
||||
<span class="c1">// ...</span>
|
||||
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">when_all</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">outstanding</span><span class="p">),</span>
|
||||
<span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">tuple</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">tuple</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">int</span><span class="o">>></span><span class="p">,</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">result</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre><p>Values which are given to such a free function are preserved and later passed to the result handler:</p><pre class="m-code"><span class="n">cti</span><span class="o">::</span><span class="n">when_seq</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span>
|
||||
<span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">r0</span><span class="p">,</span> <span class="kt">int</span> <span class="n">r1</span><span class="p">,</span> <span class="kt">int</span> <span class="n">r2</span><span class="p">,</span>
|
||||
<span class="kt">int</span> <span class="n">r3</span><span class="p">,</span> <span class="kt">int</span> <span class="n">r4</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre><p>When combining both capabilities it's even possible do something like this:</p><pre class="m-code"><span class="n">cti</span><span class="o">::</span><span class="n">when_all</span><span class="p">(</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
|
||||
<span class="mi">2</span><span class="p">,</span> <span class="c1">//< See this plain value</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">populate</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">3</span><span class="p">),</span> <span class="c1">// Creates a runtime</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">4</span><span class="p">)),</span> <span class="c1">// sized container.</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">make_tuple</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">5</span><span class="p">))))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="kt">int</span> <span class="n">r0</span><span class="p">,</span> <span class="kt">int</span> <span class="n">r1</span><span class="p">,</span> <span class="kt">int</span> <span class="n">r2</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">int</span><span class="o">></span> <span class="n">r34</span><span class="p">,</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">tuple</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">tuple</span><span class="o"><</span><span class="kt">int</span><span class="o">>></span> <span class="n">r5</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre></section><section id="tutorial-connecting-continuables-populate"><h2><a href="#tutorial-connecting-continuables-populate">Populating a container from arbitrary continuables</a></h2><p><a href="group___connections.html#ga4f6ecedf4b4ccd5e1c28d937ad717b32" class="m-dox">populate</a> mainly helps to create a homogeneous container from a runtime known count of continuables which type isn't exactly known. All continuables which are passed to this function should be originating from the same source or a method called with the same types of arguments:</p><pre class="m-code"><span class="c1">// cti::populate just creates a std::vector from the two continuables.</span>
|
||||
<span class="k">auto</span> <span class="n">v</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">populate</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">),</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">1</span><span class="p">));</span>
|
||||
|
||||
<span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">2</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="mi">5</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// It is possible to add more continuables</span>
|
||||
<span class="c1">// to the container afterwards</span>
|
||||
<span class="n">container</span><span class="p">.</span><span class="n">emplace_back</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="n">i</span><span class="p">));</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">when_all</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">v</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">int</span><span class="o">></span> <span class="n">resolved</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre></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>
|
||||
206
tutorial-creating-continuables.html
Normal file
206
tutorial-creating-continuables.html
Normal file
@ -0,0 +1,206 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Tutorial » Creating continuables | 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" id="m-navbar-current">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>
|
||||
<span class="m-breadcrumb"><a href="tutorial.html">Tutorial</a> »</span>
|
||||
|
||||
Creating continuables
|
||||
</h1>
|
||||
|
||||
<p>Explains how to create a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li><a href="#tutorial-creating-continuables-ready">From a value or exception</a></li>
|
||||
<li><a href="#tutorial-creating-continuables-promises">From a promise taking callable</a></li>
|
||||
<li><a href="#tutorial-creating-continuables-invocation">The continuable invocation model</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>A <a href="group___types.html#ga95d2328ba27fe194491b52073b58be50" class="m-dox">continuable</a> is an arbitrary instantiation of a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>, it represents the main class of the library and makes it possible to build up an asynchronous call hierarchy. When dealing with continuables we usually don't know its exact type for avoiding expensive type erasure.</p><p>The <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is convertible to a <a href="group___types.html#ga95d2328ba27fe194491b52073b58be50" class="m-dox">continuable</a> which represents a specified type of the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> on the cost of a type erasure.</p><section id="tutorial-creating-continuables-ready"><h2><a href="#tutorial-creating-continuables-ready">From a value or exception</a></h2><p>The library provides <a href="group___base.html#gaa1b6bcf17649b137e29c866ced3569c7" class="m-dox">make_<wbr />ready_<wbr />continuable</a> which may be used to create a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> from an arbitrary amount of values:</p><pre class="m-code"><span class="k">auto</span> <span class="n">one</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
|
||||
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">continuable</span><span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="kt">float</span><span class="p">,</span> <span class="kt">char</span><span class="o">></span> <span class="n">three</span> <span class="o">=</span>
|
||||
<span class="n">cti</span><span class="o">::</span><span class="n">make_ready_continuable</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mf">1.f</span><span class="p">,</span> <span class="sc">'2'</span><span class="p">);</span></pre><aside class="m-note m-info"><h4>Note</h4><p>In most situations you will never use <a href="group___base.html#gaa1b6bcf17649b137e29c866ced3569c7" class="m-dox">make_<wbr />ready_<wbr />continuable</a> because the library is capable of working with plain values directly and thus this burdens unnecessary overhead.</p></aside><p>Additionally a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> which resolves with an exception may be created through <a href="group___base.html#ga41794c321aef916f4fd0fe4c36aa9e6e" class="m-dox">make_<wbr />exceptional_<wbr />continuable</a>.</p><pre class="m-code"><span class="n">cti</span><span class="o">::</span><span class="n">continuable</span><span class="o"><</span><span class="kt">int</span><span class="o">></span> <span class="n">c</span> <span class="o">=</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_exceptional_continuable</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="p">{});</span></pre></section><section id="tutorial-creating-continuables-promises"><h2><a href="#tutorial-creating-continuables-promises">From a promise taking callable</a></h2><p>The main function for creating a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is <a href="group___base.html#gaf47869ea139d88976af5b9654d6d61c0" class="m-dox">make_<wbr />continuable</a> which must be invoked with the types of arguments it resolves to. It accepts a callable object which accepts an arbitrary object (the <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a>). The <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> is created by the library and then passed to the given callback. This is in contrast to the usage of the standard <code>std::promise</code> which is created by the user.</p><p>The <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> exposes methods to resolve it through result values or through an exception. Below we implement pseudo <code>http_request</code> function which resolves the request asynchronously trough a <code>std::string</code>.</p><pre class="m-code"><span class="k">auto</span> <span class="nf">http_request</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">url</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span><span class="p">(</span>
|
||||
<span class="p">[</span><span class="n">url</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">url</span><span class="p">)](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Resolve the promise upon completion of the task.</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="s">"<html> ... </html>"</span><span class="p">);</span>
|
||||
|
||||
<span class="c1">// Or promise.set_exception(...);</span>
|
||||
<span class="p">});</span>
|
||||
<span class="p">}</span></pre><p>An alternative would be a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> with a result of zero arguments:</p><pre class="m-code"><span class="k">auto</span> <span class="nf">wait_for</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">chrono</span><span class="o">::</span><span class="n">milliseconds</span> <span class="n">duration</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="kt">void</span><span class="o">></span><span class="p">([](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ^^^^</span>
|
||||
|
||||
<span class="c1">// Resolve the promise later when the duration is over</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">();</span>
|
||||
<span class="p">});</span></pre><p>A <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> may resolve with an arbitrary count of result values:</p><pre class="m-code"><span class="k">auto</span> <span class="nf">resolve_sth</span><span class="p">()</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cti</span><span class="o">::</span><span class="n">make_continuable</span><span class="o"><</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="p">,</span> <span class="kt">float</span><span class="p">,</span> <span class="kt">char</span><span class="o">></span><span class="p">(</span>
|
||||
<span class="p">[](</span><span class="k">auto</span><span class="o">&&</span> <span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">promise</span><span class="p">.</span><span class="n">set_value</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mf">2.f</span><span class="p">,</span> <span class="sc">'3'</span><span class="p">);</span>
|
||||
<span class="p">});</span></pre><aside class="m-note m-danger"><h4>Warning</h4><p>A <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> is only usable once and thus invalidated after it was resolved!</p></aside><p>A <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> always exposes a call operator for resolving it as like when using <a href="classcti_1_1promise__base.html#a223d666944a70441b3837b461b1094c7" class="m-dox">promise_base::<wbr />set_value</a> or <a href="classcti_1_1promise__base.html#a449356e97645d44cf4194932cc2006d7" class="m-dox">promise_base::<wbr />set_exception</a>. See <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> for details.</p><aside class="m-note m-info"><h4>Note</h4><p>In order to make proper use of a <a href="classcti_1_1promise__base.html" class="m-dox">promise_<wbr />base</a> you should move it around, store it for later use and resolve it when the asynchronous task was finished or rejected.</p></aside></section><section id="tutorial-creating-continuables-invocation"><h2><a href="#tutorial-creating-continuables-invocation">The continuable invocation model</a></h2><p>An asynchronous call hierarchy that is stored inside the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is executed when its result is requested (lazy evaluation) in contrast to other commonly used implementations such as <code>std::future</code> which execute the asynchronous call hierarchy instantly on creation (eager evaluation).</p><p>The lazy evaluation strategy used by continuables has many benefits over eager evaluation that is used by other common implementations:</p><ul><li>prevention of side effects</li><li>evasion of race conditions</li><li>ensured deterministic behaviour.</li></ul><p>The asynchronous call hierarchy is started when the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is destructed or the <a href="classcti_1_1continuable__base.html#a26ca692e597ebd8beff7d58d8bf584f4" class="m-dox">continuable_base::<wbr />done</a> method is called. It is possible to disable the automatic start through calling <a href="classcti_1_1continuable__base.html#a3c8d7fefc2f65fcd474c99d821809d24" class="m-dox">continuable_base::<wbr />freeze</a> on the corresponding <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p><aside class="m-note m-warning"><h4>Attention</h4><p>A <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> is not designed to be stored permanently, make sure you call <a href="classcti_1_1continuable__base.html#a3c8d7fefc2f65fcd474c99d821809d24" class="m-dox">continuable_base::<wbr />freeze</a> before storing it and start the continuation chain later through calling <a href="classcti_1_1continuable__base.html#a26ca692e597ebd8beff7d58d8bf584f4" class="m-dox">continuable_base::<wbr />done</a>.</p></aside></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>
|
||||
204
tutorial-promisify-continuables.html
Normal file
204
tutorial-promisify-continuables.html
Normal file
@ -0,0 +1,204 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Tutorial » Promisify functions | 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" id="m-navbar-current">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>
|
||||
<span class="m-breadcrumb"><a href="tutorial.html">Tutorial</a> »</span>
|
||||
|
||||
Promisify functions
|
||||
</h1>
|
||||
|
||||
<p>Explains how to promisify callback taking functions into a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li><a href="#tutorial-promisify-continuables-promisify">Promisification and continuables</a></li>
|
||||
<li><a href="#tutorial-promisify-continuables-boost">Promisify boost::asio</a></li>
|
||||
<li><a href="#tutorial-promisify-continuables-boost-ct">asio and boost::asio async completion tokens</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="tutorial-promisify-continuables-promisify"><h2><a href="#tutorial-promisify-continuables-promisify">Promisification and continuables</a></h2><p>The promisification has a longer history in the JavaScript world where the legacy way of asynchronous programming was the usage of callbacks of the form <code class="m-code"><span class="kd">function</span><span class="p">(</span><span class="nx">error</span><span class="p">,</span> <span class="nx">result</span><span class="p">...)</span></code>. The ideal way of dealing with such an asynchronous result is to return a promise and soon utility helpers were provided to do so.</p><p>The usage of callbacks to represent an asynchronous result is still a popular way nowadays. Thus the library provides the <a href="classcti_1_1promisify.html" class="m-dox">promisify</a> helper class which makes it possible to convert callback taking functions of various styles into one that returns a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> instead.</p><aside class="m-note m-info"><h4>Note</h4><p>Providing promisified APIs for other popular libraries is out of scope for this library. However contributions are highly welcome to add more conversion helpers for other commonly used callback styles.</p></aside></section><section id="tutorial-promisify-continuables-boost"><h2><a href="#tutorial-promisify-continuables-boost">Promisify boost::asio</a></h2><p>The default callback style is something like <code class="m-code"><span class="kd">function</span><span class="p">(</span><span class="nx">error</span><span class="p">,</span> <span class="nx">result</span><span class="p">...)</span></code> as described above. Continuable offers the <a href="classcti_1_1promisify.html#a28834d45efa0e6d2e22771cdd38e33a4" class="m-dox">promisify::<wbr />from</a> method for such callback styles.</p><p>See an example of how to promisify boost asio's <code>async_resolve</code> below:</p><pre class="m-code"><span class="k">auto</span> <span class="nf">async_resolve</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">host</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">service</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">cti</span><span class="o">::</span><span class="n">promisify</span><span class="o"><</span><span class="n">asio</span><span class="o">::</span><span class="n">ip</span><span class="o">::</span><span class="n">udp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span><span class="o">>::</span><span class="n">from</span><span class="p">(</span>
|
||||
<span class="p">[</span><span class="o">&</span><span class="p">](</span><span class="k">auto</span><span class="o">&&</span><span class="p">...</span> <span class="n">args</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">resolver_</span><span class="p">.</span><span class="n">async_resolve</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">forward</span><span class="o"><</span><span class="k">decltype</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="o">></span><span class="p">(</span><span class="n">args</span><span class="p">)...);</span>
|
||||
<span class="p">},</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">host</span><span class="p">),</span> <span class="n">std</span><span class="o">::</span><span class="n">move</span><span class="p">(</span><span class="n">service</span><span class="p">));</span>
|
||||
<span class="p">}</span></pre><p>Then it should be possible to use <code>asio::async_resolve</code> like this:</p><pre class="m-code"><span class="n">async_resolve</span><span class="p">(</span><span class="s">"127.0.0.1"</span><span class="p">,</span> <span class="s">"daytime"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">udp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span> <span class="n">iterator</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre></section><section id="tutorial-promisify-continuables-boost-ct"><h2><a href="#tutorial-promisify-continuables-boost-ct">asio and boost::asio async completion tokens</a></h2><p>Since version 4.0.0 continuable also supports asio async initiation tokens.</p><ul><li>Boost 1.70 or asio 1.13.0 is required for the async initiation</li><li>Until boost 1.72 or asio 1.16.0 overhead through an additional type erasure is added. It is recommended to update to those versions.</li></ul><p>The special static variable <a href="namespacecti.html#a0e7f3cb9a77364e61bb38b13007ee10f" class="m-dox">cti::<wbr />use_continuable</a> can be appended to any (boost) asio function that accepts a callback to make it return a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</p><pre class="m-code"><span class="cp">#include</span> <span class="cpf"><continuable/continuable.hpp></span><span class="cp"></span>
|
||||
<span class="cp">#include</span> <span class="cpf"><continuable/external/asio.hpp></span><span class="cp"></span>
|
||||
<span class="cp">#include</span> <span class="cpf"><asio.hpp></span><span class="cp"></span>
|
||||
|
||||
<span class="c1">// ...</span>
|
||||
|
||||
<span class="n">asio</span><span class="o">::</span><span class="n">tcp</span><span class="o">::</span><span class="n">resolver</span> <span class="n">resolver</span><span class="p">(...);</span>
|
||||
<span class="n">resolver</span><span class="p">.</span><span class="n">async_resolve</span><span class="p">(</span><span class="s">"127.0.0.1"</span><span class="p">,</span> <span class="s">"daytime"</span><span class="p">,</span> <span class="n">cti</span><span class="o">::</span><span class="n">use_continuable</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">asio</span><span class="o">::</span><span class="n">udp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span> <span class="n">iterator</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// ...</span>
|
||||
<span class="p">});</span></pre></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>
|
||||
200
tutorial-transforming-continuables.html
Normal file
200
tutorial-transforming-continuables.html
Normal file
@ -0,0 +1,200 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Tutorial » Transforming continuables | 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" id="m-navbar-current">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>
|
||||
<span class="m-breadcrumb"><a href="tutorial.html">Tutorial</a> »</span>
|
||||
|
||||
Transforming continuables
|
||||
</h1>
|
||||
|
||||
<p>Explains the conversion into other types such as <code>std::future</code>.</p>
|
||||
<div class="m-block m-default">
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li><a href="#tutorial-transforming-continuables-transforms">Transforms in general</a></li>
|
||||
<li><a href="#tutorial-transforming-continuables-wait">Synchronous wait</a></li>
|
||||
<li><a href="#tutorial-transforming-continuables-future">Conversion into std::future</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<section id="tutorial-transforming-continuables-transforms"><h2><a href="#tutorial-transforming-continuables-transforms">Transforms in general</a></h2><p>Sometimes it's required to change a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> object by its whole. Thus the library offers the ability to apply a transformation to any <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> through using <a href="classcti_1_1continuable__base.html#abcf4cf105aa17826bcc3c2278f6ea1b5" class="m-dox">apply</a>.</p><p>A transformation is a callable object that accepts a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> and returns an arbitrary object</p><p>The library provides several transforms already as part of the <a href="namespacecti_1_1transforms.html" class="m-dox">cti::<wbr />transforms</a> namespace.</p></section><section id="tutorial-transforming-continuables-wait"><h2><a href="#tutorial-transforming-continuables-wait">Synchronous wait</a></h2><p>The library is capable of converting every asynchronous control flow into a synchronous one through <a href="namespacecti_1_1transforms.html#a087d7b1c359b9f7d4a89d201d8493416" class="m-dox">transforms::<wbr />wait</a>, <a href="namespacecti_1_1transforms.html#a46d91cdd1e5153ca4a7f42fda616dd34" class="m-dox">transforms::<wbr />wait_for</a> and <a href="namespacecti_1_1transforms.html#aad924bf66494a6bb199192d7af2b8aea" class="m-dox">transforms::<wbr />wait_until</a>.</p><pre class="m-code"><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">response</span> <span class="o">=</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">apply</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">transforms</span><span class="o">::</span><span class="n">wait</span><span class="p">());</span>
|
||||
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">response</span> <span class="o">=</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">apply</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">transforms</span><span class="o">::</span><span class="n">wait_for</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">chrono</span><span class="o">::</span><span class="n">seconds</span><span class="p">(</span><span class="mi">5</span><span class="p">)));</span>
|
||||
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">response</span> <span class="o">=</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">apply</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">transforms</span><span class="o">::</span><span class="n">wait_until</span><span class="p">(...));</span></pre><p>The current thread will be blocked until the result has arrived</p></section><section id="tutorial-transforming-continuables-future"><h2><a href="#tutorial-transforming-continuables-future">Conversion into std::future</a></h2><p>The library is capable of converting (<em>futurizing</em>) every continuable into a fitting <code>std::future</code> through the <a href="namespacecti_1_1transforms.html#a4b98e7d3680486c926b64cd07a6adadb" class="m-dox">transforms::<wbr />to_future</a> transform:</p><pre class="m-code"><span class="n">std</span><span class="o">::</span><span class="n">future</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">future</span> <span class="o">=</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"github.com"</span><span class="p">)</span>
|
||||
<span class="p">.</span><span class="n">then</span><span class="p">([](</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">response</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="c1">// Do sth...</span>
|
||||
<span class="k">return</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"travis-ci.org"</span><span class="p">)</span> <span class="o">||</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">);</span>
|
||||
<span class="p">})</span>
|
||||
<span class="p">.</span><span class="n">apply</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">transforms</span><span class="o">::</span><span class="n">to_future</span><span class="p">());</span>
|
||||
<span class="c1">// ^^^^^^^^</span></pre><p>Multiple arguments which can't be handled by <code>std::future</code> itself are converted into <code>std::tuple</code>, see <a href="namespacecti_1_1transforms.html#a4b98e7d3680486c926b64cd07a6adadb" class="m-dox">transforms::<wbr />to_future</a> for details.</p><pre class="m-code"><span class="n">std</span><span class="o">::</span><span class="n">future</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">tuple</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">>></span> <span class="n">future</span> <span class="o">=</span>
|
||||
<span class="p">(</span><span class="n">http_request</span><span class="p">(</span><span class="s">"travis-ci.org"</span><span class="p">)</span> <span class="o">&&</span> <span class="n">http_request</span><span class="p">(</span><span class="s">"atom.io"</span><span class="p">))</span>
|
||||
<span class="p">.</span><span class="n">apply</span><span class="p">(</span><span class="n">cti</span><span class="o">::</span><span class="n">transforms</span><span class="o">::</span><span class="n">to_future</span><span class="p">());</span></pre></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>
|
||||
175
tutorial.html
Normal file
175
tutorial.html
Normal file
@ -0,0 +1,175 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<title>Tutorial | 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" id="m-navbar-current">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" id="m-navbar-current">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>
|
||||
Tutorial
|
||||
</h1>
|
||||
|
||||
<p>An introduction for using the continuable library.</p>
|
||||
<p>This tutorial will give a short overview about using the library. We assume that the library is available in your current environment, if not, follow the <a href="installation.html" class="m-dox">Installation</a> section in order to get it to work.</p><p>This tutorial is split across multiple chapters which should be read in order:</p><ul><li><a href="tutorial-creating-continuables.html" class="m-dox">Creating continuables</a> — Explains how to create a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</li><li><a href="tutorial-chaining-continuables.html" class="m-dox">Chaining continuables</a> — Explains how to chain multiple <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects together.</li><li><a href="tutorial-connecting-continuables.html" class="m-dox">Connecting continuables</a> — Explains how to connect various <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> objects together.</li><li><a href="tutorial-transforming-continuables.html" class="m-dox">Transforming continuables</a> — Explains the conversion into other types such as <code>std::future</code>.</li><li><a href="tutorial-awaiting-continuables.html" class="m-dox">Awaiting continuables</a> — Explains how to use the <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a> together with <code>co_await</code>.</li><li><a href="tutorial-promisify-continuables.html" class="m-dox">Promisify functions</a> — Explains how to promisify callback taking functions into a <a href="classcti_1_1continuable__base.html" class="m-dox">continuable_<wbr />base</a>.</li></ul>
|
||||
</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>
|
||||
Loading…
x
Reference in New Issue
Block a user