| 22 | { |
| 23 | |
| 24 | void validateRequiredAttributesExist(std::set<std::string> requiredFieldNames, PluginFieldCollection const* fc) |
| 25 | { |
| 26 | for (int32_t i = 0; i < fc->nbFields; i++) |
| 27 | { |
| 28 | requiredFieldNames.erase(fc->fields[i].name); |
| 29 | } |
| 30 | if (!requiredFieldNames.empty()) |
| 31 | { |
| 32 | std::stringstream msg{}; |
| 33 | msg << "PluginFieldCollection missing required fields: {"; |
| 34 | char const* separator = ""; |
| 35 | for (auto const& field : requiredFieldNames) |
| 36 | { |
| 37 | msg << separator << field; |
| 38 | separator = ", "; |
| 39 | } |
| 40 | msg << "}"; |
| 41 | std::string msg_str = msg.str(); |
| 42 | PLUGIN_ERROR(msg_str.c_str()); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | } // namespace plugin |
| 47 | } // namespace nvinfer1 |
no test coverage detected