18#ifndef TRINITY_TYPECONTAINER_H
19#define TRINITY_TYPECONTAINER_H
29template <
template <
typename>
typename UnderlyingContainer,
typename... Types>
35template <
template <
typename>
typename UnderlyingContainer,
typename First,
typename... Rest>
38 typename UnderlyingContainer<First>::Container
Head;
41 template <
typename ObjectType>
44 if constexpr (std::is_same_v<First, ObjectType>)
47 return Tail.template FindContainer<ObjectType>();
50 template <
typename ObjectType>
51 typename UnderlyingContainer<ObjectType>::Container
const&
FindContainer()
const
53 if constexpr (std::is_same_v<First, ObjectType>)
56 return Tail.template FindContainer<ObjectType>();
60template <
template <
typename>
typename UnderlyingContainer,
typename... Types>
65 template <
typename ObjectType>
68 template <
typename ObjectType>
69 using ValueType =
typename UnderlyingContainer<ObjectType>::ValueType;
71 template <
typename ObjectType>
requires TypeExists<ObjectType>
74 return UnderlyingContainer<ObjectType>::Insert(
Data.template FindContainer<ObjectType>(),
object);
77 template <
typename ObjectType>
requires TypeExists<ObjectType>
80 return UnderlyingContainer<ObjectType>::Remove(
Data.template FindContainer<ObjectType>(),
object);
83 template <
typename ObjectType>
requires TypeExists<ObjectType>
86 return UnderlyingContainer<ObjectType>::Size(
Data.template FindContainer<ObjectType>());
89 template <
typename ObjectType>
requires TypeExists<ObjectType> &&
requires {
typename UnderlyingContainer<ObjectType>::KeyType; }
92 return UnderlyingContainer<ObjectType>::Find(
Data.template FindContainer<ObjectType>(), key);
constexpr bool has_type_in_list_v
TypeListContainerStorage< UnderlyingContainer, Rest... > Tail
UnderlyingContainer< ObjectType >::Container const & FindContainer() const
UnderlyingContainer< First >::Container Head
UnderlyingContainer< ObjectType >::Container & FindContainer()
TypeListContainerStorage< UnderlyingContainer, Types... > Data
ValueType< ObjectType > Find(typename UnderlyingContainer< ObjectType >::KeyType const &key) const
bool Insert(ValueType< ObjectType > object)
typename UnderlyingContainer< ObjectType >::ValueType ValueType
static constexpr bool TypeExists
bool Remove(ValueType< ObjectType > object)