本文整理汇总了C++中ArgumentParser::parseArgs方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgumentParser::parseArgs方法的具体用法?C++ ArgumentParser::parseArgs怎么用?C++ ArgumentParser::parseArgs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgumentParser
的用法示例。
在下文中一共展示了ArgumentParser::parseArgs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
ArgumentParser argParser;
if(!argParser.parseArgs(argc, argv))
{
Logger::ERROR("Invalid arguments provided!");
Logger::ERROR(argParser.getUsage());
return 1;
}
Config* config = Config::getConfig();
config->testnodePrioritySwitcher = new PrioritySwitcher(0, config->fifoScheduling);
if(!setProcessPriority())
{
Logger::ERROR("Couldn't set priority appropriately, maybe not running as root?");
return 1;
}
ros::init(argc, argv, "oneshot_timer_tests");
config->nodeHandle = new ros::NodeHandle;
Logger::INFO("Performing ROS Timer latency measurements...");
OneShotLatencyMeasurer* measurer;
if(config->busyMode)
{
Logger::INFO("Running in busy mode");
measurer = new BusyOneShotLatencyMeasurer();
} else {
Logger::INFO("Running in default mode");
measurer = new IdleOneShotLatencyMeasurer();
}
measurer->measure();
measurer->printMeasurementResults();
measurer->saveMeasuredLatencyGnuplotData();
return 0;
}
示例2: main
int main(int argc, char **argv)
{
initArgs();
args.parseArgs(argc, argv);
TypeVec types = getTypes();
SquareSelector<double> coordCutoffs = getCoordCutoffs(types);
Atom *atoms;
if (args.getStandaloneCount() != 1)
{
cerr << "no input file. See --help for help" << endl;
exit(1);
}
const char *filename = args.getCStandalone(0);
const double globalCutoff = args.getDouble("cutoff");
double *spaceSize = NULL;
int numatoms = readFile(filename, &types, &atoms, &spaceSize);
saveAtomTypes(types);
writeInteratomics(atoms, numatoms, globalCutoff, types, spaceSize,
coordCutoffs);
if (spaceSize)
{
delete[] spaceSize;
spaceSize = NULL;
}
return 0;
}
示例3: main
int main(int argc, char* argv[])
{
Config* config = Config::getConfig();
ArgumentParser argParser;
if(!argParser.parseArgs(argc, argv))
{
argParser.printUsage();
return 1;
}
if(config->rtPrio)
{
PrioritySwitcher prioSwitcher(config->fifoScheduling);
if(prioSwitcher.switchToRealtimePriority() != 0)
{
Logger::ERROR("Switching to realtime priority failed, maybe not running as root?");
return 1;
}
}
ros::init(argc, argv, "communication_tests_subscriber");
config->nodeHandle = new ros::NodeHandle();
Subscriber subscriber("communication_tests");
subscriber.startMeasurement();
subscriber.printMeasurementResults();
subscriber.saveGnuplotData();
return 0;
}