| 19 | } |
| 20 | |
| 21 | void Plugin::addModel(Model* model) { |
| 22 | // Check that the model is not added to a plugin already |
| 23 | assert(!model->plugin); |
| 24 | model->plugin = this; |
| 25 | models.push_back(model); |
| 26 | } |
| 27 | |
| 28 | Model* Plugin::getModel(const std::string& slug) { |
| 29 | auto it = std::find_if(models.begin(), models.end(), [&](Model* m) { |