Skip to content

Commit 8837528

Browse files
authored
Merge pull request #40 from dietmarkuehl/HEAD
started to work on documenting queries
2 parents 7ce40de + 9f86ed1 commit 8837528

File tree

1 file changed

+41
-19
lines changed

1 file changed

+41
-19
lines changed

docs/overview.md

+41-19
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Required members for <code>_Token_</code>:
252252
- <code>std::copyable&lt;_Token_&gt;</code>
253253
- <code>std::equality_comparable&lt;_Token_&gt;</code>
254254
- <code>std::swapable&lt;_Token_&gt;</code>
255-
<div>
255+
<blockquote>
256256
<details>
257257
<summary>Example: concept use</summary>
258258
<div>
@@ -266,7 +266,7 @@ static_assert(std::execution::unstoppable_token<std::execution::inline_stop_toke
266266
</details>
267267
<details>
268268
<summary>Example: polling</summary>
269-
<div>
269+
<blockquote>
270270
This example shows a sketch of using a <code>stoppable_token&lt;_Token_&gt;</code> to cancel an active operation. The computation in this example is represented as `sleep_for`.
271271
272272
```c++
@@ -278,11 +278,11 @@ void compute(std::stoppable_token auto token)
278278
}
279279
}
280280
```
281-
</div>
281+
</blockquote>
282282
</details>
283283
<details>
284284
<summary>Example: inactive</summary>
285-
<div>
285+
<blockquote>
286286
This example shows how an <code><a href=‘#operation-state’>operation_state</a></code> can use the <code>callback_type</code> together with a <code>_token_</code> to get notified when cancellation is requested.
287287

288288
```c++
@@ -319,7 +319,7 @@ struct example_state
319319
}
320320
auto stop() {
321321
unregister_work(this);
322-
if (this->outstanding == 0u)
322+
if (--this->outstanding == 0u)
323323
std::execution::set_stopped(std::move(this->receiver));
324324
}
325325
auto complete() {
@@ -330,14 +330,14 @@ struct example_state
330330
}
331331
};
332332
```
333-
</div>
333+
</blockquote>
334334
</details>
335-
</div>
335+
</blockquote>
336336
</details>
337337
<details>
338338
<summary><code>unstoppable_token&lt;_Token_&gt;</code></summary>
339339
The concept <code>unstoppable_token&lt;Token&gt;</code> is modeled by a <code>_Token_</code> if <code>stoppable_token&lt;_Token_&gt;</code> is true and it can statically be determined that both <code>_token_.stop_requested()</code> and <code>_token_.stop_possible()</code> are `constexpr` epxressions yielding `false`. This concept is primarily used to avoid extra work when using stop tokens which will never indicate that cancellations are requested.
340-
<div>
340+
<blockquote>
341341
<details>
342342
<summary>Example</summary>
343343
The concept yields `true` for the <code><a href=‘#never-stop-token’>std::execution::never_stop_token</a></code>:
@@ -348,21 +348,43 @@ static_assert(not std::execution::unstoppable_token<std::execution::stop_token>)
348348
static_assert(not std::execution::unstoppable_token<std::execution::inline_stop_token>);
349349
```
350350
</details>
351-
</div>
351+
</blockquote>
352352
</details>
353353

354354
## Queries
355+
The queries are used to obtain properties associated with and object. Except <code><a href=‘#forwarding-query’>forwarding_query</a></code> and <code><a href=‘#get-env’>get_env</a></code> the queries work on <a href=‘#environment’>environments</a>.
355356

356-
- <code>forwarding_query(<i>query</i>) -> bool</code>
357-
- <code>get_env(<i>queryable</i>)</code>
358-
- <code>get_allocator(<i>env</i>)</code>
359-
- <code>get_completion_scheduler(<i>env</i>)</code>
360-
- <code>get_completion_signatures(<i>sender</i>, <i>env</i>)</code>
361-
- <code>get_delegation_scheduler(<i>env</i>)</code>
362-
- <code>get_domain(<i>env</i>)</code>
363-
- <code>get_forward_progress_guarantee(<i>env</i>)</code>
364-
- <code>get_scheduler(<i>env</i>)</code>
365-
- <code>get_stop_token(<i>env</i>)</code>
357+
<details>
358+
<summary><code>forwarding_query(<i>query</i>) -> bool</code></summary>
359+
</details>
360+
<details>
361+
<summary><code>get_env(<i>queryable</i>)</code></summary>
362+
</details>
363+
<details>
364+
<summary><code>get_allocator(<i>env</i>)</code></summary>
365+
</details>
366+
<details>
367+
<summary><code>get_completion_scheduler(<i>env</i>)</code></summary>
368+
</details>
369+
<details>
370+
<summary><code>get_completion_signatures(<i>sender</i>, <i>env</i>)</code></summary>
371+
</details>
372+
<details>
373+
<summary><code>get_delegation_scheduler(<i>env</i>)</code></summary>
374+
</details>
375+
<details>
376+
<summary><code>get_domain(<i>env</i>)</code>
377+
</summary>
378+
</details>
379+
<details>
380+
<summary><code>get_forward_progress_guarantee(<i>env</i>)</code></summary>
381+
</details>
382+
<details>
383+
<summary><code>get_scheduler(<i>env</i>)</code></summary>
384+
</details>
385+
<details>
386+
<summary><code>get_stop_token(<i>env</i>)</code></summary>
387+
</details>
366388

367389
### Customization Point Objects
368390

0 commit comments

Comments
 (0)