本文整理汇总了C++中Application::Lookup方法的典型用法代码示例。如果您正苦于以下问题:C++ Application::Lookup方法的具体用法?C++ Application::Lookup怎么用?C++ Application::Lookup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::Lookup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrepareRequest
bool FlowController::PrepareRequest(Context &ctx) {
StartTrace(FlowController.PrepareRequest);
long reqNr = GetRequestNr(ctx);
// number of runs of pre depends on number of slots in anything
long nrOfPreRunRequests = fConfig["PreRun"].GetSize();
Anything tmpStore = ctx.GetTmpStore();
Anything flowState = tmpStore["FlowState"];
if (!flowState["PreRunDone"].AsBool(1)) {
Trace("PRE RUN NOT DONE ");
if (reqNr < nrOfPreRunRequests) {
DoPrepare(tmpStore, fConfig["PreRun"][reqNr]);
flowState["RequestNr"] = ++reqNr;
TraceAny(tmpStore["FlowState"], "Flow State on exit");
return true;
} else {
// PreRun done , reset for normal run
reqNr = 0;
flowState["RunNr"] = 0L;
flowState["PreRunDone"] = true;
}
}
long nrOfRuns = 0;
String appName;
Application *application = Application::GetGlobalApplication(appName);
if (application) {
nrOfRuns = application->Lookup("NumberOfRuns", fConfig["NumberOfRuns"].AsLong(1));
Trace(appName << " application found" );
} else {
nrOfRuns = fConfig["NumberOfRuns"].AsLong(1);
}
long runNr = flowState["RunNr"].AsLong(0);
Trace("INIT Number of Run: " << runNr << " of " << nrOfRuns);
while (runNr < nrOfRuns) { // loop thru steps and incr. runNr after each batch has been processed
Trace("Number of Run: " << runNr << " of " << nrOfRuns);
TraceAny(fConfig["Run"], "Config Run");
long nrOfRequests = fConfig["Run"].GetSize();
if (reqNr < nrOfRequests) {
DoPrepare(tmpStore, fConfig["Run"][reqNr]);
flowState["RequestNr"] = ++reqNr;
TraceAny(tmpStore, "tmpStore on exit");
TraceAny(tmpStore["FlowState"], "Flow State on exit");
return true;
}
reqNr = 0; // reset request number
flowState["RunNr"] = ++runNr;
}
TraceAny(tmpStore["FlowState"], "Flow State on exit with false");
return false;
}