Commit graph

219 commits

Author SHA1 Message Date
b6d5cd1c76 SessionCommandService implemented by delegating to the ProcDispatcher 2016-12-23 23:42:27 +01:00
b3f0605b9b SessionCommand-facade: consider how to expose command invocation
after reading some related code, I am leaning towards a design
to mirror the way command messages are sent over the UI-Bus.

Unfortunately this pretty much abandons the possibility to
invoke these operations from a client written in C or any
other hand made language binding. Which pretty much confirms
my initial reservation towards such an excessively open
and generic interface system.
2016-12-23 07:26:00 +01:00
1a4b6545a0 maximum munch
...feels like X-mas
2016-12-23 04:23:03 +01:00
39060297ee ProcDispatcher: solve the sync waiting for a "checkpoint"
...based on the logic of the whole loop
2016-12-22 21:36:03 +01:00
8bbc0fb97f more clean-up and comments 2016-12-22 19:35:42 +01:00
ad6a2ef090 ProcDispatcher: fix possible race at startup 2016-12-22 18:42:12 +01:00
0d436deb9e clean-up and comments for the implementation finished thus far 2016-12-22 04:04:41 +01:00
99b9af0a74 Looper: loop control logic unit test PASS 2016-12-22 03:28:41 +01:00
96def6b1ba Looper: elaborate implementation
looks doable indeed...
2016-12-22 03:12:14 +01:00
196696a8d0 Looper: draft possible implementation
seemingly a quite simple "trap door" mechanism is sufficient
2016-12-21 03:56:56 +01:00
ef6ecf3dd0 Looper: rework the spec for the builder triggereing behaviour
...still don't know how to implement it, but now it is at least
specified more correct, with respect to the implementation of the loop
2016-12-21 03:15:36 +01:00
6073df3554 Looper: other (better?) idea how to handle "builder dirty" automatically
...this means to turn Looper into a state machine.
Yet it seems more feasible, since the DispatcherLoop has a nice
checkpoint after each iteration through the while loop, and we'd
keep that whole builder-dirty business completely confined within
the Looper (with a little help of the DispatcherLoop)

