From 3bd4305dabd04fa65485c2d14b1d2b8434983efa Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 29 Aug 2023 17:36:56 +0200 Subject: [PATCH] Activity-Lang: create standard wiring for CALC-Term --- src/vault/gear/activity-term.hpp | 56 +++++++++++++++++++++++++++++++- wiki/thinkPad.ichthyo.mm | 21 ++++++++---- 2 files changed, 70 insertions(+), 7 deletions(-) diff --git a/src/vault/gear/activity-term.hpp b/src/vault/gear/activity-term.hpp index 2c0530513..812c3c7e5 100644 --- a/src/vault/gear/activity-term.hpp +++ b/src/vault/gear/activity-term.hpp @@ -53,6 +53,7 @@ #include "lib/time/timevalue.hpp" //#include "lib/util.hpp" +//#include #include #include @@ -129,9 +130,24 @@ namespace gear { void configureTemplate (Template kind) { - + switch (kind) { + case CALC_JOB: + setupGate(); + insertWorkBracket(); + break; + case LOAD_JOB: + UNIMPLEMENTED ("wiring for async job"); + break; + case META_JOB: + /* use the minimal default wiring */ + break; + default: + NOTREACHED ("uncovered Activity verb in activation function."); + break; + } } + Activity* setupInvocation (Job& job) { @@ -153,6 +169,44 @@ namespace gear { { return & alloc_.create (start,after,followUp); } + + void + setupGate() + { + if (gate_) return; + gate_ = & alloc_.create (0, Time{post_->data_.timeWindow.dead}); + insert (post_, gate_); + } + + void + insertWorkBracket() + { + auto start = alloc_.create (Activity::WORKSTART); + auto stop = alloc_.create (Activity::WORKSTOP); + /////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1283 define the "quality" parameter to distinguish observable execution times + + insert (gate_? gate_: post_, &start); + insert (findTail (start.next), &stop); + } + + + static void + insert (Activity* anchor, Activity* target) + { + REQUIRE (anchor); + REQUIRE (target); + target->next = anchor->next; + anchor->next = target; + } + + static Activity* + findTail (Activity* chain) + { + REQUIRE (chain); + while (chain->next) + chain = chain->next; + return chain; + } }; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index ce7ecbf8f..8cba17418 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -80111,8 +80111,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + + @@ -80139,13 +80139,13 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - + + - - + + @@ -80168,12 +80168,21 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ + + + + + + + +