本文整理汇总了C++中Simulator::configure方法的典型用法代码示例。如果您正苦于以下问题:C++ Simulator::configure方法的具体用法?C++ Simulator::configure怎么用?C++ Simulator::configure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simulator
的用法示例。
在下文中一共展示了Simulator::configure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static void
simulate(const Settings &settings, const std::vector<std::string> &args, char *envp[]) {
// Create and configure simulator
Simulator sim;
if (settings.usingDebugger)
RSIM_Debugger::attach(sim);
sim.configure(settings.simSettings, envp);
// Load specimen directly or via debugger
pid_t existingPid = -1;
char *rest = NULL;
errno = 0;
if (args.size()==1 && (existingPid=strtoul(args.front().c_str(), &rest, 0))>=0 && !errno && !*rest) {
if (sim.loadSpecimen(existingPid) < 0)
return;
} else {
if (sim.loadSpecimen(args) < 0)
return;
}
// Run the simulation
if (settings.catchingSignals)
sim.activate();
sim.main_loop();
if (settings.catchingSignals)
sim.deactivate();
std::cerr <<sim.describe_termination() <<"\n";
sim.terminate_self(); // probably doesn't return
}
示例2:
static void
simulate(const Settings &settings, const std::vector<std::string> &args, char *envp[]) {
Simulator sim;
if (settings.usingDebugger)
RSIM_Debugger::attach(sim);
sim.configure(settings.simSettings, envp);
if (sim.loadSpecimen(args) < 0)
return;
if (settings.catchingSignals)
sim.activate();
sim.main_loop();
if (settings.catchingSignals)
sim.deactivate();
std::cerr <<sim.describe_termination() <<"\n";
sim.terminate_self(); // probably doesn't return
}