4#ifndef LODESTONE_IORELATIONS_H
5#define LODESTONE_IORELATIONS_H
19 template<const common::registry::Identifier *_InternalIdentifier,
typename _Type, const common::registry::Identifier *_RegistryIdentifier,
typename _Registry>
27 template <
typename... C>
32 static_assert((std::is_same_v<T, typename C::Type> || ...),
"Given type was never registered in this relation");
34 return (C::Registry::getInstance().
template getAs<T>(*identifier), ...);
37 template<
typename T, const common::registry::Identifier *_InternalIdentifier>
39 static_assert(((_InternalIdentifier == C::InternalIdentifier) || ...),
"Given identifier was never registered in this relation");
40 static_assert((std::is_same_v<T, typename C::Type> || ...),
"Given type was never registered in this relation");
45 template<const common::registry::Identifier *_InternalIdentifier>
47 static_assert(((_InternalIdentifier == C::InternalIdentifier) || ...),
"Given identifier was never registered in this relation");
49 return (C::Registry::getInstance().get(*C::RegistryIdentifier), ...);
59 if constexpr (_InternalIdentifier == Current::InternalIdentifier) {
60 static_assert(std::is_same_v<T, typename Current::Type>,
"Wrong type for given identifier");
63 return Current::Registry::getInstance().template getAs<T>(*Current::RegistryIdentifier);
65 if constexpr (
sizeof...(Rest) <= 0) {
67 static_assert(
sizeof...(Rest) > 0,
"Given identifier was never registered in this relation");
72 return getInternal<T, _InternalIdentifier, Rest...>();
Definition RegistryRelations.h:28
T * getAsByRelation() const
Definition RegistryRelations.h:38
T * getAsByRelation(const common::registry::Identifier *identifier) const
Definition RegistryRelations.h:31
T * getInternal() const
Definition RegistryRelations.h:57
io::IObjectIO * getByRelation(const common::registry::Identifier *identifier) const
Definition RegistryRelations.h:52
io::IObjectIO * getByRelation() const
Definition RegistryRelations.h:46
Definition AbstractObjectIo.h:20
Definition Registries.cpp:14
Definition IObjectIo.h:10
Definition RegistryRelations.h:20
_Registry Registry
Definition RegistryRelations.h:24
static constexpr const common::registry::Identifier * RegistryIdentifier
Definition RegistryRelations.h:22
static constexpr const common::registry::Identifier * InternalIdentifier
Definition RegistryRelations.h:21
_Type Type
Definition RegistryRelations.h:23