示例#1
0
      void add(ModelPtr model)
      {
        auto it = models.at(model->get_id());

        if (it == models.end())
        {
          models.emplace(model->get_id(), model);
          added.trigger(*model);
        }
      }
示例#2
0
      void remove(ModelPtr model)
      {
        auto it = models.at(model->get_id());

        if (it != models.end())
        {
          models.erase(it);
          removed.trigger(*model);
        }
      }