本文整理汇总了C++中ParameterData::size方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterData::size方法的具体用法?C++ ParameterData::size怎么用?C++ ParameterData::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterData
的用法示例。
在下文中一共展示了ParameterData::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, const char* argv[]) {
DaidalusBatch walker;
int a;
std::string config = "";
std::string output = "";
std::string options = "";
ParameterData params;
int precision = 6;
for (a=1;a < argc && argv[a][0]=='-'; ++a) {
std::string arga = argv[a];
options += arga + " ";
if (walker.processOptions(argv,a)) {
++a;
options += walker.getOptionsString();
} if (arga == "--help" || arga == "-help" || arga == "-h") {
DaidalusBatch::printHelpMsg();
} else if (startsWith(arga,"--conf") || startsWith(arga,"-conf") || arga == "-c") {
config = argv[++a];
arga = argv[a];
options += arga + " ";
} else if (startsWith(arga,"--out") || startsWith(arga,"-out") || arga == "-o") {
output = argv[++a];
arga = argv[a];
} else if (arga == "--verbose" || arga == "-verbose" || arga == "-v") {
walker.verbose = true;
} else if (arga == "--raw" || arga == "-raw" || arga == "-r") {
walker.raw = true;
} else if (arga == "--pvs" || arga == "-pvs") {
walker.format = PVS;
} else if (startsWith(arga,"--proj") || startsWith(arga,"-proj")) {
++a;
walker.prj_t = Util::parse_double(argv[a]);
options += arga+" ";
} else if (startsWith(arga,"-") && arga.find('=') != std::string::npos) {
std::string keyval = arga.substr(arga.find_last_of('-')+1);
params.set(keyval);
} else if (argv[a][0] == '-') {
std::cout << "Invalid option: " << arga << std::endl;
exit(0);
}
}
std::vector<std::string> txtFiles = std::vector<std::string>();
for (;a < argc; ++a) {
std::string arga(argv[a]);
txtFiles.push_back(arga);
}
if (txtFiles.empty()) {
walker.printHelpMsg();
}
std::ofstream fout;
if (output != "") {
fout.open(output.c_str());
walker.out = &fout;
}
Daidalus daa;
if (config != "") {
daa.parameters.loadFromFile(config);
}
if (params.size() > 0) {
daa.parameters.setParameters(params);
}
switch (walker.format) {
case STANDARD:
if (walker.verbose) {
(*walker.out) << "# " << Daidalus::release() << std::endl;
(*walker.out) << "# Options: " << options << std::endl;
(*walker.out) << "#\n" << daa.toString() << "#\n" << std::endl;
}
break;
case PVS:
(*walker.out) << "%%% " << Daidalus::release() << std::endl;
(*walker.out) << "%%% Options: " << options << std::endl;
(*walker.out) << "%%% Parameters:\n"+daa.parameters.toPVS(precision) << std::endl;
break;
default:
break;
}
for (unsigned int i=0; i < txtFiles.size(); ++i) {
std::string filename(txtFiles[i]);
switch (walker.format) {
case STANDARD:
(*walker.out) << "# File: "<< filename << std::endl;
break;
case PVS:
(*walker.out) << "%%% File: " << filename << std::endl;
break;
default:
break;
}
walker.processFile(filename,daa);
}
if (output != "") {
fout.close();
}
}//main