1 #ifndef BLANK_MODEL_MODELREGISTRY_HPP_
2 #define BLANK_MODEL_MODELREGISTRY_HPP_
18 using size_type = std::size_t;
19 using reference = Model &;
20 using const_reference = const Model &;
25 reference Add(const std::string &);
27 size_type size() const noexcept { return models.size(); }
30 reference operator[](size_type i) noexcept { return *models[i]; }
31 const_reference operator[](size_type i) const noexcept { return *models[i]; }
33 reference Get(std::uint16_t i) { return *models[i - 1]; }
34 const_reference Get(std::uint16_t i) const { return *models[i - 1]; }
36 reference Get(const std::string &);
37 const_reference Get(const std::string &) const;
40 std::vector<std::unique_ptr<Model>> models;
41 std::map<std::string, Model *> name_index;