void add(ModelPtr model) { auto it = models.at(model->get_id()); if (it == models.end()) { models.emplace(model->get_id(), model); added.trigger(*model); } }
void remove(ModelPtr model) { auto it = models.at(model->get_id()); if (it != models.end()) { models.erase(it); removed.trigger(*model); } }