From 9e96effcf163944ef3d59f8d03a1632ecd833fe5 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 20 Sep 2018 01:42:31 +0200 Subject: [PATCH] EventLog: prepare for dedicated translation unit up to now, EventLog was header only, which seems to cause a significant bloat in terms of generated code size, especially in debug builds. One major source for this kind of "template bloat" is the IterChainSearch, rsp. the filter and transformer iterators. And since EventLog is not meant for performance critical application code, but rather serves as helper for writing unit tests, an obvious remedy is to move that problematic part of the code down into a dedicate translation unit, instead of using inline functions. To prepare this refactoring, some var arg (templated) API funcitons need to be segregated. --- src/lib/test/event-log.hpp | 31 ++++++++++++++++++++----------- wiki/thinkPad.ichthyo.mm | 19 ++++++++++--------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/lib/test/event-log.hpp b/src/lib/test/event-log.hpp index 90897c7f0..19bfe0165 100644 --- a/src/lib/test/event-log.hpp +++ b/src/lib/test/event-log.hpp @@ -535,24 +535,35 @@ namespace test{ return *this; } + void + refineSerach_matchArguments (ArgSeq&& argSeq) + { + string argList(util::join(argSeq)); + refineSerach (matchArguments(move(argSeq))); + evaluateQuery ("match-arguments("+argList+")"); + } + /** refine filter to additionally require specific arguments * @remarks the refined filter works on each record qualified by the * query expression established thus far; it additionally * looks into the arguments (children list) of the log entry. - * @warning match is processed by comparision of string representation. + * @warning match is processed by comparison of string representation. */ template EventMatch& arg (ARGS const& ...args) { - ArgSeq argSeq(stringify (args...)); - string argList(util::join(argSeq)); - - refineSerach (matchArguments(move(argSeq))); - evaluateQuery ("match-arguments("+argList+")"); + refineSerach_matchArguments (stringify (args...)); return *this; } + void + refineSerach_matchArgsRegExp (RExSeq&& regExpSeq, string rendered_regExps) + { + refineSerach (matchArgsRegExp (move (regExpSeq))); + evaluateQuery ("match-args-RegExp("+rendered_regExps+")"); + } + /** refine filter to additionally cover all arguments * with a series of regular expressions. * @note For this match to succeed, any arguments of the log entry @@ -567,8 +578,8 @@ namespace test{ EventMatch& argMatch (ARGS const& ...regExps) { - refineSerach (matchArgsRegExp (stringify (regExps...))); - evaluateQuery ("match-args-RegExp("+util::join(stringify(regExps...))+")"); + refineSerach_matchArgsRegExp (stringify (regExps...), + util::join(stringify(regExps...))); return *this; } @@ -630,9 +641,7 @@ namespace test{ on (const X *const targetObj) { string targetID = idi::instanceTypeID (targetObj); - refineSerach (matchAttribute("this",targetID)); - evaluateQuery ("match-this(\""+targetID+"\")"); - return *this; + return this->on(targetID); } }; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 93511c487..ac9bb7bd4 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -31666,7 +31666,7 @@ - + @@ -31769,7 +31769,7 @@ - + @@ -31920,8 +31920,8 @@ - - + + @@ -31953,10 +31953,10 @@ - + - + @@ -31966,7 +31966,8 @@ - + + @@ -31975,8 +31976,8 @@ - - + +