diff --git a/doc/devel/uml/fig141445.png b/doc/devel/uml/fig141445.png index 46c0f22b6..7eab04117 100644 Binary files a/doc/devel/uml/fig141445.png and b/doc/devel/uml/fig141445.png differ diff --git a/doc/devel/uml/index.html b/doc/devel/uml/index.html index 6409f6544..2a066763e 100644 --- a/doc/devel/uml/index.html +++ b/doc/devel/uml/index.html @@ -147,7 +147,7 @@ Documentation
Artifact Lumiera

the main executable to be built

Depends on common

Depends on gui

Depends on proc

Depends on backend

Stereotype: executable

-

executable associated with : placement, sessionimpl, builderfacade, aframe, assembler, trafo, allocation, vframe, toolfactory, hub, buildable, abstractmo, exitnode, pathmanager, track, meta, fixedlocation, relativelocation, controllerfacade, rendergraph, pluginadapter, explicitplacement, auto, glrender, arender, renderstate, label, nodecreatertool, projector, interpolator, paramprovider, mask, mobject, source, frame, effect, buildertool, segmentationtool, link, parameter, renderengine, glbuf, procnode, stateproxy, edl, fixture, glpipe, main, conmanager, clip, vrender

+

executable associated with : explicitplacement, auto, glrender, arender, renderstate, label, nodecreatertool, projector, interpolator, paramprovider, mask, mobject, source, frame, effect, buildertool, segmentationtool, link, parameter, renderengine, glbuf, procnode, stateproxy, edl, fixture, glpipe, main, conmanager, clip, vrender, placement, sessionimpl, builderfacade, aframe, assembler, trafo, allocation, vframe, toolfactory, hub, buildable, abstractmo, exitnode, pathmanager, track, meta, fixedlocation, relativelocation, controllerfacade, rendergraph, pluginadapter

Artifact main

Stereotype: source

