diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-03-24 23:49:26 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-03-24 23:49:26 +0100 |
commit | 00c0d78199fcfbbb20828be5e06fd2d271fa4c1e (patch) | |
tree | e74aa52990af33f7bf1e4d452b464c3e24d1017e /deimos/core/api_registry.h |
Initial commit
Diffstat (limited to 'deimos/core/api_registry.h')
-rw-r--r-- | deimos/core/api_registry.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/deimos/core/api_registry.h b/deimos/core/api_registry.h new file mode 100644 index 0000000..2624935 --- /dev/null +++ b/deimos/core/api_registry.h @@ -0,0 +1,30 @@ +#pragma once
+
+#include "deimos/core/base.h"
+#include "deimos/core/id_name.h"
+
+namespace deimos
+{
+
+class ApiRegistry
+{
+public:
+ ApiRegistry() = default;
+
+ deimos_NO_COPY_MOVE(ApiRegistry);
+
+ virtual ~ApiRegistry() = default;
+
+ virtual void Set(const IdName&, void* impl) = 0;
+
+ template<typename Api>
+ void Set(Api* impl)
+ {
+ Set(Api::kApiName, impl);
+ }
+};
+
+ApiRegistry* InitializeGlobalApiRegistry();
+
+} // namespace deimos
+
|