Commit graph

5088 commits

Author SHA1 Message Date
d9555701ac UI-Coordinates: implement a partial "sub path" order 2017-10-02 23:06:23 +02:00
3d8d383ca8 UI-Coordinates: add relational operators for partial order
It is not possible to inherit through boost operators
and defining them explicitly is not that much fuss either.
Plus we avoid the boost include on widely used header
2017-10-02 22:18:00 +02:00
42277c5760 UI-Coordinates: need to spell out all ctors explicitly
the usual drill...
once there is one additional non explicit conversion ctor,
lots of preferred conversion paths are opened under various conditions.

The only remedy is to define all ctors explicitly, instead of letting the
compiler infer them (from the imported base class ctors). Because this way
we're able to indicate a yet-more-preferred initialisation path and thus
prevent the compiler from going the conversion route.

In the actual case, the coordinate Builder is the culprit; obviously
we need smooth implicit conversion from builder expressions, and obviously
we also want to restrict Builder's ctors to be used from UICoord solely.

Unfortunately this misleads the compiler to do implement a simple copy construction
from non const reference by going through the prohibited Builder ctor, or to
instantiate the vararg-ctor inherited from PathArray.

Thus better be explicit and noisy...
2017-10-02 22:17:56 +02:00
5127414773 UI-Coordinates: next steps to cover
- allow tab specification to be elided
- simple comparisons between UI coordinates
- local query predicates
2017-10-02 18:39:18 +02:00
18d1e7a280 UI-Coordinates: polish test and consider next steps
After completing the self-contained UICoord data elements,
the next thing to consider might be how to resolve UI coordinates
against an actual window topology. We need to define a suitable
command-and-query interface in order to build and verify this
intricate resolution process separated from the actual UI code.
2017-10-02 18:11:21 +02:00
5c113b058d UI-Coordinates: better name the local component UIC_PATH 2017-10-02 16:51:45 +02:00
286b1829fe UI-Coordinates: implement path split and appending of multiple components
Unit test passes thus far
2017-10-02 06:49:50 +02:00
835b964e63 UI-Coordinates: implement append / prepend mutation 2017-10-02 06:45:50 +02:00
7826d6dc24 UI-Coordinates: implement low-level data manipulation incl. storage expansion 2017-10-02 06:45:45 +02:00
ee5bc046ae UI-Coordinates: draft how the builder manipulates content 2017-10-02 00:38:22 +02:00
ebed6fff1a UI-Coordinates: draft structure of the builder-API 2017-10-01 23:25:23 +02:00
5097637f0d UI-Coordinates: basic unit test PASS 2017-10-01 21:54:35 +02:00
1079d51c7e UI-Coordinates: implement named component access 2017-10-01 21:37:04 +02:00
ac38f0f963 UI-Coordinates: implement string representation 2017-10-01 21:10:18 +02:00
3a8f639a12 UI-Coordinates: implement reverse lookup 2017-10-01 20:12:45 +02:00
6322f1bc3c UI-Coordinates: define next steps to cover 2017-10-01 20:04:12 +02:00
8c694b6ec0 UI-Coordinates: PathArray abstraction finished and unit test PASS 2017-10-01 06:08:54 +02:00
ebe74bcb53 UI-Coordinates: add further coverage for various boundary cases 2017-10-01 04:45:19 +02:00
107e9008e5 UI-Coordinates: bugfix to pass unit test thus far
whew!
2017-10-01 03:58:42 +02:00
5dfd135595 Library: remove redundant checks from IterAdapter implementation
Explicitly assuming that those functions are called solely from IterAdapter
and that they are implemented in a typical standard style, we're able to elide
two redundant calls to the checkPoint() function. Since checkPoint typically performs
some non-trivial checks, this has the potential of a significant performance improvement

- we check (and throw ITER_EXHAUST) anyway from operator++, so we know that pos is valid
- the iterate() function ensures checkPoint is invoked right after iterNext,
  and thus the typical standard implementation of iterNext need not do the same
2017-10-01 03:25:33 +02:00
a08fba5880 UI-Coordinates: establish contract 2017-10-01 01:30:53 +02:00
294efb0321 UI-Coordinates: finish iteration control logic 2017-09-30 21:34:55 +02:00
d7dd01ad62 UI-Coordinates: change subscript to expose const& 2017-09-30 20:03:05 +02:00
21e2227d50 UI-Coordinates: simplify copy initialisation
deliberately skip calls to the default ctor, since we're copying anyway
2017-09-30 19:57:13 +02:00
0bef215350 UI-Coordinates: switch internal path array storage to Literal
...since that is what it meant to be.
To allow this chance, I've now added a default ctor to lib::Literal,
defaulting to the Symbol::EMPTY (the interned empty string)
2017-09-30 18:32:08 +02:00
dd45d6110d Library: Literal now default constructible to empty string
The class Literal is used as a thin wrapper to mark the fact that
some string parameter or value is assumed to be given *literally*

For the contract this indicates
- that storage is somewhere
- storage is not owned and managed by Literal
- yet storage guaranteed to exist during the whole lifetime of the program
- Literal can not be altered
- Literal is transparently convertible to const char *


Currently I am in the course of building some path abstraction, and for that
task it makes sense to hold an array of Literals (instead of pointers), just
because it expresses the intent way more clear. I do not see anything in the
above mentioned contract to prohibit a default constructed Literal, with the
empty string being the most obvious choice.

