| 65 | } |
| 66 | |
| 67 | void ToolDescription::append(const ToolDescription& other) |
| 68 | { |
| 69 | // sanity check |
| 70 | if (is_internal != other.is_internal |
| 71 | || name != other.name |
| 72 | //|| category != other.category |
| 73 | || (is_internal && !external_details.empty()) |
| 74 | || (other.is_internal && !other.external_details.empty()) |
| 75 | || (!is_internal && external_details.size() != types.size()) |
| 76 | || (!other.is_internal && other.external_details.size() != other.types.size()) |
| 77 | ) |
| 78 | { |
| 79 | throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Extending (external) ToolDescription failed!", ""); |
| 80 | } |
| 81 | |
| 82 | // append types and external information |
| 83 | types.insert(types.end(), other.types.begin(), other.types.end()); |
| 84 | external_details.insert(external_details.end(), other.external_details.begin(), other.external_details.end()); |
| 85 | |
| 86 | // check that types are unique |
| 87 | std::set<String> unique_check; |
| 88 | unique_check.insert(types.begin(), types.end()); |
| 89 | if (unique_check.size() != types.size()) |
| 90 | { |
| 91 | OPENMS_LOG_ERROR << "A type appears at least twice for the TOPP tool '" << name << "'. Types given are '" << ListUtils::concatenate(types, ", ") << "'\n"; |
| 92 | if (name == "GenericWrapper") |
| 93 | { |
| 94 | OPENMS_LOG_ERROR << "Check the .ttd files in your share/ folder and remove duplicate types!\n"; |
| 95 | } |
| 96 | throw Exception::InvalidValue(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "see above!", ""); |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | Internal::ToolDescription bla; |