From f2244414aadf2f77ba233e41c92bf116b4bb352e Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 2 Sep 2026 01:48:51 +0200 Subject: [PATCH] Parameter: simple testcase PASS (see #1431) Add value access implementation of the Provision interface by direct cast and access to the embedded value in `ParamData`; obviously this is an indirect dispatch, based on the actual type `VAL` The test demonstrates the basic machinery built thus far - have an embedded container with inline storage - dispatch using type information encoded into the VTable --- src/lib/par/disposition.hpp | 20 +++++++++++++++++++ tests/16parameter.tests | 2 +- tests/lib/par/parameter-test.cpp | 3 ++- wiki/thinkPad.ichthyo.mm | 33 ++++++++++++++++++++++---------- 4 files changed, 46 insertions(+), 12 deletions(-) diff --git a/src/lib/par/disposition.hpp b/src/lib/par/disposition.hpp index 14b47c839..17301530a 100644 --- a/src/lib/par/disposition.hpp +++ b/src/lib/par/disposition.hpp @@ -68,6 +68,10 @@ namespace par { VAL val_; Provision* src_; + /* === Provision Interface === */ + void retrieveInto (ValBuff&) const override; + void setValFrom (ValBuff const&) override; + public: ParamData (VAL initVal) : val_{std::move (initVal)} @@ -80,6 +84,22 @@ namespace par { + template + void + ParamData::retrieveInto (ValBuff& target) const + { + asValue(target) = val_; + } + + template + void + ParamData::setValFrom (ValBuff const& newVal) + { + val_ = asValue(newVal); + } + + + template X Disposition::extract() const diff --git a/tests/16parameter.tests b/tests/16parameter.tests index 26060add7..4eeef4a77 100644 --- a/tests/16parameter.tests +++ b/tests/16parameter.tests @@ -2,7 +2,7 @@ TESTING "Library Test Suite: parameters" ./test-suite --group=param -PLANNED "Parameter Values" Parameter_test <().build(); CHECK (0 == par.getVal()); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 6a32c8eae..8eb9679e5 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -84522,13 +84522,14 @@ - + - + + @@ -84549,6 +84550,8 @@ + + @@ -84636,22 +84639,32 @@ + + + + + + + - - - - + + + + - - + + - - + + + + +