25 std::string_view name_,
26 std::string_view description_) :
49 template<
typename... Args>
50 requires std::constructible_from<
value_type, Args&&...>
61 if (i >= registry.
size()) {
62 throw std::out_of_range{
"attempted to access an out-of-bounds registry entry"};
70 if (
auto i =
IndexOf(registry, el)) {
74 throw std::out_of_range{
"attempted to get an element from the registry that does not exist"};
81 if (
auto i =
IndexOf(registry, componentClassName)) {
85 throw std::out_of_range{
"attempted to get an element from a component registry that does not exist"};
Definition component_registry_base.h:20
reference emplace_back_erased(Args &&... args)
Definition component_registry_base.h:47
size_type size() const
Definition component_registry_base.h:33
Definition component_registry_entry.h:12
Definition component_registry.h:17
const_iterator begin() const
Definition component_registry.h:31
const_reference operator[](size_t pos) const
Definition component_registry.h:43
ComponentRegistryEntry< T > value_type
Definition component_registry.h:19
ComponentRegistry(std::string_view name_, std::string_view description_)
Definition component_registry.h:24
const_iterator end() const
Definition component_registry.h:37
const_reference emplace_back(Args &&... args)
Definition component_registry.h:51
Definition component_registry.h:14
const ComponentRegistryEntry< T > & At(const ComponentRegistry< T > ®istry, size_t i)
Definition component_registry.h:59
std::optional< size_t > IndexOf(const ComponentRegistryBase &, std::string_view componentClassName)
const ComponentRegistryEntry< T > & Get(ComponentRegistry< T > const ®istry, const T &el)
Definition component_registry.h:68