diff --git a/src/steam/engine/exit-node.hpp b/src/steam/engine/exit-node.hpp index 3460335ca..aea5a412d 100644 --- a/src/steam/engine/exit-node.hpp +++ b/src/steam/engine/exit-node.hpp @@ -33,8 +33,9 @@ #include "lib/error.hpp" #include "lib/nocopy.hpp" #include "lib/hash-value.h" +#include "lib/iter-adapter-stl.hpp" -#include +#include using lib::HashVal; @@ -43,7 +44,7 @@ namespace steam { namespace engine { class ExitNode; - using ExitNodes = std::vector; + using ExitNodes = std::deque; @@ -55,7 +56,7 @@ namespace engine { * remains still to be settled. So this is a placeholder to support mock testing for now. */ class ExitNode - : util::NonCopyable + : util::MoveOnly { HashVal pipelineIdentity_; //////////////////////////////////////////////////////////TICKET #1293 : Hash-Chaining for invocation-ID... derive from ProcNode wiring ExitNodes prerequisites_; ///////////////////////////////////////////////////////////TICKET #1306 : actual access to low-level-Model (ProcNode) @@ -66,7 +67,25 @@ namespace engine { , prerequisites_{} { } + ExitNode (HashVal id, ExitNodes&& prereq =ExitNodes{}) + : pipelineIdentity_{id} + , prerequisites_{std::move (prereq)} + { } + static ExitNode NIL; + + + HashVal + getPipelineIdentity() const + { + return pipelineIdentity_; + } + + auto + getPrerequisites() const + { + return lib::iter_stl::eachElm (prerequisites_); + } }; diff --git a/src/steam/mobject/builder/fixture-change-detector.hpp b/src/steam/fixture/fixture-change-detector.hpp similarity index 91% rename from src/steam/mobject/builder/fixture-change-detector.hpp rename to src/steam/fixture/fixture-change-detector.hpp index b160a4566..13ac4bf64 100644 --- a/src/steam/mobject/builder/fixture-change-detector.hpp +++ b/src/steam/fixture/fixture-change-detector.hpp @@ -40,8 +40,8 @@ */ -#ifndef STEAM_MOBJECT_BUILDER_FIXTURE_CHANGE_DETECTOR_H -#define STEAM_MOBJECT_BUILDER_FIXTURE_CHANGE_DETECTOR_H +#ifndef STEAM_FIXTURE_FIXTURE_CHANGE_DETECTOR_H +#define STEAM_FIXTURE_FIXTURE_CHANGE_DETECTOR_H #include "lib/error.hpp" //#include "lib/optional-ref.hpp" @@ -51,9 +51,8 @@ //#include -namespace steam { -namespace mobject { -namespace builder { +namespace steam { +namespace fixture { using asset::ID; using asset::Pipe; @@ -78,5 +77,5 @@ namespace builder { -}}} // namespace steam::mobject::builder -#endif +}} // namespace steam::fixture +#endif /*STEAM_FIXTURE_FIXTURE_CHANGE_DETECTOR_H*/ diff --git a/src/steam/mobject/builder/model-port-registry.cpp b/src/steam/fixture/model-port-registry.cpp similarity index 93% rename from src/steam/mobject/builder/model-port-registry.cpp rename to src/steam/fixture/model-port-registry.cpp index 71273770a..903684b35 100644 --- a/src/steam/mobject/builder/model-port-registry.cpp +++ b/src/steam/fixture/model-port-registry.cpp @@ -41,17 +41,20 @@ #include "lib/sync-classlock.hpp" #include "steam/mobject/builderfacade.hpp" #include "steam/mobject/model-port.hpp" -#include "steam/mobject/builder/model-port-registry.hpp" +#include "steam/fixture/model-port-registry.hpp" namespace steam { -namespace mobject { - namespace builder { +namespace fixture { namespace error = lumiera::error; + using mobject::LUMIERA_ERROR_BUILDER_LIFECYCLE; + using mobject::LUMIERA_ERROR_INVALID_MODEL_PORT; + using mobject::LUMIERA_ERROR_UNCONNECTED_MODEL_PORT; - typedef ModelPortRegistry::ModelPortDescriptor const& MPDescriptor; - typedef lib::ClassLock LockRegistry; + + using MPDescriptor = ModelPortRegistry::ModelPortDescriptor const&; + using LockRegistry = lib::ClassLock; /** storage for the link to the global @@ -238,10 +241,10 @@ namespace mobject { LUMIERA_ERROR_DEFINE (DUPLICATE_MODEL_PORT, "Attempt to define a new model port with an pipe-ID already denoting an existing port"); - }// namespace builder - - - +}// namespace fixture + + +namespace mobject { LUMIERA_ERROR_DEFINE (INVALID_MODEL_PORT, "Referral to unknown model port"); LUMIERA_ERROR_DEFINE (UNCONNECTED_MODEL_PORT, "Attempt to operate on an existing but unconnected model port"); @@ -250,7 +253,7 @@ namespace mobject { ModelPort::ModelPort (ID refID) : id_(refID) { - builder::ModelPortRegistry::accessDescriptor (refID); + fixture::ModelPortRegistry::accessDescriptor (refID); } @@ -259,7 +262,7 @@ namespace mobject { bool ModelPort::exists (ID key) { - return builder::ModelPortRegistry::globalInstance().isRegistered (key); + return fixture::ModelPortRegistry::globalInstance().isRegistered (key); } @@ -270,9 +273,9 @@ namespace mobject { ID ModelPort::pipe() const { - ENSURE (this->id_ == builder::ModelPortRegistry::accessDescriptor(this->id_).id()); + ENSURE (this->id_ == fixture::ModelPortRegistry::accessDescriptor(this->id_).id()); - return builder::ModelPortRegistry::accessDescriptor(this->id_).id(); + return fixture::ModelPortRegistry::accessDescriptor(this->id_).id(); } @@ -283,7 +286,7 @@ namespace mobject { ID ModelPort::holder() const { - return builder::ModelPortRegistry::accessDescriptor(this->id_).holder(); + return fixture::ModelPortRegistry::accessDescriptor(this->id_).holder(); } diff --git a/src/steam/mobject/builder/model-port-registry.hpp b/src/steam/fixture/model-port-registry.hpp similarity index 96% rename from src/steam/mobject/builder/model-port-registry.hpp rename to src/steam/fixture/model-port-registry.hpp index 9063d18cb..e9a7b9074 100644 --- a/src/steam/mobject/builder/model-port-registry.hpp +++ b/src/steam/fixture/model-port-registry.hpp @@ -46,8 +46,8 @@ */ -#ifndef STEAM_MOBJECT_BUILDER_MODEL_PORT_REGISTRY_H -#define STEAM_MOBJECT_BUILDER_MODEL_PORT_REGISTRY_H +#ifndef STEAM_FIXTURE_MODEL_PORT_REGISTRY_H +#define STEAM_FIXTURE_MODEL_PORT_REGISTRY_H #include "lib/error.hpp" #include "lib/optional-ref.hpp" @@ -58,8 +58,7 @@ #include namespace steam { -namespace mobject { -namespace builder { +namespace fixture { using asset::ID; using asset::Pipe; @@ -178,5 +177,5 @@ namespace builder { -}}} // namespace steam::mobject::builder -#endif +}} // namespace steam::fixture +#endif /*STEAM_FIXTURE_MODEL_PORT_REGISTRY_H*/ diff --git a/src/steam/fixture/node-graph-attachment.hpp b/src/steam/fixture/node-graph-attachment.hpp index d0e2d5c43..257f3e568 100644 --- a/src/steam/fixture/node-graph-attachment.hpp +++ b/src/steam/fixture/node-graph-attachment.hpp @@ -44,7 +44,8 @@ namespace steam { namespace fixture { - using ExitNodes = engine::ExitNodes; + using engine::ExitNode; + using engine::ExitNodes; /** @@ -69,6 +70,13 @@ namespace fixture { { } // default copy acceptable + + ExitNode const& + operator[] (size_t idx) const + { + return idx < exitNodes_.size()? exitNodes_[idx] + : ExitNode::NIL; + } }; diff --git a/tests/43session.tests b/tests/43session.tests index 9713a2cc3..b2864ca66 100644 --- a/tests/43session.tests +++ b/tests/43session.tests @@ -33,6 +33,11 @@ return: 0 END +TEST "Output pipe mapping" OutputMapping_test < PID; - typedef asset::ID TID; + using PID = asset::ID; + using TID = asset::ID; - typedef ModelPortRegistry::ModelPortDescriptor const& MPDescriptor; + using MPDescriptor = ModelPortRegistry::ModelPortDescriptor const&; + + using mobject::LUMIERA_ERROR_INVALID_MODEL_PORT; + using mobject::LUMIERA_ERROR_UNCONNECTED_MODEL_PORT; namespace { // test environment @@ -274,8 +277,8 @@ namespace test { /** Register this test class... */ - LAUNCHER (ModelPortRegistry_test, "unit session builder"); + LAUNCHER (ModelPortRegistry_test, "unit fixture session builder"); -}}}} // namespace steam::mobject::builder::test +}}} // namespace steam::fixture::test diff --git a/tests/core/steam/fixture/node-graph-attachment-test.cpp b/tests/core/steam/fixture/node-graph-attachment-test.cpp new file mode 100644 index 000000000..f0a28d348 --- /dev/null +++ b/tests/core/steam/fixture/node-graph-attachment-test.cpp @@ -0,0 +1,155 @@ +/* + NodeGraphAttachment(Test) - verify link from fixture to low-level-model + + Copyright (C) Lumiera.org + 2023, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + +/** @file node-graph-attachment-test.cpp + ** unit test \ref NodeGraphAttachment_test + */ + + +#include "lib/test/run.hpp" +//#include "lib/test/test-helper.hpp" +#include "steam/fixture/node-graph-attachment.hpp" +#include "steam/engine/exit-node.hpp" +#include "steam/engine/mock-dispatcher.hpp" +#include "lib/util.hpp" + +#include + + +namespace steam { +namespace fixture { +namespace test { + +// using util::isSameObject; + using std::move; + using util::isnil; +// +// using asset::Pipe; +// using asset::PPipe; +// using asset::Struct; +// using asset::Timeline; +// using asset::PTimeline; +// using lumiera::Query; + using engine::ExitNode; +// +// typedef asset::ID PID; +// typedef asset::ID TID; +// +// typedef ModelPortRegistry::ModelPortDescriptor const& MPDescriptor; + + + namespace { // test environment + + } + + + + + /*****************************************************************************//** + * @test Verify the facade object used to connect from the Segments in the Fixture + * into the actual render nodes network + * @see mobject::builder::FixtureChangeDetector + */ + class NodeGraphAttachment_test : public Test + { + + virtual void + run (Arg) + { + access_ExitNode(); + fabricate_MockExitNode(); + } + + + /** @test access to ExitNode and fall back on ExitNode::NIL when undefined + * - verify ExitNode::NIL + * - build a simple ExitNode without prerequisites + * - use this as prerequisite(s) for another ExitNode + * - put a third ExitNode(id=13) also into the same collection + * - use this to construct a NodeGraphAttachment + * - access existing and non-existing index positions + */ + void + access_ExitNode() + { + CHECK (0 == ExitNode::NIL.getPipelineIdentity()); + CHECK (isnil (ExitNode::NIL.getPrerequisites())); + + ExitNodes subDead; + subDead.emplace_back(55); + CHECK (55 == subDead[0].getPipelineIdentity()); + CHECK (isnil (subDead[0].getPrerequisites())); + + ExitNodes superDead; + superDead.emplace_back(23, move (subDead)); + superDead.emplace_front(13); + CHECK (13 == superDead[0].getPipelineIdentity()); + CHECK (23 == superDead[1].getPipelineIdentity()); + CHECK (not isnil (superDead[1].getPrerequisites())); + CHECK (55 == superDead[1].getPrerequisites()->getPipelineIdentity()); + + NodeGraphAttachment succubus{move (superDead)}; + CHECK (13 == succubus[0].getPipelineIdentity()); + CHECK (23 == succubus[1].getPipelineIdentity()); + CHECK (55 == succubus[1].getPrerequisites()->getPipelineIdentity()); + } + + + /** @test setup a properly structured ExitNode graph using the + * specification scheme supported by MockSegmentation + */ + void + fabricate_MockExitNode() + { + using lib::diff::MakeRec; + + engine::test::MockSegmentation builder; + ExitNode incubus = + builder.buildExitNodeFromSpec(MakeRec() + .attrib("mark", 13) + .scope(MakeRec() + .attrib("mark",23) + .genNode() + ,MakeRec() + .attrib("mark",55) + .genNode() + ) + .genNode()); + + CHECK (13 == incubus.getPipelineIdentity()); + auto feed = incubus.getPrerequisites(); + CHECK (not isnil (feed)); + CHECK (23 == feed->getPipelineIdentity()); + ++feed; + CHECK (55 == feed->getPipelineIdentity()); + ++feed; + CHECK (isnil (feed)); + } + }; + + + /** Register this test class... */ + LAUNCHER (NodeGraphAttachment_test, "unit fixture"); + + + +}}} // namespace steam::fixture::test diff --git a/tests/core/steam/mobject/builder/segmentation-datastructure-test.cpp b/tests/core/steam/fixture/segmentation-datastructure-test.cpp similarity index 92% rename from tests/core/steam/mobject/builder/segmentation-datastructure-test.cpp rename to tests/core/steam/fixture/segmentation-datastructure-test.cpp index 7d232f172..4c89888aa 100644 --- a/tests/core/steam/mobject/builder/segmentation-datastructure-test.cpp +++ b/tests/core/steam/fixture/segmentation-datastructure-test.cpp @@ -27,7 +27,7 @@ #include "lib/test/run.hpp" #include "lib/test/test-helper.hpp" -#include "steam/mobject/builder/fixture-change-detector.hpp" +#include "steam/fixture/fixture-change-detector.hpp" #include "steam/asset/timeline.hpp" #include "steam/asset/pipe.hpp" #include "common/query.hpp" @@ -35,8 +35,7 @@ namespace steam { -namespace mobject { -namespace builder { +namespace fixture { namespace test { // using util::isSameObject; @@ -111,8 +110,8 @@ namespace test { /** Register this test class... */ - LAUNCHER (SegmentationDatastructure_test, "unit builder"); + LAUNCHER (SegmentationDatastructure_test, "unit fixture"); -}}}} // namespace steam::mobject::builder::test +}}} // namespace steam::fixture::test diff --git a/tests/core/steam/mobject/output-mapping-test.cpp b/tests/core/steam/mobject/session/output-mapping-test.cpp similarity index 98% rename from tests/core/steam/mobject/output-mapping-test.cpp rename to tests/core/steam/mobject/session/output-mapping-test.cpp index 2a7d5baf6..28b00ca6a 100644 --- a/tests/core/steam/mobject/output-mapping-test.cpp +++ b/tests/core/steam/mobject/session/output-mapping-test.cpp @@ -45,6 +45,7 @@ namespace test { using asset::Pipe; using asset::PPipe; + using mobject::OutputMapping; typedef asset::ID PID; @@ -180,7 +181,7 @@ namespace test { /** Register this test class... */ - LAUNCHER (OutputMapping_test, "unit session builder"); + LAUNCHER (OutputMapping_test, "unit session"); diff --git a/tests/core/steam/play/dummy-builder-context.hpp b/tests/core/steam/play/dummy-builder-context.hpp index 2a429a25e..44fb91d93 100644 --- a/tests/core/steam/play/dummy-builder-context.hpp +++ b/tests/core/steam/play/dummy-builder-context.hpp @@ -48,7 +48,7 @@ #include "steam/mobject/model-port.hpp" -#include "steam/mobject/builder/model-port-registry.hpp" +#include "steam/fixture/model-port-registry.hpp" #include "steam/play/output-slot-connection.hpp" #include "steam/play/output-manager.hpp" #include "steam/asset/timeline.hpp" @@ -66,6 +66,8 @@ namespace steam{ namespace play { namespace test { + using fixture::ModelPortRegistry; + /** * @todo 5/2023 quick-n-dirty placeholder to be able to fabricate fake DataSink handles (`Handle`) @@ -92,7 +94,7 @@ namespace test { using asset::Timeline; using asset::PTimeline; using mobject::ModelPort; - using mobject::builder::ModelPortRegistry; + using fixture::ModelPortRegistry; using util::contains; using lumiera::Query; diff --git a/tests/core/steam/play/dummy-play-connection-test.cpp b/tests/core/steam/play/dummy-play-connection-test.cpp index 2d38150c4..12d674361 100644 --- a/tests/core/steam/play/dummy-play-connection-test.cpp +++ b/tests/core/steam/play/dummy-play-connection-test.cpp @@ -101,7 +101,7 @@ namespace test { /** Register this test class... */ - LAUNCHER (DummyPlayConnection_test, "unit player"); + LAUNCHER (DummyPlayConnection_test, "unit play"); diff --git a/tests/core/steam/play/output-slot-protocol-test.cpp b/tests/core/steam/play/output-slot-protocol-test.cpp index 165fb22b9..ef9249244 100644 --- a/tests/core/steam/play/output-slot-protocol-test.cpp +++ b/tests/core/steam/play/output-slot-protocol-test.cpp @@ -132,7 +132,7 @@ namespace test { /** Register this test class... */ - LAUNCHER (OutputSlotProtocol_test, "unit player"); + LAUNCHER (OutputSlotProtocol_test, "unit play"); diff --git a/tests/core/steam/play/timing-constraints-test.cpp b/tests/core/steam/play/timing-constraints-test.cpp index f225f2db0..6e7b2fd22 100644 --- a/tests/core/steam/play/timing-constraints-test.cpp +++ b/tests/core/steam/play/timing-constraints-test.cpp @@ -85,7 +85,7 @@ namespace test { /** Register this test class... */ - LAUNCHER (TimingConstraints_test, "unit player"); + LAUNCHER (TimingConstraints_test, "unit play"); diff --git a/tests/core/steam/mobject/controller/render-segment-test.cpp b/tests/core/steam/render-segment-test.cpp similarity index 92% rename from tests/core/steam/mobject/controller/render-segment-test.cpp rename to tests/core/steam/render-segment-test.cpp index 8efe9340e..7e5add18f 100644 --- a/tests/core/steam/mobject/controller/render-segment-test.cpp +++ b/tests/core/steam/render-segment-test.cpp @@ -32,8 +32,6 @@ namespace steam { -namespace mobject { -namespace controller { namespace test { @@ -59,8 +57,8 @@ namespace test { /** Register this test class... */ - LAUNCHER (RenderSegment_test, "function operate"); + LAUNCHER (RenderSegment_test, "function integration"); -}}}} // namespace steam::mobject::controller::test +}} // namespace steam::test diff --git a/tests/core/vault/media-access-mock-test.cpp b/tests/core/vault/media-access-mock-test.cpp index 372165b7c..56b45a8d0 100644 --- a/tests/core/vault/media-access-mock-test.cpp +++ b/tests/core/vault/media-access-mock-test.cpp @@ -88,7 +88,7 @@ namespace test { /** Register this test class... */ - LAUNCHER (MediaAccessMock_test, "unit operate"); + LAUNCHER (MediaAccessMock_test, "unit integration"); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index f57741424..cc4a4fc80 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -74096,18 +74096,25 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + - + - + + + + - + + - - + + + + + @@ -74140,6 +74147,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
+ @@ -74150,20 +74158,109 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - - - + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ und das heißt im Klartext: std::deque — später kombiniert mit einem custom-Allocator, der auf den AllocationCluster delegiert +

+ +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ bisherige Mock-Lösung
nun darauf aufsetzen +

+ +
+ + + + + +

+ nach dem ersten Schreck (weil ich es doch grade erst neu programmiert hatte...) zeigt sich, daß die bisherige Mock-Implementierung bereits sehr gut ist, und strukturell direkt in die endgültige Implementierung übersetzt werden kann; wir machen dann lediglich zweimal eine strukturgleiche rekursive Verarbeitung (GenNode ⟼ ExitNode-Struktur sowie dann ExitNode-Struktur ⟼ JobTicket) +

+ +
+ +
@@ -74743,8 +74840,8 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- +