diff --git a/src/steam/control/command.hpp b/src/steam/control/command.hpp index daa298081..7b1191976 100644 --- a/src/steam/control/command.hpp +++ b/src/steam/control/command.hpp @@ -32,8 +32,8 @@ ** function arguments need to be provided (this is called "binding" or "closing the function arguments"). ** These function arguments are stored within the command definition and remain opaque to the client code ** actually invoking the command. Behind the scenes, there is a CommandRegistry, holding an index of the - ** registered commands and managing the storage for command definitions and arguments. The actual - ** Command object used by client code is a small, copyable and ref-counting handle to this + ** registered commands and managing the storage for command definitions and arguments. The actual + ** Command object used by client code is a small, copyable and ref-counting handle to this ** stored definition backend. ** ** # Command definition, argument types and UNDO operation @@ -110,7 +110,7 @@ namespace control { * Handle object representing a single Command instance to be used by client code. * Commands are accessed \link #get through a symbolic ID \endlink; there needs to be * a CommandDef somewhere to specify the actual operation and to define, how the - * effect of the command can be undone. Moreover, the command's definition + * effect of the command can be undone. Moreover, the command's definition * refers to a HandlingPattern, which describes how the command is actually * to be executed (the default is scheduling it within the SteamDispatcher) * @@ -312,9 +312,7 @@ namespace control { operator== (Command const& c1, Command const& c2) { return (!c1 && !c2) - || ( c1 && c2 && ( &c1.impl() == &c2.impl() - || Command::equivalentImpl (c1,c2) - )); + || ( c1 && c2 && (&c1.impl() == &c2.impl())); } inline bool @@ -328,7 +326,7 @@ namespace control { operator< (Command const& c1, Command const& c2) { return (!c1 && c2) - || ( c1 && c2 && (&c1.impl() < &c2.impl())); + || ( c1 && c2 && (&c1.impl() < &c2.impl())); } diff --git a/tests/core/steam/control/command-registry-test.cpp b/tests/core/steam/control/command-registry-test.cpp index 8137fe36a..0e9e118fa 100644 --- a/tests/core/steam/control/command-registry-test.cpp +++ b/tests/core/steam/control/command-registry-test.cpp @@ -60,7 +60,7 @@ namespace test { * interface. Add/remove a command instance to the index, allocate an * CommandImpl frame and verify it is removed properly on ref count zero. * @note this test covers the internal bits of functionality, - * not the behaviour of the (integrated) command framework + * not the behaviour of the (integrated) command framework * * @see Command * @see CommandRegistry @@ -75,7 +75,7 @@ namespace test { virtual void - run (Arg) + run (Arg) { CommandRegistry& registry = CommandRegistry::instance(); CHECK (®istry); @@ -124,9 +124,10 @@ namespace test { // now create a clone, registered under a different ID Command cmd2 = cmd1.storeDef(TEST_CMD2); - CHECK (cmd2 == cmd1); - cmd2.bind(54321); - CHECK (cmd2 != cmd1); + CHECK (cmd2 != cmd1); // note: while they are equivalent, they are not identical + Command cm2x = cmd2.bind(54321); + CHECK (cm2x != cmd1); + CHECK (cm2x == cmd2); // this created exactly one additional instance allocation: CHECK (1+cnt_inst == registry.instance_count()); @@ -143,6 +144,10 @@ namespace test { CHECK (cnt_defs == registry.index_size()); // removed from index CHECK (1+cnt_inst == registry.instance_count()); //...but still alive + CHECK (cmdX.isAnonymous()); + CHECK (cmd2.isAnonymous()); //......they got deached + CHECK (!cmd1.isAnonymous()); + // create a new registration.. registry.track(TEST_CMD2, cmd2); CHECK (registry.queryIndex(TEST_CMD2)); @@ -165,6 +170,7 @@ namespace test { cmdX.close(); CHECK (1+cnt_inst == registry.instance_count()); cmd2.close(); + cm2x.close(); CHECK (0+cnt_inst == registry.instance_count()); // ...as long as it's still referred } diff --git a/tests/core/steam/control/command-use1-test.cpp b/tests/core/steam/control/command-use1-test.cpp index c5e08e02a..17cd4253e 100644 --- a/tests/core/steam/control/command-use1-test.cpp +++ b/tests/core/steam/control/command-use1-test.cpp @@ -224,7 +224,7 @@ namespace test { CHECK (!c2.canUndo()); CHECK (c2.isAnonymous()); - CHECK (c1 == c2); + CHECK (c1 != c2); CHECK (!isSameObject(c1, c2)); CHECK (0 == command1::check_); @@ -234,7 +234,6 @@ namespace test { CHECK (randVal == command1::check_); CHECK ( c1.canUndo()); CHECK (!c2.canUndo()); - CHECK (c1 != c2); c2(); CHECK (randVal + randVal == command1::check_); @@ -271,7 +270,7 @@ namespace test { CHECK (c4.canUndo()); CHECK (not c4.isAnonymous()); CHECK ( c2.isAnonymous()); - CHECK (c4 == c2); + CHECK (c4 != c2); // note: it was stored as independent clone copy CHECK (c4 != c1); c4(); CHECK (c4 != c2); // now lives independently from the original diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 9033a0c88..a1aeb3065 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -20338,8 +20338,7 @@ innerhalb eines PolymorphicValue.

