Commit graph

61 commits

Author SHA1 Message Date
c324d2e594 Proc-Commands: remove a function we likely won't need ever (closes #291) 2017-08-10 21:52:51 +02:00
876c1dd1fd Commands: change implementation frame to include the command-ID
while the initial design treated the commands in a strictly top-down manner,
where the ID is known solely to the CommandRegistry, this change and information
duplication became necessary now, since by default we now always enqueue and
dispatch anonymous clone copies from the original command definition (prototype).

This implementation uses the trick to tag this command-ID when a command-hanlde
is activated, which is also the moment when it is tracked in the registry.
2017-04-17 03:09:12 +02:00
bb7bba5dc2 Commands: add API to unbind and discard command arguments
this seems like an obvious functionality and basically harmless,
since commands are designed to be inherently stateful, which is reflected
in all the internal storage holders to expos an assignment operator
(even while the actual implementation is based on placement new instead
of assigning values into the storage, and thus even supports immutable
values). The only possible ramification is that argument values must
be default constructible
2017-04-16 19:21:29 +02:00
410c36d2c3 Commands: change semantics of command instance management (#1089)
in accordance to the design changes concluded yesterday.
 - in the standard cases we now check the global registry first
 - automatically create anonymous clone copy from global commands
 - reorganise code internally to use common tail implementation
2017-04-16 18:27:05 +02:00
aecef2a8f4 Commands: refactor integration into SessionCommandService (#1089)
It seems more adequate to push the somewhat intricate mechanics
for the "fall back" onto generic commands down into the implementation
level of CommandInstanceManager. The point is, we know the standard
usage situation is to rely on the instance manager, and thus we want
to avoid redundant table lookups, only to support the rare case of
fallback to global commands. The latter is currently used only from
unit-tests, but might in future also be used by scripts.

Due to thread safety considerations, I have refrained from handing
out a direct reference to the command token sitting in the registry,
even while not doing so incurs a small runtime penalty (accessing
the shared ref-count for creating a copy of the smart-handle).
This is the typical situation where you'd be tempted to sacrifice
sanity for the sake of an imaginary performance benefit, which
in fact is dwarfed by all the machinery of UI-Bus and argument
passing via GenNode.
2017-04-09 19:11:40 +02:00
a9cb417320 Enable move-initialisation on command activation 2017-04-01 19:26:23 +02:00
97e42f75ee Commands: code up implementation of CommandInstanceManager
interesting new twist: we do not even need to decorate with a running number,
since we'll get away with an anonymous command instance, thanks to Command
being a smart-handle
2017-04-01 02:33:15 +02:00
12a7d96d9f Adjust logging for command definitions to be quiet by default
...otherwise our log will be flooded with command definition messages soon

NOTE: to see all command definitions happening, set into environment:

NOBUG_LOG='command:TRACE
2017-04-01 02:33:11 +02:00
de7b9f87ed Commands: ensure the commands where actually defined by the closures
...next step in the CommandSetup_test
2017-03-19 06:03:17 +01:00
b58427e49f Command-Framework: mark anonymous commands
It turns out we *do* support the use of anonymous commands
(while it is not clear yet if we really need this feature).

Basically, client code may either create and register a new
instance from another command used as prototype, by invoking
Command::storeDef(ID). Or, alternatively it may just invoke
newInstance() on the command, which creates a new handle
and a valid new implementation (managed by the handle as
smart-ptr), but never stores this implementation into the
CommandRegistry. In that case, client code may use such a
command just fine, as long as it cares to hold onto that
handle; but it is not possible to retrieve this command
instance later by symbolic ID.

In the light of this (possible) usage pattern, it doesn't
make sense to throw when accessing a command-ID. Rather, we
now return a placeholder-Symbol ("_anonymous_")
2016-12-25 21:46:58 +01:00
be2179ea81 command-closure-design(#301): better naming of implementation classes
Seems this was part of the confusion when looking at
the inheritance graph: Names where almost reversed
to the meaning. the ArgumentHolder was *not* the
argument holder, but the top level closure. And
the class "Closure" was not "the" Closure, but
just the argument holder. ;-)
2016-02-06 16:29:06 +01:00
3fef76e1d7 command-binding(#990): add new GenNode based argument binding
based on the new generic tuple builder, we're now able to
add a new binding function into the command implementation
machinery, alongside the existing one. As it stands, the
latter will be used rather by unit tests, while the new
access path is what will be actually taken within
the application, when receiving argument binding
messages dispatched via the UI-Bus.
2016-01-29 00:59:34 +01:00
1dc9642ec4 draft implementation of diagnostic command handler 2016-01-22 19:44:17 +01:00
005e665c13 clean-up design of the command handling patterns (#210)
this was a classical example of a muddled and messed-up design,
driven just by the fact that I wanted to "spare" some functions,
with the net effect of writing more functions, plus a proxy class
plus create a lot of confusion for the reader.

This was easy to resolve though, once I resorted to the
general adivice to make public interface methods final,
make the extension ponts protected and never
to chain two extension points
2016-01-22 15:25:08 +01:00
b96fd1299d preparation(#985): purge any remaining direct uses of boost::format
now we use boost::format through our own front-end util::_Fmt
solely, which both helps to reduce compilation time and code size,
and gives us a direct string conversion, which automatically
uses any custom operator string() available on arguments.

While desirable as such, I did this conversion now, since
it allows us to get rid of boost::str, which in turn helps
to drill down any remaning uses of our own util::str
2016-01-04 01:38:04 +01:00
2704ad4512 decide upon the actual mechanics of command binding and invocation 2015-11-28 08:15:32 +01:00
0ea37402d2 Ticket #934: switch entire code-base to use the new Singleton factory
lib::Depend<TY>  works as drop-in replacement for lib::Singleton<TY>

This changeset removes the convoluted special cases like
SingletonSub and MockInjector.
2013-10-20 03:19:36 +02:00
b9d1899486 cleanup: rectify Proc-Layer namespaces (II) 2011-12-02 17:50:44 +01:00
3f1b7651e9 GPL header whitespace 2010-12-17 23:28:49 +01:00
5c28b5d46e re-read, verify and finish off the Scope, ScopeLocator and QueryFocus implementation 2010-10-16 02:21:19 +02:00
330eb2c243 extended for-each looping helpers. Closes #479 2010-01-04 14:48:00 +01:00
c6d5f8a0b4 Proc Command framework: *first integraton round finished* 2009-10-11 05:57:46 +02:00
ae01f85452 replace existing implementation with CommandImplCloneBuilder 2009-10-11 05:57:45 +02:00
0bcbf7fee0 fix further problems uncovered by test; allow for anonymous cloning 2009-10-11 05:57:45 +02:00
17c7160f02 refactor CommandDef, get rid of the possibility of re-defining. YAGNI! 2009-10-11 05:57:45 +02:00
37cd451367 fix sloppy definition of less-than comparison, which caused malfunction of registry 2009-10-11 05:57:45 +02:00
d2acf48587 change semantics of state predicates, as it seems less surprising this way 2009-10-11 05:57:44 +02:00
95db5f9840 clarify state predicates in conjunction with command lifecycle 2009-10-11 05:57:44 +02:00
07de2a767b implement equality comparison on CommandImpl level 2009-10-11 05:57:44 +02:00
4c3fc9e64d WIP getting CommandRegistry_test to run
(equality on CommandImpl is still missing)
2009-10-11 05:57:43 +02:00
8c21f21acc namespace cleanup: bring Singleton and Factory into lib:: 2009-10-11 05:57:41 +02:00
7fccecacce WIP using the reverse index to find out the Command-ID
this includes using a Command* as key within a std::map
2009-10-11 05:57:39 +02:00
4c9af94e1d improve and clean up the Command interface 2009-10-11 05:57:39 +02:00
8dc434a141 CommandRegistry implementation (...) 2009-10-11 05:57:39 +02:00
925fa685b1 WIP change HandlingPattern to work on CommandImpl rather 2009-09-21 03:11:46 +02:00
b9763b6c16 command frontend sort-of written now, pending integration test 2009-08-10 01:32:33 +02:00
5988b1d697 clean up command interface 2009-08-10 01:30:59 +02:00
9f40e4af9c implemented definition and access of handling patterns 2009-08-09 21:55:47 +02:00
da3cf5a6a6 rework the cmd registry to build on this 2009-08-09 03:48:19 +02:00
e178bd0811 completely factor out allocation/deallocation and placement new into a base class 2009-08-09 03:47:32 +02:00
09a594d2c5 WIP: considerations for a store-as (clone) operation 2009-08-06 18:00:19 +02:00
a677e2edde second shot for implementing the binding: better the other way round 2009-08-04 02:25:50 +02:00
155254dd9b build new cmd impl object within registry 2009-08-03 18:17:41 +02:00
853aff1228 fixed and stubbed until it passes compiler again 2009-08-02 20:57:04 +02:00
4236d0649a WIP: implement the basic operation of execution pattern 2009-08-02 18:00:03 +02:00
f2126c0764 WIP partially get new proc-layer command impl through the compiler 2009-08-01 23:57:12 +02:00
8971d667cf WIP more implementation... 2009-08-01 17:14:27 +02:00
c2d9a02303 WIP some more nailing down of implementation details 2009-08-01 02:18:01 +02:00
c9e143995e WIP phase out the superfluous static access functions 2009-07-30 20:50:57 +02:00
655177921f WIP this might solve the race condition 2009-07-30 03:57:19 +02:00