Commit graph

1535 commits

Author SHA1 Message Date
6b56b46b6a Library: disambiguate forwarding assignment
we allow assignment to the element embedded within the wrapper.
Yet obviously we need specific implementations for assignment
to the container itself. Thus we define the templated
assignment operator such as to render the explicit specialisation
a better match than anything generated from the templated
operator
2017-08-22 19:37:44 +02:00
f72b97bd9c Library: add move operations to ItemWrapper 2017-08-20 22:09:37 +02:00
e46d23bd62 GCC-5 compatibility: need 1/3 more inline buffer space
GCC-5 requires more storage for some basic data types
Most notably std::string is now way larger than void*
2017-08-17 13:24:34 +02:00
937ad64596 DiffMessage: now uniformly plays the role of MutationMessage (closes #1066) 2017-08-13 07:25:32 +02:00
82a12115c3 DiffMessage: complete documentation 2017-08-13 07:25:32 +02:00
f7402ef89d Library: allow to consume an iterator while taking the snapshot 2017-08-13 07:25:32 +02:00
255958b23b Library: fix yet another misconception in iterator comparison
...again the situation when we want to use Lumiera iterators
in a stadard "for each" loop
2017-08-13 00:07:38 +02:00
7e9bb1fb5d DiffMessage: elaborate integration test... 2017-08-12 23:02:00 +02:00
b45ffe5cbe DiffMessage: fix insidious initialisation bug (related to #963)
basically DiffMessage has a "take everything" ctor, which happens
to match on type DiffMessage itslef, since the latter is obviously
a Lumiera Forward Operator. Unfortunately the compiler now considers
this "take everyting" ctor as copy constructor. Worse even, such a
template generated ctor qualifies as "best match".

The result was, when just returing a DiffMessage by value form a
function, this erroneous "copy" operation was invoked, thus wrapping
the existing implementation into a WrappedLumieraIterator.

The only tangible symptom of this unwanted storage bloat was the fact
that our already materialised diagnostics where seemingly "gone". Indee
they weren't gone for real, just covered up under yet another layer of
DiffMessage wrapping another Lumiera Forward Iterator
2017-08-12 18:16:06 +02:00
32f2d6ed9a IterSource: optimise hand-over at construction
by moving, we can avoid the generation of up to 3 additional shared copies
of the DataHandle. The whole invocation now works without touching any shared count
and thus without incurring a memory barrier...
2017-08-12 16:27:30 +02:00
06ff5c4e71 DiffMessage: complete test of diagnostic output 2017-08-12 14:33:26 +02:00
efc27fd07b DiffMessage: draft content diagnostics wrapper 2017-08-12 05:55:31 +02:00
d4ac2d78e2 C++11: improve moving and forwarding of iterators
this becomes more relevant now, since the actual MutationMessage iterators
are implemented in terms of a shared_ptr to IterSource. Thus, when building
processing pipelines, we most definitively want to move that smart-ptr into
the destination, since this avoids touching the shared count and thus avoids
generating unnecessary memory barriers.
2017-08-12 03:01:35 +02:00
4a2384e242 DiffMessage: add further convenience ctor for varargs
hey... all my dream constructors became true
2017-08-12 03:00:38 +02:00
380fa5bb38 DiffMessage: add further convenience ctors for STL containers 2017-08-11 22:23:51 +02:00
7dc0fdd67a DiffMessage: implement convenience ctor to build from Lumiera Iterator 2017-08-11 21:27:51 +02:00
9e4f3f3314 metaprogramming: switch util-foreach to variadic templates (#967)
...likewise low hanging fruit
2017-08-11 20:35:53 +02:00
a731b3caf4 metaprogramming: get rid of the remaining boost::enable_if usages
...low hanging fruit
2017-08-11 20:23:46 +02:00
8c1a43a6b3 metaprogramming: switch util-foreach to our own enable_if implementation
...allows us to get rid of quite some boost-includes
Incidentally, "our own" implementation is equivalent to both the
boost implementation and the implementation from C++14
It is just a bit more concise to write.
2017-08-11 20:02:37 +02:00
9ad0dd9918 DiffMessage: start with drafting the most simple test case
damn it!
why the hell is the C++ language so tedious to write....
even after years of practice you need hours to get the most basic stuff to fly
2017-08-11 18:34:23 +02:00
9d5d758f0c IterSource: use human readable source type diagnostics 2017-08-11 17:08:49 +02:00
dfd3dc1275 DiffMessage: reshape IterAdapter to allow for custom diagnostics
since we do not want to increase the footprint, we're bound to reuse
an existing VTable -- so IterAdapter itself is our only option.
Unfortunately we'll need to pass that through one additional
decoration layer, which is here the iterator; to be able to
add our string conversion there, we need to turn that into
a derived class and add a call to access the underlying
container, which gets us into element type definition mess....
2017-08-11 16:56:18 +02:00
f6baef16c5 DiffMessage: consider to unite the handling of mutation messages (#1066) 2017-08-11 15:23:33 +02:00
fdcf431a9b DiffMesage: use as payload within MutationMessage and pass Diff by RValue
now this highlights the unsettled decision still the more,
as can be seen by all that unnecessary copying. Basically we move the
Diff into the lambda-closure, from there into an anonymous instance,
from there into the embedded Buffer in MutationMessage, which again
just happens to sit in the closure storage when the action is invoked.
And all of this copying just to move the DiffMessage for consumption
into the TreeMutator...

thus by #1066 we should really get rid of the MutationMessage class altogether!
2017-08-11 02:00:54 +02:00
fd0a011ea4 DiffMessage: bold attempt towards a way to produce diffs (#1066)
actually I do not know much regarding the actual situation when,
within the Builder run, we're able to detect a change and generate
a diff description. However, as a first step, I'll pick IterSrouce
as a base interface and use a "generation context", which is to be
passed by shared-ptr
2017-08-11 00:59:10 +02:00
a7ad82c935 Library: can optimise IterStack pop()
...by moving out the element to be extracted;
because of RVO it will in fact be move constructed into
the storage of the caller
2017-08-07 00:20:55 +02:00
70e1a5b922 convert ScopedCollection to rely on C++11
- variadic templates
- type traits
- use uniqe_ptr to manage storage (instead of boost::scoped_array)
2017-08-06 18:21:25 +02:00
0b621e71c5 Library: fix a suptle misconception in the design of IterAdapter
again surprising how such fundamental bugs can hide for years...

Here the reason is that IterAdapter leaves the representation of "NIL" to
its instantiation / users; some users (here in for example the ScopedCollection)
can choose to allow for different representations of "NIL", but the comparison
provided by IterAdapter just compares the embedded pos by face value.
2017-08-06 16:58:22 +02:00
c96fcc1c6a UI-Dispatch: basic CallQueue implementation PASS 2017-08-05 17:59:55 +02:00
56def9f6d7 Library: expose some diagnostics on IterStack / IterQueue by default
seems like most usages will want to expose this kind of diagnostics for unit testing
and in fact the queue or stack nature is the primary nature of this entity,
while iterability comes as additional trait
2017-08-05 17:57:25 +02:00
3dea3c0fa0 UI-Dispatch: draft basic interface of a queue helper (#1098) 2017-08-05 17:36:32 +02:00
9b285a95c0 UI-Integration: plan the next steps to drive this topic ahead (#1099, #1098)
- concept for a first preliminary implementation of dispatch into the UI thread
 - define an integration effort to build a complete working communication chain
2017-08-05 17:36:32 +02:00
a3ed982da4 UI-top-level: fix GTK framework initialisation order 2017-05-19 17:00:41 +02:00
0c073ad6e2 fix diagnostic type formatting
...again to make it work with GCC-5,
also to allow more leeway using various compilers

Explanation: we use a helper function to abbreviate the
demangled type names to make diagnostic ouput more readable.
Obviously such a function needs to be adjusted to the
way concrete compilers generate their type output; GCC-5
slightly differs to GCC-4.9 here, so I've made the regular
expressions a bit more flexible
2017-05-02 21:01:41 +02:00
46192cadbf fix some issues with static initialisation order
...also uncovered by compiling with GCC-5
2017-05-02 21:01:41 +02:00
d29e4e2d6f GCC-5 compatibility: ambiguity in overload resolution
we have a catch-all template operator to get a string converted
or pretty printed output from "any object". Unfortunately
this overload counts equivalent to another overload by
the IO manipulators. Solution is to define both operarators
similar in the first argument, thus turing the overload
for the IO manipulators into the more specific overload
due to the explicitly given second argument
2017-05-02 00:09:48 +02:00
37cdfaba54 GCC-5 compatibility: remove the last remaining auto_ptrs 2017-05-01 21:43:10 +02:00
9262af1346 GCC-5 compatibility: remove unnecessary forward declaration
a bit over the top anyway: string will inevitably be included sooner or later
2017-05-01 18:38:52 +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
079ad715b0 Commands: change API to allow moving commands into the dispatcher queue 2017-04-16 16:16:26 +02:00
0dad15209d Commands: add new slot into SessionCommand facade
for the operation to start a new command cycle and open a new instance
2017-04-09 03:01:12 +02:00
a53032cfc5 Analysis regarding the next step, integration of InstanceManagement into SessionCommand facade 2017-04-09 01:34:18 +02:00
32a76a5703 SymbolTable: needs proper locking (#158)
this might turn into lock contention problem, but better optimise
a correct implementation than fix a fast yet broken one.

Hint: SessionCommandFunction_test demonstrates that the
symbol table can be corrupted by creating Symbol instances
in parallel without proper locking. So yes, this is for real.
2017-04-08 02:27:51 +02:00
3f17e6558e Symbol: clean-up of some occasional usages
hereby overlooking the elephant in the room: EntryID could switch to Symbol now
2017-04-08 00:40:04 +02:00
baa4111358 Symbol: use a dedicated hash function
since Symbol instance are now backed by a symbol table,
we can use a much faster hash function by just hashing the
pointer into the symbol table, since the Symbol string content
is already checked at initialisation.
2017-04-07 23:34:35 +02:00
2204066a94 Symbol: test coverage for empty and bool
oh yeah
yet another opportunity for mistakes
2017-04-07 20:06:19 +02:00
4df59678a3 Symbol: rework initialisation and introduce a "bottom" Symbol
Up to now, we tolerated null pointers in Literal instances.
But we can not tolerate passing a null cString to Symbol initialisation.
Rather, hereby we introduce a dedicated "bottom" Symbol, a valid "null object"
2017-04-07 19:25:21 +02:00
23c412bc42 Symbol: rework equality comparisons (#417)
For this task, I've also investigated to use boost::operators
This would only incur a negligible penalty on build times and executable sizes,
however, I don't consider the boost based solution to improve readability,
since many of these comparisons are tricky or subtly different.

Moreover, since boost::operators needs to be mixed-in, the initialisation
of Symbol objects becomes difficult, not to mention the additional base class
information visible in the debugger when inspecting Symbol or Literal objects

For that reason, I decided *against* using Boost here and coded up
all the operators in all combinations manually
2017-04-07 18:04:49 +02:00
29b8b2b8bc Symbol: switch to using the symbol-table as backing implementation (#158)
...which means, from now on identical input strings
will produce the same Symbol object (embedded pointer).

TODO: does not handle null pointers passed in as c-String properly
2017-04-07 06:34:41 +02:00