Lodestone.Conversion
Loading...
Searching...
No Matches
SimpleRegistry.h
Go to the documentation of this file.
1//
2// Created by DexrnZacAttack on 2/14/26 using zPc-i2.
3//
4#ifndef LODESTONE_SIMPLEREGISTRY_H
5#define LODESTONE_SIMPLEREGISTRY_H
8
11
13
15#include <stdexcept>
16#include <format>
17
19 template <const common::registry::Identifier *Identifier, typename Type, typename Stored = std::unique_ptr<const Type>>
21 protected:
22 SimpleRegistry() = default;
23 public:
24 //hopefully this will save more than the hours of debugging that I spent
26
28 Stored io);
29
30 const Type *get(common::registry::Identifier id) const;
31
32 template <typename R>
33 requires std::is_base_of_v<Type, R>
35
36 template <typename R>
37 requires std::is_base_of_v<Type, R>
38 && std::is_base_of_v<common::registry::IIdentifiable, R>
43 private:
45 Stored>
47 };
48
50}
51
52#endif // LODESTONE_SIMPLEREGISTRY_H
#define LODESTONE_API
gtl::flat_hash_map< T... > map_t
const R * getOfType() const
Definition SimpleRegistry.h:40
void put(const common::registry::Identifier &id, Stored io)
Definition SimpleRegistry.h:9
common::event::Event< common::registry::Identifier > objectRegisteredEvent
Definition SimpleRegistry.h:42
const Type * get(common::registry::Identifier id) const
Definition SimpleRegistry.h:21
SimpleRegistry(SimpleRegistry &rhs)=delete
const R * getAs(common::registry::Identifier id) const
Definition SimpleRegistry.h:33
map_t< common::registry::Identifier, Stored > m_registry
Definition SimpleRegistry.h:46
Definition AbstractObjectIo.h:20
Definition Registries.cpp:14