47 {
48 size_t i;
49 map<string, vector<AlgorithmDefinition>>::const_iterator aptr;
50 aptr = algs.find(name);
51 if (aptr == algs.end()) {
52
53
54
55 return AlgorithmDefinition(name, "UNDEFINED", "UNDEFINED", "UNDEFINED");
56 } else {
57 i = instance;
58 if (instance >= (aptr->second.size())) {
59 cerr << "ProcessManager::algorithm(Warning): "
60 << "algorithm=" << name
61 << " was defined but requested instance=" << instance
62 << " exceeds number of defined instances=" << aptr->second.size()
63 << endl
64 << "Set to id for instance=" << aptr->second.size() - 1 << endl
65 << "History data may be invalid" << endl;
66 i = aptr->second.size() - 1;
67 }
68 }
69 return aptr->second[i];
70}