diff --git a/src/lib/advice.hpp b/src/lib/advice.hpp index 0ef5ede28..a91c27db0 100644 --- a/src/lib/advice.hpp +++ b/src/lib/advice.hpp @@ -171,7 +171,7 @@ namespace advice { protected: void publishProvision (PointOfAdvice*); void discardSolutions (); - void publishRequestBindingChange(); + void publishRequestBindingChange(HashVal); void registerRequest(); void deregisterRequest(); @@ -362,9 +362,9 @@ namespace advice { void defineBinding (Literal topic) { + HashVal previous_bindingKey (hash_value(*this)); setBindingPattern (Binding(topic).addTypeGuard()); - ////////////////////////////////////////////////////////////////////////////TODO: conceptual mismatch here! we don't have an "old entry", because we ourselves are the entry ;-) - publishRequestBindingChange(); + publishRequestBindingChange (previous_bindingKey); } }; diff --git a/src/lib/advice/advice.cpp b/src/lib/advice/advice.cpp index ba55fb30f..84c13de09 100644 --- a/src/lib/advice/advice.cpp +++ b/src/lib/advice/advice.cpp @@ -122,10 +122,9 @@ namespace advice { void - AdviceLink::publishRequestBindingChange() + AdviceLink::publishRequestBindingChange(HashVal previous_bindingKey) { - ////////////////////////////////////////////////////////////////////////////TODO: conceptual mismatch here! we don't have an "old entry", because we ourselves are the entry ;-) - UNIMPLEMENTED ("propagate binding change to index"); + aSys().modifyRequest(previous_bindingKey, *this); } diff --git a/src/lib/advice/index.hpp b/src/lib/advice/index.hpp index 0fa0f9201..7163e2731 100644 --- a/src/lib/advice/index.hpp +++ b/src/lib/advice/index.hpp @@ -136,6 +136,8 @@ namespace advice { * to the same memory location of a POA (point of advice). * Thus e.g. #hasProvision means this index holds an entry * pointing to exactly this given data entity. + * @note the implementation of modifying a Request entry + * explicitly relies on that definition of equality. * @note the diagnostic API is mainly intended for unit testing * and \em not implemented with focus on performance. */ @@ -339,21 +341,26 @@ namespace advice { provisionEntries_[key].publish_latest_solution (entry); } + /** @note explicitly relying on the implementation of \c == + * which checks only the memory location of the Request. + * Thus we can use the already modified Request to find + * the old entry within the index pointing to this Request. + * @param oKey the binding hash value prior to modification + */ void - modifyRequest (POA const& oldRef, POA& newEntry) + modifyRequest (HashVal oKey, POA& entry) { - HashVal oKey (hash_value(oldRef)); - HashVal nKey (hash_value(newEntry)); + HashVal nKey (hash_value(entry)); if (oKey != nKey) { - requestEntries_[oKey].remove (oldRef); - requestEntries_[nKey].append (newEntry); + requestEntries_[oKey].remove (entry); + requestEntries_[nKey].append (entry); } else - { - requestEntries_[nKey].overwrite (oldRef, newEntry); + { // rewrite Entry to include the new binding + requestEntries_[nKey].overwrite (entry, entry); } - provisionEntries_[nKey].publish_latest_solution (newEntry); + provisionEntries_[nKey].publish_latest_solution (entry); } void diff --git a/tests/lib/advice/advice-index-test.cpp b/tests/lib/advice/advice-index-test.cpp index 268089ddc..c098552c7 100644 --- a/tests/lib/advice/advice-index-test.cpp +++ b/tests/lib/advice/advice-index-test.cpp @@ -61,6 +61,12 @@ namespace test { return pattern_.matches (Binding(refSpec)); } + void + changeBinding (Literal newSpec) + { + pattern_ = Binding(newSpec).buildMatcher(); + } + /* == Adapter interface for use within the Index == */ @@ -342,19 +348,22 @@ namespace test { CHECK (_hasDefault (3)); CHECK (_hasDefault (5)); - CHECK (!idx.hasRequest (_entry (2,"cat"))); + HashVal dogHash (hash_value (_entry (5,"dog"))); + CHECK ( idx.hasRequest (_entry (5,"dog"))); + _entry (5,"dog").changeBinding("cat"); // transmogrify existing request into cat-request + CHECK (_hasDefault (5)); // of course this didn't change the solution + CHECK (!idx.hasRequest (_entry (5,"cat"))); // can't find it anymore because of changed binding - idx.modifyRequest (_entry (5,"dog"), _entry (2,"cat")); + idx.modifyRequest (dogHash, _entry (5,"cat")); - CHECK ( idx.hasRequest (_entry (2,"cat"))); - CHECK (!idx.hasRequest (_entry (5,"dog"))); + CHECK ( idx.hasRequest (_entry (5,"cat"))); CHECK (p_cnt == idx.provision_count()); CHECK (r_cnt == idx.request_count()); CHECK (_hasSolution (1,7)); CHECK (_hasSolution (6,7)); CHECK (_hasDefault (3)); - CHECK (_hasSolution (2,7)); // automatically got the current cat solution + CHECK (_hasSolution (5,7)); // automatically got the current cat solution } @@ -365,7 +374,7 @@ namespace test { uint r_cnt = idx.request_count(); uint p_cnt = idx.provision_count(); CHECK (_hasSolution (1,7)); - CHECK (_hasSolution (2,7)); + CHECK (_hasSolution (5,7)); CHECK (_hasSolution (6,7)); CHECK (_hasDefault (3)); @@ -378,7 +387,7 @@ namespace test { CHECK (p_cnt == idx.provision_count()); CHECK (r_cnt == idx.request_count()); CHECK (_hasDefault (1)); - CHECK (_hasDefault (2)); + CHECK (_hasDefault (5)); CHECK (_hasDefault (6)); CHECK (_hasSolution (3,8)); @@ -388,7 +397,7 @@ namespace test { CHECK (idx.hasProvision (_entry (7,"cat"))); CHECK (idx.hasProvision (_entry (9,"cat"))); CHECK (_hasSolution (1,9)); // all cats got the second cat solution - CHECK (_hasSolution (2,9)); + CHECK (_hasSolution (5,9)); CHECK (_hasSolution (6,9)); CHECK (_hasSolution (3,8)); // the dog is unaffected @@ -399,10 +408,10 @@ namespace test { CHECK (!idx.hasProvision (_entry (7,"cat"))); CHECK ( idx.hasProvision (_entry (4,"dog"))); - CHECK (_hasSolution (1,9)); // cats unaffected, because we're changing a shadowed cat solution - CHECK (_hasSolution (2,9)); + CHECK (_hasSolution (1,9)); // cats unaffected, because we're changing a shadowed cat provision + CHECK (_hasSolution (5,9)); CHECK (_hasSolution (6,9)); - CHECK (_hasSolution (3,4)); // but the dog got switched to the transmogrified-into-dog solution, + CHECK (_hasSolution (3,4)); // but the dog got switched to the replaced-by-dog solution, // because it was added later than the existing solution 8 // a switch within the same cluster ("cat") @@ -411,7 +420,7 @@ namespace test { CHECK ( idx.hasProvision (_entry (7,"cat"))); CHECK ( idx.hasProvision (_entry (4,"dog"))); CHECK (_hasSolution (1,7)); // because cat-7 is newly added, it shadows the older cat-9 - CHECK (_hasSolution (2,7)); + CHECK (_hasSolution (5,7)); CHECK (_hasSolution (6,7)); CHECK (_hasSolution (3,4)); // but dog remains dog diff --git a/uml/lumiera/128517 b/uml/lumiera/128517 index 28202debe..d87549fd1 100644 --- a/uml/lumiera/128517 +++ b/uml/lumiera/128517 @@ -1,6 +1,6 @@ format 58 "CommonLib" // CommonLib - revision 18 + revision 19 modified_by 5 "hiv" // class settings //class diagram settings @@ -451,6 +451,15 @@ ${class}::${name} ${(}${)}${const}${volatile} ${throw}${staticnl} + end + + classrelation 203141 // + relation 192261 -_-> + stereotype "create" + a package + cpp default "#include in source" + classrelation_ref 203141 // + b parent class_ref 166021 // ActiveProvision end end diff --git a/uml/lumiera/141445.diagram b/uml/lumiera/141445.diagram index 9d099c054..61830e5ae 100644 --- a/uml/lumiera/141445.diagram +++ b/uml/lumiera/141445.diagram @@ -58,7 +58,7 @@ end relationcanvas 129669 relation_ref 188677 // from ref 129157 z 1999 to ref 129285 no_role_a no_role_b - multiplicity_a_pos 275 240 3000 multiplicity_b_pos 237 240 3000 + multiplicity_a_pos 266 244 3000 multiplicity_b_pos 246 244 3000 end relationcanvas 129925 relation_ref 188933 // from ref 128645 z 1999 to ref 129285 @@ -117,5 +117,12 @@ relationcanvas 133125 relation_ref 191109 // no_role_a no_role_b no_multiplicity_a no_multiplicity_b end +relationcanvas 133381 relation_ref 192261 // + decenter_end 98 + from ref 129157 z 1999 stereotype "<>" xyz 109 149 3000 to point 163 194 + line 133765 z 1999 to ref 131461 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end preferred_whz 635 331 1 end diff --git a/uml/lumiera/5.session b/uml/lumiera/5.session index 522c2745b..293f4231c 100644 --- a/uml/lumiera/5.session +++ b/uml/lumiera/5.session @@ -42,7 +42,6 @@ open class_ref 166021 // ActiveProvision class_ref 164741 // Binding class_ref 166277 // Index - classinstance_ref 144517 // class_ref 145285 // MediaKind package_ref 131077 // ConfigQuery