本文整理汇总了C++中ModuleManager::getModuleMetaData方法的典型用法代码示例。如果您正苦于以下问题:C++ ModuleManager::getModuleMetaData方法的具体用法?C++ ModuleManager::getModuleMetaData怎么用?C++ ModuleManager::getModuleMetaData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleManager
的用法示例。
在下文中一共展示了ModuleManager::getModuleMetaData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
// run a single module.
// ./uipf <moduleName> ...options...
if (vm.count("version")) {
cout << "Version: 1.0" << "\n";
return 0;
}
if (vm.count("help")) {
cout << "Usage:" << endl;
cout << argv[0] << " -c <path to configuration file> run a processing chain from a config file." << endl;
cout << argv[0] << " <moduleName> -i <input> [-p <params> -o <output>] run a single module." << endl;
cout << "\n";
cout << visibleOptions;
return 0;
}
if (!vm.count("modulename") || !vm.count("input")){
std::cerr << "Usage Error!\n\n";
cout << "Usage:" << endl;
cout << argv[0] << " -c <path to configuration file> run a processing chain from a config file." << endl;
cout << argv[0] << " <moduleName> -i <input> [-p <params> -o <output>] run a single module." << endl;
cout << "\n";
// show help
cout << visibleOptions;
return 1;
}
string modName = vm["modulename"].as<string>();
if (!mm.hasModule(modName)) {
LOG_E("Module " + modName + " does not exist!");
return 1;
}
MetaData md = mm.getModuleMetaData(modName);
ProcessingStep processModule;
processModule.name = "processModule";
processModule.module = modName;
if (vm.count("input")) {
vector<string> inputs = vm["input"].as< vector<string> >();
// this step is repeated as often, as the number of load modules is created
for (unsigned int i=0; i<inputs.size(); i++){
ProcessingStep loadModule;
loadModule.name = "loadModule" + to_string(i);
loadModule.module = "loadImage";
string source = utils::secondPart(inputs[i]);
loadModule.params.insert (pair<string,string>("filename",source) );
conf.addProcessingStep(loadModule);
// the input params of the module are set
map<string, DataDescription> in = md.getInputs();
string name;
// if there is only one input, the name is optional on the command line, will be taken from metadata
if (in.size() == 1) {
auto it = in.cbegin();
name = it->first;
} else {
name = utils::firstPart(inputs[i]);
}
pair<string,string> loadWithValue(loadModule.name, "image");
processModule.inputs.insert(pair<string, pair<string, string> >(name, loadWithValue));