本文整理汇总了C++中CommandList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ CommandList::push_back方法的具体用法?C++ CommandList::push_back怎么用?C++ CommandList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandList
的用法示例。
在下文中一共展示了CommandList::push_back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
int retval = 0;
list<Command *> matchingCommands;
list<Command *>::const_iterator ci;
Command *cmd;
binaryBaseName = basename(argv[0]);
commandList.push_back(new CommandAlias());
commandList.push_back(new CommandConfig());
commandList.push_back(new CommandCStruct());
commandList.push_back(new CommandData());
commandList.push_back(new CommandDebug());
commandList.push_back(new CommandDomains());
commandList.push_back(new CommandDownload());
#ifdef EC_EOE
commandList.push_back(new CommandEoe());
#endif
commandList.push_back(new CommandFoeRead());
commandList.push_back(new CommandFoeWrite());
commandList.push_back(new CommandGraph());
commandList.push_back(new CommandMaster());
commandList.push_back(new CommandPdos());
commandList.push_back(new CommandRegRead());
commandList.push_back(new CommandRegWrite());
commandList.push_back(new CommandRescan());
commandList.push_back(new CommandSdos());
commandList.push_back(new CommandSiiRead());
commandList.push_back(new CommandSiiWrite());
commandList.push_back(new CommandSlaves());
commandList.push_back(new CommandSoeRead());
commandList.push_back(new CommandSoeWrite());
commandList.push_back(new CommandStates());
commandList.push_back(new CommandUpload());
commandList.push_back(new CommandVersion());
commandList.push_back(new CommandXml());
getOptions(argc, argv);
matchingCommands = getMatchingCommands(commandName);
if (matchingCommands.size()) {
if (matchingCommands.size() == 1) {
cmd = matchingCommands.front();
if (!helpRequested) {
try {
cmd->setMasters(masters);
cmd->setVerbosity(verbosity);
cmd->setAliases(aliases);
cmd->setPositions(positions);
cmd->setDomains(domains);
cmd->setDataType(dataTypeStr);
cmd->setOutputFile(outputFile);
cmd->setSkin(skin);
cmd->setForce(force);
cmd->execute(commandArgs);
} catch (InvalidUsageException &e) {
cerr << e.what() << endl << endl;
cerr << cmd->helpString(binaryBaseName);
retval = 1;
} catch (CommandException &e) {
cerr << e.what() << endl;
retval = 1;
} catch (MasterDeviceException &e) {
cerr << e.what() << endl;
retval = 1;
}
} else {
cout << cmd->helpString(binaryBaseName);
}
} else {
cerr << "Ambiguous command abbreviation! Matching:" << endl;
for (ci = matchingCommands.begin();
ci != matchingCommands.end();
ci++) {
cerr << (*ci)->getName() << endl;
}
cerr << endl << usage();
retval = 1;
}
} else {
cerr << "Unknown command " << commandName << "!" << endl
<< endl << usage();
retval = 1;
}
return retval;
}