Let's see if the state transition logic can actually be implemented
based just on such a checkpoint....?
2016-12-20 03:53:48 +01:00
bae3d4b96f mark a solution how to create a safeguard against deadlock on session shutdown
....if by some weird coincidence, a command dispatched into the session
happens to trigger session shutdown or re-loading, this will cause a deadlock,
since decommissioning of session data structures must wait for the
ProcDispatcher to disable command processing -- and this will obviously
never happen when in a callstack below some command execution!
2016-12-20 02:35:45 +01:00
b873f7025b ProcDispatcher: mark some next tasks to care for 2016-12-16 23:26:56 +01:00
53ed0e9aa3 ProcDispatcher: consider and document the fine points of operational semantics
there are some pitfalls related to timing and state,
especially since some state changes are triggered, but not immediately reached
2016-12-16 23:11:19 +01:00
8ee08905b3 Looper: extend test coverage 2016-12-16 20:38:00 +01:00
30254da95f Looper: implement core operation control logic 2016-12-16 19:21:06 +01:00
af92ed505b Looper: implementation 2016-12-16 18:34:04 +01:00
7b860947b1 ProcDispatcher: skeleton of the processing loop
including a draft of the Looper control component and the
invocation of the object monitor for waiting on condition var
2016-12-15 22:15:20 +01:00
00077d0431 ProcDispatcher: decide on requirements and implementation structure (#1049) 2016-12-15 20:48:35 +01:00
7e65dda771 draft request to halt the dispatcher loop 2016-12-15 06:21:59 +01:00
86f446c197 better control of the shutdown sequence
holding the SessionCommandService in a unique_ptr allows us to
close the Interface reliably *before* the Loop is halted.
2016-12-15 05:54:48 +01:00
a3c22b8aff SessionCommandService to be operated by the DispatcherLoop 2016-12-15 05:38:12 +01:00
4d45dfd4be introduce CommandDispatch interface
this allows to let the DispatcherLoop actually serve
as implementation facility for the SessionCommandService
2016-12-15 05:21:03 +01:00
1ec883787a DOC: decision about where to home the SessionCommandService
After some consideration, it became clear that this service implementation
is closely tied to the DispatcherLoop -- which will consequently be
responsible to run and expose this service implementation
2016-12-15 05:07:40 +01:00
479f4170c2 implement activated state
need to keep state variables on both levels,
since the session manager (lifecycle) "opens" the session
for external access by starting the dispatcher; it may well happen
thus that the session starts up, while the *session subsystem*
is not(yet) started
2016-12-14 04:57:08 +01:00
a853851447 add complete locking to the ProcDispatcher
on both levels
- the front-end needs locking to ensure consistent state (memory barrier)
- the back-end nees locking to coordinate command processing
2016-12-14 04:18:58 +01:00
4c30c349aa change the way command dispatching is controlled by the session
"command dispatching" == the public session interface
so we'll better implement this important causal link directly,
instead of some obscure trickery with lifecycle events.
2016-12-14 03:59:13 +01:00
8da9858056 draft skeleton of the dispatcher loop thread 2016-12-13 04:45:00 +01:00
1a8408afb5 rework ProcDispatcher to run dispatcher thread as PImpl
note the idea is to have a joinable thread, where deleting
the enclosing object blocks until the thread is finished
2016-12-13 04:34:28 +01:00
014a828c63 next task: implement minimal "Session subsystem" (#318)
mark TODOs in code to make that happen.
Actually, it is not hard to do so, it just requires to combine
all the existing building blocks. When this is done, we can define
the "Session" subsystem as prerequisite for "GUI" in main.cpp

Unless I've made some (copy-n-paste) mistake with defining the facades,
this should be sufficient to pull up "the Session" and automatically
let the Gui-Plugin connect against the SessionCommandService
2016-12-12 03:45:21 +01:00
c144d15e65 add two placeholder functions for now
...soon to be replaced by the actual stuff, but right now
I am only concerned with getting all the boilerplate straight
2016-12-12 03:16:29 +01:00
4975712b5e copy-n-paste-programming to define SessionCommand interface / service
...the sheer amount of mechanical replacements scattered all over these
files might be a vivid indication, that the design of the interface system
is subobptimal ;-)
2016-12-12 03:09:08 +01:00
64e303999e WIP: start definition of SessionCommand interface 2016-12-12 02:55:32 +01:00
e0f866092d rectify-design(#301): disentangle CmdClosure hierarchy
Completely removed the nested hierarchy, where
the top-level implementation forwarded to yet another
sub-implementation of the same interface. Rather, this
sub-implementation (OpClosure) is now a mere implementation
detail class without VTable, and without half-baked
re-implementation of the CmdClosure interface. And the
state-switch from unbound to bound arguments is now
implemented as a plain-flat boolean flag, instead of
hiding it in the VTable.

To make this possible, without having to rewrite lots of
tests, I've created a clone of StorageHolder as a
"proof-of-concept" dummy implementation, for the sole
purpose of writing test fixtures. This one behaves
similar to the real-world thing, but cares only
for closing the command operation and omits all
the gory details of memento capturing and undo.
2016-02-07 01:41:40 +01:00
a7cd8996aa immutable-arguments(#989): proof-of concept
seems to work as assumed; we'll just have to construct
a new holder tuple in place when binding arguments.
Doesn't look too bad for me
2016-02-06 19:42:41 +01:00
91e74b0456 clean-up(#301): separate inclusions by purpose
and remove some superfluous ones
2016-02-06 19:41:21 +01:00
37fb19ae0a refactoring: separate headers 2016-02-06 18:50:51 +01:00
2fbb7ba7c9 simplification(#301): use ctor chaining to remove clutter 2016-02-06 16:42:42 +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
deb7a6758c add diagnostic output to the command implementation record
...allows better diagnostic in tests, when handling a command
through the new mock handling pattern within Test-Nexus
2016-02-05 23:55:07 +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
16597fcd99 extend command API to also accept a lib::diff::Rec<GenNode> for arguments
WIP: have to decide how the arguments can be unpacked
and how to generate proper runtime type mismatch errors.
2016-01-22 20:29:45 +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
f6d04d4d02 refactoring(#988): switch correspoinging tests to std::tuple
...with this changeset, our own tuple type should be
basically disconnected and not used anymore
2016-01-19 23:53:20 +01:00
0e10ef09ec refactoring(#988): switch command framework to std::tuple
this was rather easy, since the stadard tuple is a drop-in replacement,
and we do nothing special here, beyond inheriting from a tuple type
2016-01-19 03:56:54 +01:00
334f542897 clean-up(#985): remove code superseded by this rework
now finally able to remove most of the cruft from format-util.hpp
and get rid of the infamous util::str
2016-01-09 02:05:23 +01:00
2c20d407fc mass clean-up: adapt usage of std::cout pretty much everywhere
- remove unnecessary includes
- expunge all remaining usages of boost::format
- able to leave out the expliti string(elm) in output
- drop various operator<<, since we're now picking up
  custom string conversions automatically
- delete diagnostics headers, which are now largely superfluous
- use newer helper functions occasionally

I didn't blindly change any usage of <iostream> though;
sometimes, just using the output streams right away
seems adequate.
2016-01-07 20:12:46 +01:00
d09a5846d4 basically a working solution for toString in ostream
...and learned a lot about the new type_traits on the way.

As it seems, it is not possible to get a clean error message
when passing an "object" with no custom string conversion;
instead, some overload for an rvalue-ostream kicks in.

probably I'll go for shoing a type string in these cases
2016-01-04 22:21:09 +01:00