Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:toolworks:docs:apparatus:operating [2022/05/04 17:01] – vladius | en:toolworks:docs:apparatus:operating [2023/01/14 13:13] (current) – vladius | ||
---|---|---|---|
Line 7: | Line 7: | ||
==== Using a Lambda ==== | ==== Using a Lambda ==== | ||
- | You can easily operate on your chain via a C++ lambda and this is how you do it: | + | You can easily operate on your chain via a [[cpp> |
<code cpp> | <code cpp> | ||
Chain-> | Chain-> | ||
Line 44: | Line 44: | ||
available, excessive tasks not needed for that quantity won't be queued at all. | available, excessive tasks not needed for that quantity won't be queued at all. | ||
- | ==== Argument Delivery | + | ==== Dependency Injection |
One great thing about operating is that the function arguments are actually resolved | One great thing about operating is that the function arguments are actually resolved | ||
Line 95: | Line 95: | ||
Counter += Trait.Value; | Counter += Trait.Value; | ||
}); | }); | ||
+ | </ | ||
+ | |||
+ | ==== Direct Mechanism Operating ==== | ||
+ | |||
+ | The Operating simplification goes as far as actually Operating on a Mechanism directly, like so:<code cpp> | ||
+ | Mechanism-> | ||
+ | { | ||
+ | ... | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | This way the [[en: | ||
+ | |||
+ | You can of course supply the Filter specification explicitly, overriding it. | ||
+ | |||
+ | So for example, if you want to specify an additional [[en: | ||
+ | Mechanism-> | ||
+ | { | ||
+ | ... | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | The direct Operating mode is smart enough to deduce the type of the Chain used within the Operating process, so if you specify a reference to a Trait and/or a Solid Subject handle in your arguments list, the technique will essentially produce a [[en: | ||
+ | Mechanism-> | ||
+ | { | ||
+ | ... | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | You can still specify the Chain type explicitly as a first template argument to a method:< | ||
+ | Mechanism-> | ||
+ | { | ||
+ | // You logic within Solid semantics: | ||
+ | ... | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | Concurrency variants are also provided by the direct interface:< | ||
+ | Mechanism-> | ||
+ | { | ||
+ | ... | ||
+ | }, /*Maximum number of threads=*/ | ||
</ | </ |