Commit graph

3848 commits

Author SHA1 Message Date
9dfd3fc981 phase out some use of auto_ptr
TODO: the toolfactory needs a redesign anyway,
this was just placeholder code added in a very early
state of the Lumiera project. We have way better memory
managing facilities at hand now
2014-09-15 02:03:10 +02:00
d064623bab Reworked MultiFact(#388): switch in the new implementation 2014-09-14 23:58:05 +02:00
9a5d9873c8 WIP: prepare switch to the reworked MultiFac implementation #388 2014-09-14 22:38:58 +02:00
591e6d9775 MultiFact: implement the last and most complex usage case
the use of a custom finisihing functor, which is applied
to any generated product. This can be used for registration,
memory management or similar framework aspects
2014-09-14 22:25:12 +02:00
932d49fd95 MultiFact: how I learned to love the Bomb
C++11 is just incredibly cool. It is so easy to
support a flexible yet specific set of arguments
2014-09-14 02:06:58 +02:00
372edbfc85 MultiFact: implement second use case (smart pointers) 2014-09-14 00:36:36 +02:00
177eb0fab3 DOC: notes regarding the current level of C++11 support 2014-09-13 04:55:57 +02:00
0ff5c50030 MultiFact: implement simple usage pattern. NOTE: breaks CLang 3.0
Implement the first simple usage scenario for the
unified MultiFact template, using variadic templates.

NOTE:
 - the obvious solution based on std::forward
   triggers strange behaviour in GCC-4.7
 - the inline lambda in the test case traps the
   CLang-3.0 parster with a segfault. Horay!
2014-09-13 02:50:14 +02:00
c209f2e80c WIP: draft first usage pattern of the reworked MultiFact
...this time, I am determined to get it all into a single
template, and get it clear and right.
2014-09-11 19:39:42 +02:00
a1bb9178f5 Ticket #388: start investigation of MultiFact design
needs overhaul, since current design leads to problems
with GCC 4.8 onwards (and is messed up anyway)
2014-09-11 00:10:59 +02:00
b2b75fbe43 attempt to make factory invocation more evident in the code
...but the whole design looks still overengineered. See #388

- should get rid of the explicit specialisation
- always use a function signature and thus have arguments?
- why inheriting from the wrapper?
2014-09-08 03:37:41 +02:00
21079f3145 re-reading and rewording comments
still puzzled why this instantiation of MultiFact fails to compile with GCC 4.8

so I'm bound to understand why the types involved
need indeed to be are structured the way they are right now.
2014-09-08 02:52:38 +02:00
d2193e381c CLang-compatibility: temporary fix for bool conversion
...but we really neeed to re-think those bollean evaluations and conversions
2014-08-28 23:28:39 +02:00
7faa2e784d CLang-Compatibility: zero argument ctor now treated as function definition
previous versions used to resolve this ambiguity in favour of a ctor call,
but now the compiler treats such constructs as function definition;
this is reasonable, since C++11 introduced the notion of a "generalised
initialisation", which is always written as a (possibly empty) list
in braces.

In these specific cases here, we just omit the empty parens
2014-08-26 03:31:03 +02:00
685f4327f5 Fix: remove explicitly given hash function, use the automatic bridge instead
Since we have now a generic bridge to supply std::hash functions based on
an exisiting boost::hash function, we removed the explicit std::hash
specialisation for "Placement-ID".

This caused the PlacementIndex implementation to fail at compilation
with a quite obscure error, which in fact seems to be caused by the
absence of any specific specialisation. The symptom is that a iterator
range could not be assigned to the predefined iterator type of
std::unordered_multimap, due to a mismatch in the embedded traits type

__umap_traits<__cache_default<_Key, _Hash>::value>>

While I didn't track down that problem entirely, to verify my hypothesis,
the problem can be avoided by using the default -- which is now to
pick up an existing boost::hash function for this type and use this
to generate the std::hash function.
2014-08-26 03:04:14 +02:00
d07bbadaaf extend the unit-test to verify usage in hashtables 2014-08-18 06:03:41 +02:00
05042d96cd document the hash bridge with a unit test 2014-08-17 08:39:46 +02:00
e35a45a65e tricky header reordering to support a hackish-workaround (#944)
right now we have to defeat an unfortunate static assertion in
the standard library, which is expected to go away in the future.
We use a hack to hijack the problematic definition with the preprocessor,
which requires our header to be first.
2014-08-17 08:03:21 +02:00
9a95beda32 Library: automatic bridge to use boost::hash functions for std::hash
NOTE: this header contains a potentially dangerous, temporary workaround
to defeat the static assertion in the default implementation of std::hash,
as shipped with GCC 4.7.x

This assertion turns out to be detrimental all kinds of metaprogramming
based solutions, since it defeats SFINAE. It is expected to be removed
in GCC 4.8
2014-08-17 07:15:47 +02:00
f02481bb90 fix include order in GUI headers
the rules are:
- our own headers go before any library headers
- all headers need to be spelled relative to include root
- ensure that gtk is always included via gui/gtk-base.hpp
2014-08-17 07:02:48 +02:00
f00450a06c ..and use this trait to build an automatic bridge from boost::hash to std::hash
this completes the exploration; we should now be able to use
any type with boost hash support in the std unordered containers
without much ado.

I wasn't able to come up with a completely modular solution, since
the std::hash template has only one template parameter, which
defeats using enable_if. But since we're controling the default
implementation after the Hijacking anyway, we can as well go
ahead directly to forward to an existing boost::hash function
2014-08-17 03:23:35 +02:00
60b40de3d8 construct a trait to detect boost hash compatibility
this turns out to be quite tough, since boost::hash
just requires a free function 'hash_value' to be
"somehow" present, which might be just through ADL.

My solution is to inject an fallback declaration of such a function,
but only in the namespace where the trait template is defined.
Hopefully this never interferes with real hash functions defined
for use by boost::hash
2014-08-16 04:54:31 +02:00
7391d02c35 investigate the hijacking trick proposed by "enobayram"
...push away the definition from the standard library
and plant our own definition instead -- with a marker
typedef for metaprogramming
2014-08-16 02:04:29 +02:00
79b19b270f DOC: add a page with notes on the IDE setup 2014-08-16 00:03:55 +02:00
50faee12b3 DOC: update the Boost-page to reflect what's part of the language now
several C++11 features used to be Boost features in the past
2014-08-16 00:03:32 +02:00
e205e1e1a0 investigation of hash function extension points (#722)
start a systematic research about the coexistence of
std::hash and boost::hash. The goal is to build an
automatic bridge function -- but this is hampered by
the unfortunate standard implementation of std::hash

Since meanwhile even the GCC people seem to have realized
this wasn't a good idea, I am geared towards using a hack
to work around this problem, which can be expected to go
away with GCC 4.8.x

A possible idea how to construct such a workaround is
http://stackoverflow.com/questions/12753997/check-if-type-is-hashable


I start this investigation by defining two custom types,
each with his own extension point for hashing. The goal
would then be to use both in a standard hashtable container.
2014-08-13 04:18:38 +02:00
faf62cf8af DOC: start a page with C++11 notes (here: about type conversion)
note down some results found out during the C++11 transition.
There is now a clear distinction between automatic type conversion
and the ability to construct a new instance
2014-08-13 03:08:00 +02:00
3ef6bb0482 improve readability of some test specs
..by using literal match instead of regular expression match
2014-05-12 01:37:15 +02:00
561e036e0b remove any remaining use of boost::lambda
obsolete now, we can use the lambdas of the stock language
2014-05-12 01:12:45 +02:00
c2ea15695e amend harmless PlacementIndex test failures. Test Suite PASS
c++11 uses another hashtable implementation.
This uncovered some poorly written tests, which relied on
objects being returned in a specific order. As far as poissible,
we're using generic query functions now to get our test objects.

But these tests still rely on a specifically crafted test index content,
which as such is acceptable IMHO. The only remaining problem is
that we check the order of generated output in some tests, and this
order is still implementation dependent.
2014-05-11 02:08:53 +02:00
a421cf45de adjust test spec: C++11 does indeed pass ref parameters even through function objects
This is a notable difference to the boost or tr1-function objects
we used up to now. Thus the behavour is now straight forward without
any exception. If the function takes an argument by reference,
this is replicated through bind and function expressions
2014-05-10 02:14:38 +02:00
4acb7de682 half hearted fix: order of hashmap entries is implementation dependent
a real fix would be to rewrite the test to collect the retrieved
values and do a structural verification of the results. This
would mean to write a lot of code for such a marginal topic,
which was implemented just for sake of completenes anyway.

Hopefully my lack of "motivation" doesn't backfire eventually ;-)
2014-05-09 01:45:10 +02:00
a205653cad C++ uses a more precise meaning of 'convertiblity' now
Conversion means automatic conversion. In our case,
what we need ist the ability to *construct* a bool from
our (function) object -- while functors aren't automatically
convertible to bool. Thus we use one of the new predicates
from <type_traits>
2014-05-09 00:56:31 +02:00
643dfe3ea8 fix long standing error in testsuite runner
...uncovered by switching to c++11
When invoking an individual test, we used to erase
the 0-th cmdline argument, which happens to be allways
the name of the test being invoked. Yet none of our
tests actually complied to that contract. Rather,
all tests taking arguments access them by 1-based
argument index. Previously, the argument values just
happened to be still in memory at the original location
after erasing the 0st element.

"Fixed" that by changing the contract. Now, the 0th argument
remains in place, but when there are no additional arguments,
the whole cmdline is cleared.
This is messy, but the test runer needs to be rewritten
entirely, the whole API is clumsy and dangerous. Ticket #289
2014-05-09 00:56:31 +02:00
a4c41d1c12 testrunner: handle help request properly
don't actually execute the tests when there was a --help
2014-05-05 22:59:23 +02:00
027386d76c DOC: Tighten the build requirements to C++11 and Boost-1.55 2014-04-29 09:51:00 +02:00
361a78c478 Scons: check for C++11 specific headers. Be more explicit w/r boost
we still don't check for the precise boost version number in the
SCons configuration. We might do so in future, but for now our
policy is that precise version dependency checking is the business
of the packager (i.e. the debian package). The SCons build just
has to ensure the absolute necessary baseline
2014-04-29 09:24:18 +02:00
f826ab1ee5 C++11 transition: get compilation to pass again
...but we have still 12 test failures
2014-04-28 01:34:03 +02:00
2e9467fe76 Ticket #942: introduce move semantics for our custom shared-ptr-wrapper lib::P 2014-04-28 01:06:40 +02:00
f28ad3cf74 Ticket #940: solution for binding GUI signals
* use a development snapshot of lib SigC including the recent C++11 adaptations
 * never include whole namespaces. Here we got a clash between std::bind and sigc::bind
 * use lambdas
   * to make the binding code more readable
   * to take the nested invocations apart, which resolves the return type ambiguity
2014-04-27 21:28:52 +02:00
761bab5647 C++11 transition fixes
- comparison of weak-pointers
2014-04-05 22:20:38 +02:00
bb5db0ebd5 minor improvement to the GUI-model Sequence
including a LUID based hash identity
2014-04-05 22:18:37 +02:00
44970ed96e unsuccessful attempt to bridge between std::hash and boost::hash_value (Ticket #722) 2014-04-03 22:43:35 +02:00
7be1b7d35d Switch from TR1 preveiw to the new standard headers
- functional
- memory
- unordered collections
2014-04-03 22:42:48 +02:00
3fa9830f4c Switch compilation to C++11 standard with GNU extensions
Why GNU extensions? They where on by default previously,
so we're changing nothing besides the C++ standard level.

AFAIK, we're using a GNU extension at one place, and this
could be replaced by 'decltype' now.
2014-03-17 02:41:31 +01:00
5be52d4a55 Ticket #925: remove LUID from interface/plugin specifications
In the November developer meeting, Christian and I agreed that
it's best to remove that offending LUID specifications altogether.

Those embedded LUIDs where one of the issues blocking the transition to C++11
2014-03-16 02:21:07 +01:00
5fa4667fb8 fix error in test fixture
random offset should always be != zero
2014-03-16 02:00:01 +01:00
7c3efb309a explain the term 'subsystem' 2014-02-16 22:03:47 +01:00
5d835c71f3 TiddlyWiki: fix some orphaned pages
...caused by image names starting with upper case letter
2014-02-16 22:02:55 +01:00
4ef1883c04 settle and implement some long standing concerns regarding #920
- what the dispatch operation actally is
- where the deadlines are established
2013-11-18 02:25:27 +01:00