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.
This commit is contained in:
parent
121d78e13b
commit
9e96effcf1
2 changed files with 30 additions and 20 deletions
|
|
@ -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<typename...ARGS>
|
||||
EventMatch&
|
||||
arg (ARGS const& ...args)
|
||||
{
|
||||
ArgSeq argSeq(stringify<ArgSeq> (args...));
|
||||
string argList(util::join(argSeq));
|
||||
|
||||
refineSerach (matchArguments(move(argSeq)));
|
||||
evaluateQuery ("match-arguments("+argList+")");
|
||||
refineSerach_matchArguments (stringify<ArgSeq> (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<RExSeq> (regExps...)));
|
||||
evaluateQuery ("match-args-RegExp("+util::join(stringify<ArgSeq>(regExps...))+")");
|
||||
refineSerach_matchArgsRegExp (stringify<RExSeq> (regExps...),
|
||||
util::join(stringify<ArgSeq>(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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -31666,7 +31666,7 @@
|
|||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1535939763441" ID="ID_132867774" MODIFIED="1535939780642" TEXT="muß "nur noch" Cursor gegen neue State-Core austauschen"/>
|
||||
<node CREATED="1535939781302" ID="ID_285459121" MODIFIED="1535939796824" TEXT="diese hält den Cursor plus einen Stack mit den Filtern"/>
|
||||
<node COLOR="#338800" CREATED="1537058259201" ID="ID_1249469718" MODIFIED="1537320125432" TEXT="Anpassungen">
|
||||
<node COLOR="#338800" CREATED="1537058259201" FOLDED="true" ID="ID_1249469718" MODIFIED="1537320577437" TEXT="Anpassungen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#338800" CREATED="1537058272183" ID="ID_1629184923" MODIFIED="1537059375100" TEXT="Alles per Filter-Chain machen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
|
|
@ -31769,7 +31769,7 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1537059388025" ID="ID_1276869558" MODIFIED="1537320123695" TEXT="Tests scheitern...">
|
||||
<node COLOR="#338800" CREATED="1537059388025" FOLDED="true" ID="ID_1276869558" MODIFIED="1537320566920" TEXT="Tests scheitern...">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#338800" CREATED="1537059395184" ID="ID_77123611" MODIFIED="1537316730803" TEXT="EventLog_test">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
|
|
@ -31920,8 +31920,8 @@
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1536368106394" ID="ID_1324169393" MODIFIED="1536368114930" TEXT="in eigene Translation-Unit verschieben">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1536368106394" ID="ID_1324169393" MODIFIED="1537400207423" TEXT="in eigene Translation-Unit verschieben">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node CREATED="1537059357301" ID="ID_1501687281" MODIFIED="1537059360761" TEXT="Beobachtungen">
|
||||
<node CREATED="1536368121224" ID="ID_684768731" MODIFIED="1536368139195">
|
||||
<richcontent TYPE="NODE"><html>
|
||||
|
|
@ -31953,10 +31953,10 @@
|
|||
</node>
|
||||
<node CREATED="1537059265873" ID="ID_798187553" MODIFIED="1537059347543" TEXT="leider merkt man aber die Umstellung auf IterChainSearch">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1536368144661" ID="ID_1266326166" MODIFIED="1537059319775" TEXT="BusTerm_test = 14.3 MB">
|
||||
<node CREATED="1536368144661" ID="ID_1266326166" MODIFIED="1537320654812" TEXT="BusTerm_test = 14.6 MB">
|
||||
<icon BUILTIN="smiley-oh"/>
|
||||
</node>
|
||||
<node CREATED="1536368166242" ID="ID_1222359374" MODIFIED="1537059337516" TEXT="EventLog_test = 7.4 MB">
|
||||
<node CREATED="1536368166242" ID="ID_1222359374" MODIFIED="1537320670162" TEXT="EventLog_test = 7.8 MB">
|
||||
<icon BUILTIN="smiley-angry"/>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -31966,7 +31966,8 @@
|
|||
<node CREATED="1537059868337" ID="ID_138143272" MODIFIED="1537059878979" TEXT="es kann daher ein direktes Objektfeld bleiben"/>
|
||||
<node CREATED="1537059879759" ID="ID_893108945" MODIFIED="1537059904472" TEXT="alle Suchprädikate sind Lambdas -> Template Argumente"/>
|
||||
<node CREATED="1537059905107" ID="ID_133126017" MODIFIED="1537059924085" TEXT="d.h. auch die Such-Funktionen müssen nach hinten in das CPP gedrückt werden"/>
|
||||
<node CREATED="1537059925313" ID="ID_1283278546" MODIFIED="1537059940483" TEXT="Problem Var-Arg">
|
||||
<node COLOR="#338800" CREATED="1537059925313" ID="ID_1283278546" MODIFIED="1537400192425" TEXT="Problem Var-Arg">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1537059941287" ID="ID_1072965326" MODIFIED="1537059944938" TEXT="Argument-Match"/>
|
||||
<node CREATED="1537059945310" ID="ID_1104771437" MODIFIED="1537059950057" TEXT="RegExp-Sequenz"/>
|
||||
<node CREATED="1537059950597" ID="ID_1688685593" MODIFIED="1537059976646" TEXT="beide erzeugen aber einen STL-container als Intermediary">
|
||||
|
|
@ -31975,8 +31976,8 @@
|
|||
<node CREATED="1537059978146" ID="ID_1403964414" MODIFIED="1537059984405" TEXT="d.h. man kann dazwischen schneiden"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1537059994048" ID="ID_1556879726" MODIFIED="1537059997529" TEXT="Umbau">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1537059994048" ID="ID_1556879726" MODIFIED="1537400219755" TEXT="Umbau">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1537060007341" ID="ID_137118669" MODIFIED="1537060024165" TEXT="eigene Translation-Unit EventLog.cpp anlegen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
|
|
|
|||
Loading…
Reference in a new issue