Note: there is the class Symbol, which derives from Literal. Symbol takes
arbitrary strings, but *interns* them into a static symbol table.
2017-09-30 17:45:38 +02:00
1138898989 UI-Coordinates: implement indexed access
...under the assumption that the content is normalised,
which means
- leading NULL is changed to Symbol::EMPTY
- missing elements in the middle are marked as "*"
- trailing NULL in extension storage is handled by adjusting nominal extension size
2017-09-30 02:48:25 +02:00
ab391d3dfa UI-Coordinates: implement size()
...which is the first step towards standard storage handling
2017-09-30 02:17:13 +02:00
9378badf6b UI-Coordinates: integrate the initialisation split
...as developed in during the metaprogramming investigation
2017-09-30 00:46:52 +02:00
a839cac02b UI-Coordinates: memory management for PathArray extension storage 2017-09-29 18:04:28 +02:00
73adcdf2e0 UI-Coordinates: initial draft for PathArray storage
after various fruitless attempts to rely somehow on the array variant of unique_ptr,
I ended up with a hand coded version of an heap allocated array, managed automatically
2017-09-29 15:03:14 +02:00
fcd8882206 Metaprogramming: finish variadic argument picker test 2017-09-29 03:21:47 +02:00
4348cd462c Metaprogramming: extend testcase and remould pickInit to support arbitrary arguments
as it turned out, the solution from yesterday works only with uniform argument lists,
but not with arbitrarily mixed types. Moreover the whole trickery with the
indices was shitty -- better use a predicate decision on template argument level.
This simple solution somehow just didn't occur to me...
2017-09-29 02:35:15 +02:00
636ab6e608 Metaprogramming: integrate the new facilities into the library 2017-09-29 00:51:13 +02:00
7296e60731 Metaprogramming: draft test for the new argument picker (WIP) 2017-09-28 16:28:15 +02:00
b5af8dbb51 Investigation: cleaner solution for default initialisation
Handle corner cases within the front-end functions,
either by static assert or direct branching;
keeps the variadic implementation template clean
2017-09-28 04:51:25 +02:00
dc35a1a6e5 Investigation: add a solution for default initialisation of missing arguments
...still somewhat unsatisfactory, because
- no clear compile error message when invoking pickArg with insufficient arguments
- the default initialisation case in SelectVararg is duplicated and messy
2017-09-28 03:58:09 +02:00
3f9565a156 Investigation: augment index iterator to deal with insufficient arguments
basically we want "all the rest" of the arguments to go to the recursive delegate
2017-09-28 01:40:23 +02:00
3f8606c474 Metaprogramming(#987): extract some variadic sequence helpers
some time ago we abandoned our own tuple type in favour of std::tuple
Since then, the helpers and ported utilities provide some generic helpers
to deal with variadic argument sequences, especially to build index sequences,
which in turn can be used to "pick" individual arguments from a variadic parameter pack.

The expectation is for this part of the support library gradually to grow and
in parts to replace the existing type sequence processing helpers. The expectation
is that we'll retain the basic type sequence, lib::meta::Types, but retrofit it
to rely on variadic arguments
2017-09-28 00:19:52 +02:00
4b67521e26 Metaprogramming(#987): mark planned transition to variadic arguments
since the adoption of C++11, we gradually transition our metaprogramming helpers
to support and rely on variadic template parameters. For the time being,
we just augment existing facilities when it comes in handy, yet some more
heavyweight lifting and overall clean-up remains to be done eventually.
2017-09-28 00:10:45 +02:00
3da370000c Investigation: likely the only way to get it to work
seems to be impossible to get rid of the intermediary argument repackaging delegate call.
As always the reason is that argument packs are no real first class types
2017-09-27 20:07:51 +02:00
5e3088c45b Investigation: need to limit the scope of the quest
there is the danger to get into building a fully generic solution, which is
- quite hard / challenging
- counterfeits the goal of writing easy-to-read code

This is the very reason why I do not want to use boost::MPL,
because in our usage situation, their abstractions are not worth
the price in terms of hard to read code.
2017-09-27 18:39:47 +02:00
3ad3f11f1e Investigation: slightly improved similar solution 2017-09-27 02:46:01 +02:00
23cc0597b5 Investigation: basically working yet convoluted solution draft 2017-09-27 00:26:04 +02:00
97727a6283 Investigation: draft intended call structure
using function calls here, but in the end, what we want is to invoke
some ctor with part of the provided argument sequence
2017-09-26 20:44:27 +02:00
e5dc7ba2bc Investigation: dissect argument packs
start investigation on generic techniques to dissect an variadic argument pack
2017-09-26 19:23:03 +02:00
372512006f UI-Coordinates: use a recursive implementation layout
this is a more or less arbitrary guess regaring performance requirements
2017-09-25 00:26:19 +02:00
5e1c25aaf5 UI-Coordinates: extract PathArray base abstraction into a library class 2017-09-24 22:50:42 +02:00
4082526ec6 UI-Coordinates: stub basic path element iteration 2017-09-24 21:14:26 +02:00
6073dbfcaf UI-Coordinates: stub basic access operations (WIP) 2017-09-24 17:20:47 +02:00