Re: [Development] RFC: new moc feature

2016-01-06 Thread Kevin Kofler
Knoll Lars wrote: > Just as a side note: While perf ensures there’s no collisions between > valid keys in the hash table, you still end up doing one string comparison > in the end to ensure that your input string matches the key. Why? Just document that passing an unknown string is undefined

Re: [Development] RFC: new moc feature

2015-12-07 Thread Matthew Woehlke
On 2015-12-05 07:00, Sean Harmer wrote: > No idea if all of our > supported compilers allow hooking in custom preprocessors or not. Okay, that sentence just scares the pants off me... forget whether or not the *compilers* support it; what about the build systems? Not everyone uses qmake. At

Re: [Development] RFC: new moc feature

2015-12-07 Thread Knoll Lars
On 05/12/15 21:37, "Development on behalf of Marc Mutz" wrote: >On Saturday 05 December 2015 20:20:27 Sean Harmer wrote: >> I was >> just wondering if we could get it down to the theoretical ideal of a >> single integer

Re: [Development] RFC: new moc feature

2015-12-07 Thread Marc Mutz
On Monday 07 December 2015 13:15:13 Knoll Lars wrote: > On 05/12/15 21:37, "Development on behalf of Marc Mutz" wrote: > >On Saturday 05 December 2015 20:20:27 Sean Harmer wrote: > >> I was > >> just wondering if we could get it down to the theoretical ideal of a > >> single integer comparison

Re: [Development] RFC: new moc feature

2015-12-07 Thread Sean Harmer
On 07/12/2015 15:34, Matthew Woehlke wrote: On 2015-12-05 07:00, Sean Harmer wrote: No idea if all of our supported compilers allow hooking in custom preprocessors or not. Okay, that sentence just scares the pants off me... forget whether or not the *compilers* support it; what about the build

Re: [Development] RFC: new moc feature

2015-12-05 Thread Marc Mutz
On Saturday 05 December 2015 13:00:44 Sean Harmer wrote: > So given the above example we'd be able to have something like this > (name of macro pending): > > if (e->type() == NodeUpdated) { > const QScenePropertyChangePtr = > qSharedPointerCast(e); > switch

Re: [Development] RFC: new moc feature

2015-12-05 Thread Marc Mutz
On Saturday 05 December 2015 20:20:27 Sean Harmer wrote: > I was > just wondering if we could get it down to the theoretical ideal of a > single integer comparison mapped into the finite set of strings in use. > Seems not, without some non-neglible effort. man 1 gperf ? -- Marc Mutz

Re: [Development] RFC: new moc feature

2015-12-05 Thread Konstantin Tokarev
05.12.2015, 22:29, "Marc Mutz" : > On Saturday 05 December 2015 20:20:27 Sean Harmer wrote: >>  I was >>  just wondering if we could get it down to the theoretical ideal of a >>  single integer comparison mapped into the finite set of strings in use. >>  Seems not, without

Re: [Development] RFC: new moc feature

2015-12-05 Thread Sean Harmer
Hi Marc, On 05/12/2015 19:06, Marc Mutz wrote: On Saturday 05 December 2015 13:00:44 Sean Harmer wrote: So given the above example we'd be able to have something like this (name of macro pending): if (e->type() == NodeUpdated) { const QScenePropertyChangePtr =

Re: [Development] RFC: new moc feature

2015-12-05 Thread Marc Mutz
On Saturday 05 December 2015 20:06:22 Marc Mutz wrote: > invariable inevitable -- Marc Mutz | Senior Software Engineer KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company Tel: +49-30-521325470 KDAB - The Qt Experts ___

Re: [Development] RFC: new moc feature

2015-12-05 Thread Sean Harmer
Hi Olivier, On 05/12/2015 10:22, Olivier Goffart wrote: On Saturday 5. December 2015 09:30:33 Sean Harmer wrote: Hi devs, I'd like to get some feedback on a new feature for moc before we take it any further than mild musing. The context is Qt3D has some frontend QObject subclass types, and

[Development] RFC: new moc feature

2015-12-05 Thread Sean Harmer
Hi devs, I'd like to get some feedback on a new feature for moc before we take it any further than mild musing. The context is Qt3D has some frontend QObject subclass types, and corresponding backend, non-QObject subclass types for reasons of allowing us to process data on the backend without

Re: [Development] RFC: new moc feature

2015-12-05 Thread Olivier Goffart
On Saturday 5. December 2015 09:30:33 Sean Harmer wrote: > Hi devs, > > I'd like to get some feedback on a new feature for moc before we take it > any further than mild musing. The context is Qt3D has some frontend > QObject subclass types, and corresponding backend, non-QObject subclass > types

Re: [Development] RFC: new moc feature

2015-12-05 Thread Kevin Kofler
Olivier Goffart wrote: > Instead, I would suggest something similar to llvm::StringSwitch > http://code.woboq.org/llvm/llvm/include/llvm/ADT/StringSwitch.h.html Ewww, this is horrible! It will evaluate ALL the result values passed to it, whether the cases match or not. That works if the values