- - + @@ -20357,8 +20356,7 @@ stets selbst erzeugen und daher auf das korrekte Literal Verlaß ist)

- -
+
@@ -44386,21 +44384,52 @@ - + + - - - + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - + + + + + + + + + + + @@ -44432,23 +44461,37 @@ - - + + - - + + - - - - - + + + + + + + + + + + + + + + + + + + @@ -44474,7 +44517,7 @@ - + @@ -44528,7 +44571,7 @@ - + @@ -44691,8 +44734,9 @@ - - + + + @@ -44824,7 +44868,8 @@ - + + @@ -44841,6 +44886,9 @@ + + + @@ -45119,8 +45167,8 @@ - - + + @@ -45147,15 +45195,79 @@ - + + + + + + + + + + +

+ Grund ist die Umstellung auf inline-Storage +

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

+ wäre theoretisch jetzt möglich, +

+

+ da wir nun eine vollwertige String-Tabelle haben +

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

+ waren nur minimale Anpassungen +

+ + +
+ +
+ + + + +
- + @@ -45541,10 +45653,12 @@ - + + + - + @@ -45581,6 +45695,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -45648,10 +45795,10 @@ - + - + @@ -45792,6 +45939,208 @@ + + + + + + + + + + +

+ angeregt durch Gabriel; +

+

+ er wollte "versuchen, Lumiera zu bauen" +

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

+ wann sind Funktoren äquivalent ?? +

+ + +
+ + + + + +

+ mathematisch gilt: +

+

+ sie sind gleich, wenn sie für alle gleichen Argumente das gleiche Resultat liefern. +

+

+ +

+

+ sei die Dose offen... +

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

+ in tr1::functional war ein equality-Operator spezifiziert +

+

+ boost::function hat sich geweigert diesen zu implementieren, +

+

+ weil es keine vernünftige und konsistente Implementierung gibt. +

+

+ +

+

+ Für den C++11 - Standard hat man dann einen Kompromiß geschlossen, +

+

+ demnach der Vergleich mit einem NULLPTR sinnvoll (und implementierbar) ist, +

+

+ aber ansonsten alle validen definierten Funktionen untereinander verschieden sind. +

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

+ sonst auf Äquivalenz getestet +

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

+ und genau das Letztere ist nicht garantiert korrekt implementierbar +

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

+ Selbst verschiedene Closures haben selbst die noch eine eindeutige Identität +

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