ECSTASY
All in the name
Loading...
Searching...
No Matches
Registry.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_REGISTRY_REGISTRY_HPP_
13#define ECSTASY_REGISTRY_REGISTRY_HPP_
14
15#include <optional>
16#include <span>
17
31#include "util/Allocator.hpp"
33#include "util/meta/apply.hpp"
34#include "util/meta/filter.hpp"
40
41#ifdef _MSC_VER
42 #define NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
43#else
44 #define NO_UNIQUE_ADDRESS [[no_unique_address]]
45#endif
46
47namespace ecstasy
48{
49
62 template <typename R, bool AutoLock = thread::AUTO_LOCK_RESOURCES_DEFAULT>
65 template <typename R, bool AutoLock = thread::AUTO_LOCK_RESOURCES_DEFAULT>
67
74 struct EmptyType {};
75
82 class Registry {
83 public:
95 template <typename C>
96 [[nodiscard]] constexpr getStorageType<C> &getQueryable()
97 {
98 return getStorageSafe<C>();
99 }
100
102 template <std::derived_from<IResource> R>
103 requires query::Queryable<R>
104 [[nodiscard]] constexpr R &getQueryable()
105 {
106 return getResource<R, false>();
107 }
108
110 template <IsStorage S>
111 requires query::Queryable<S>
112 [[nodiscard]] S &getQueryable()
113 {
114 if (!_storages.contains<std::remove_const_t<S>>()) [[unlikely]]
115 return _storages.emplace<std::remove_const_t<S>>();
116 return _storages.get<std::remove_const_t<S>>();
117 }
118
130 template <typename C>
131 [[nodiscard]] constexpr getStorageType<C> &getFromType()
132 {
133 return getStorageSafe<C>();
134 }
135
137 template <IsStorage S>
138 [[nodiscard]] S &getFromType()
139 {
140 return _storages.get<std::remove_const_t<S>>();
141 }
142
144 template <std::derived_from<IResource> R>
145 [[nodiscard]] constexpr R &getFromType()
146 {
147 return getResource<R, false>();
148 }
149
151 template <std::derived_from<ISystem> S>
152 [[nodiscard]] constexpr S &getFromType()
153 {
154 return getSystem<S>();
155 }
156
158 template <std::derived_from<Registry> R>
159 [[nodiscard]] constexpr R &getFromType() noexcept
160 {
161 return *this;
162 }
163
172 template <typename Operands>
174
183 template <query::Queryable... Qs>
184 struct GetModifierProxy<util::meta::Traits<Qs...>> {
200 template <query::Modifier M, typename ModifierAllocator>
201 [[nodiscard]] static constexpr M &get(Registry &registry, ModifierAllocator &allocator)
202 {
203 return allocator.template instanciate<M>(
204 getRegistryQueryable<Qs, ModifierAllocator>(registry, allocator)...);
205 }
206
207 private:
222 template <typename Q, typename ModifierAllocator>
223 [[nodiscard]] static constexpr Q &getRegistryQueryable(Registry &registry, ModifierAllocator &allocator)
224 {
226 return registry.getQueryable<Q, ModifierAllocator>(allocator);
227 else
228 return registry.getQueryable<Q>();
229 }
230 };
231
233 template <query::Modifier M, typename ModifierAllocator>
234 [[nodiscard]] constexpr M &getQueryable(ModifierAllocator &allocator)
235 {
236 return GetModifierProxy<typename M::Operands>::template get<M, ModifierAllocator>(*this, allocator);
237 }
238
240 template <RegistryModifier M, typename ModifierAllocator>
241 [[nodiscard]] constexpr typename M::Modifier &getQueryable(ModifierAllocator &allocator)
242 {
243 return getQueryable<typename M::Modifier, ModifierAllocator>(allocator);
244 }
245
266 template <typename Selects, typename Missings, typename Conditions, bool AutoLock, typename... Cs>
268
270 template <typename... Selects, typename... Missings, typename... Conditions, bool AutoLock, typename... Cs>
271 class RegistryStackQueryMemory<util::meta::Traits<Selects...>, util::meta::Traits<Missings...>,
272 util::meta::Traits<Conditions...>, AutoLock, Cs...> {
273 public:
274 // clang-format off
281 HasModifiersAllocator::value,
284 >;
285
292 AutoLock && HasViewsAllocator::value,
295 >;
296
307 template <typename Q>
309
310 // clang-format on
311
319
333 template <typename Q>
334 [[nodiscard]] constexpr QueryableType<Q> &getQueryable(Registry &registry)
335 {
336 if constexpr (AutoLock && HasViewsAllocator::value && thread::Lockable<queryable_type_t<Q>>)
337 return _viewsAllocator.template instanciate<thread::LockableView<queryable_type_t<Q>>>(
338 getRegistryQueryable<Q>(registry));
339 else
340 return getRegistryQueryable<Q>(registry);
341 }
342
343 protected:
348
349 private:
362 template <typename Q>
363 [[nodiscard]] constexpr auto &getRegistryQueryable(Registry &registry)
364 {
365 if constexpr (HasModifiersAllocator::value && (RegistryModifier<Q> || query::Modifier<Q>))
366 return registry.getQueryable<Q, ModifiersAllocator>(_modifiersAllocator);
367 else
368 return registry.getQueryable<Q>();
369 }
370 };
371
384 template <typename Selects, typename Missings, typename Condition, typename Cs,
385 bool AutoLock = thread::AUTO_LOCK_DEFAULT>
387
388 // clang-format on
389
390 template <bool AutoLock, typename... Selects>
391 // clang-format off
393 util::meta::Traits<Selects...>,
396 AutoLock,
397 Selects...
398 >;
399
400 template <bool AutoLock, typename... Selects>
401 // clang-format off
403 util::meta::Traits<Selects...>,
406 util::meta::Traits<Selects...>,
407 AutoLock
408 >;
409 // clang-format on
410
433 template <typename... Selects, typename... Missings, typename Conditions, typename... Cs, bool AutoLock>
434 class RegistryStackQuery<util::meta::Traits<Selects...>, util::meta::Traits<Missings...>, Conditions,
435 util::meta::Traits<Cs...>, AutoLock>
436 // clang-format off
438 util::meta::Traits<Selects...>,
439 util::meta::Traits<Missings...>,
440 Conditions,
441 AutoLock,
442 Cs...>,
443 public query::QueryImplementation<util::meta::Traits<
444 typename RegistryStackQueryMemory<
445 util::meta::Traits<Selects...>,
446 util::meta::Traits<Missings...>,
447 Conditions,
448 AutoLock,
449 Cs...>::template QueryableType<Selects>...>,
450 Conditions>
451 {
452 public:
455 util::meta::Traits<Selects...>,
456 util::meta::Traits<Missings...>,
457 Conditions,
458 AutoLock,
459 Cs...>;
463 Conditions>;
464
465
475 : Memory(),
476 Base(std::move(
478 typename Memory::template QueryableType<Selects>...>::template
479 where<Conditions,
480 typename Memory::template QueryableType<Missings>...,
481 typename Memory::template QueryableType<Cs>...
482 >(
483 Memory::template getQueryable<Missings>(registry)...,
484 Memory::template getQueryable<Cs>(registry)...
485 )))
486 {
487 }
488
489 // clang-format on
490 };
491
495 template <typename... Selects, bool AutoLock>
496 class RegistryStackQuery<util::meta::Traits<Selects...>, util::meta::Traits<>, util::meta::Traits<>,
497 util::meta::Traits<Selects...>, AutoLock>
498 // clang-format off
499 : public RegistrySelectStackQueryMemory<AutoLock, Selects...>,
500 public query::Query<
501 typename RegistrySelectStackQueryMemory<AutoLock, Selects...>::template QueryableType<Selects>...
502 >
503 {
504 public:
506 using Memory = RegistrySelectStackQueryMemory<AutoLock, Selects...>;
509 typename Memory::template QueryableType<Selects>...
510 >;
511
521 : Memory(),
522 Base(Memory::template getQueryable<Selects>(registry)...)
523 {
524 }
525 };
526
527
528 public:
538 public:
547 EntityBuilder(const EntityBuilder &other) = delete;
548
565 template <typename C, typename... Qs, typename... Args>
566 EntityBuilder &with(Args &&...args)
567 {
568 _builder.with(_registry.getStorageSafe<C>(), _registry.getFromType<Qs>()..., std::forward<Args>(args)...);
569 return *this;
570 }
571
587 template <typename C>
588 requires requires() { typename C::value_type; }
590 {
592 return *this;
593 }
594
607 Entity build();
608
610 [[nodiscard]] const Entity &getEntity() const noexcept
611 {
612 return _builder.getEntity();
613 }
614
622 [[nodiscard]] constexpr const Registry &getRegistry() const noexcept
623 {
624 return _registry;
625 }
626
634 [[nodiscard]] constexpr Registry &getRegistry() noexcept
635 {
636 return _registry;
637 }
638
639 private:
644
653 EntityBuilder(Registry &registry) noexcept;
654
655 friend Registry;
656 };
657
668 template <query::Queryable... Selects>
669 class Select {
670 private:
679 template <typename T>
680 struct IsCondition : public std::is_base_of<ecstasy::query::ConditionBase, T> {};
681
690 template <typename T>
691 struct IsNotCondition : std::integral_constant<bool, !IsCondition<T>::value> {};
692
693 // clang-format off
697 template <typename... Cs>
701 util::meta::Traits<Selects...>
702 >;
704 template <typename... Cs>
707 template <typename... Cs>
710 template <typename... Cs>
712 // clang-format on
713
714 public:
723 Select(Registry &registry) noexcept : _registry(registry)
724 {
725 }
726
738 // clang-format off
739 template <typename C, typename... Cs>
740 [[nodiscard]] RegistryStackQuery<
742 MissingsTraits<C, Cs...>,
743 ConditionsTraits<C, Cs...>,
744 ComponentsTraits<C, Cs...>
745 >
747 {
748 return RegistryStackQuery<
750 MissingsTraits<C, Cs...>,
751 ConditionsTraits<C, Cs...>,
752 ComponentsTraits<C, Cs...>
753 >(_registry);
754 }
755
768 template <bool AutoLock, typename C, typename... Cs>
769 [[nodiscard]] RegistryStackQuery<
771 MissingsTraits<C, Cs...>,
772 ConditionsTraits<C, Cs...>,
773 ComponentsTraits<C, Cs...>,
774 AutoLock
775 >
777 {
778 return RegistryStackQuery<
780 MissingsTraits<C, Cs...>,
781 ConditionsTraits<C, Cs...>,
782 ComponentsTraits<C, Cs...>,
783 AutoLock
784 >(_registry);
785 }
786 // clang-format on
787
788 private:
791 };
792
802 Registry(bool addEntities = true);
803
805 ~Registry() = default;
806
815 [[nodiscard]] EntityBuilder entityBuilder() noexcept;
816
836 template <std::derived_from<ISystem> S,
837 Pipeline::PhaseId Phase = static_cast<Pipeline::PhaseId>(Pipeline::PredefinedPhases::OnUpdate),
838 typename... Args>
839 S &addSystem(Args &&...args)
840 {
841 return addSystemInPhase<S>(Phase, std::forward<Args>(args)...);
842 }
843
859 template <std::derived_from<ISystem> S, util::meta::is_size_t_convertible T, typename... Args>
860 S &addSystemInPhase(T phaseId, Args &&...args)
861 {
862 S &system = _systems.emplace<S>(std::forward<Args>(args)...);
863
864 _pipeline.addSystem(typeid(S), static_cast<size_t>(phaseId));
865 return system;
866 }
867
883 template <std::derived_from<IResource> R, typename... Args>
884 R &addResource(Args &&...args)
885 {
886 return _resources.emplace<R>(std::forward<Args>(args)...);
887 }
888
901 template <typename C>
903 {
904 return _storages.emplace<getStorageType<C>>();
905 }
906
917 template <std::derived_from<IResource> R>
918 [[nodiscard]] bool hasResource() const
919 {
920 return _resources.contains<R>();
921 }
922
936 template <std::derived_from<IResource> R, bool Locked = thread::AUTO_LOCK_RESOURCES_DEFAULT>
938 {
939 return _resources.get<R>();
940 }
941
954 template <std::derived_from<IResource> R, bool Locked = thread::AUTO_LOCK_RESOURCES_DEFAULT>
956 {
957 return _resources.get<R>();
958 }
959
972 template <typename C>
973 [[nodiscard]] const getStorageType<C> &getStorage() const
974 {
975 return _storages.get<getStorageType<C>>();
976 }
977
990 template <typename C>
992 {
994 }
995
1006 template <typename C>
1007 [[nodiscard]] getStorageType<C> &getStorageSafe() noexcept
1008 {
1009 if (!_storages.contains<std::remove_const_t<getStorageType<C>>>()) [[unlikely]]
1010 addStorage<std::remove_const_t<C>>();
1012 }
1013
1024 template <bool Locked = thread::AUTO_LOCK_RESOURCES_DEFAULT>
1026 {
1027 return _resources.get<Entities>();
1028 }
1029
1040 template <bool Locked = thread::AUTO_LOCK_RESOURCES_DEFAULT>
1042 {
1043 return _resources.get<Entities>();
1044 }
1045
1058 [[nodiscard]] Entity getEntity(Entity::Index index);
1059
1074
1087 template <std::derived_from<ISystem> S>
1088 [[nodiscard]] S &getSystem()
1089 {
1090 return _systems.get<S>();
1091 }
1092
1105 // clang-format off
1106 template <typename C, typename... Cs>
1107 [[nodiscard]] RegistrySelectStackQuery<thread::AUTO_LOCK_DEFAULT, queryable_type_t<C>, queryable_type_t<Cs>...>
1109 {
1111 }
1112
1113
1126 template <bool AutoLock, typename C, typename... Cs>
1127 [[nodiscard]] RegistrySelectStackQuery<AutoLock, queryable_type_t<C>, queryable_type_t<Cs>...>
1129 {
1131 }
1132 // clang-format on
1133
1148 template <typename C, typename... Cs>
1150 {
1152 }
1153
1164 bool eraseEntity(Entity entity);
1165
1176 size_t eraseEntities(std::span<Entity> entities);
1177
1186 void clear();
1187
1198 template <std::derived_from<ISystem> S>
1200 {
1201 _systems.get<S>().run(*this);
1202 }
1203
1212 void runSystem(const std::type_index &systemId);
1213
1223 void runSystems();
1224
1234
1243 [[nodiscard]] constexpr const Instances<IStorage> &getStorages() const noexcept
1244 {
1245 return _storages;
1246 }
1247
1256 [[nodiscard]] constexpr Instances<IStorage> &getStorages() noexcept
1257 {
1258 return _storages;
1259 }
1260
1269 [[nodiscard]] constexpr Pipeline &getPipeline() noexcept
1270 {
1271 return _pipeline;
1272 }
1273
1282 [[nodiscard]] constexpr const Pipeline &getPipeline() const noexcept
1283 {
1284 return _pipeline;
1285 }
1286
1287 private:
1296
1307 void eraseEntityComponents(Entity entity);
1308
1318 };
1319} // namespace ecstasy
1320
1321#endif /* !ECSTASY_REGISTRY_REGISTRY_HPP_ */
Definition of the Entities class.
Abstract class for all components storage.
System interface, base class of all systems.
Set of instances inheriting from the Base type.
Thread safe view of a Lockable object.
Query components presents in all given queryables.
#define NO_UNIQUE_ADDRESS
Definition Registry.hpp:44
Defines a RegistryModifier concept.
Advanced Query. It allows to select which data must be kept from a query request.
Stack Allocator.
Storage concepts and utilities.
Apply a modification on all types in a list.
Entities builder to add multiple component to an entity on creation.
Definition Entities.hpp:38
Builder & with(S &storage, Args &&...args)
Add a component to the builder target entity.
Definition Entities.hpp:68
const Entity & getEntity() const noexcept
Get a const reference to the entity being built.
Definition Entities.hpp:124
Resource holding all the Registry entities.
Definition Entities.hpp:30
Encapsulate an index to an entity.
Definition Entity.hpp:35
size_t Index
The entity identifier type.
Definition Entity.hpp:38
System interface, base class of all systems.
Definition ISystem.hpp:28
Set of instances inheriting from the Base type.
Definition Instances.hpp:32
Pipeline of systems to orchestrate the execution of systems.
Definition Pipeline.hpp:32
void addSystem(std::type_index system, PhaseId phase=static_cast< std::size_t >(PredefinedPhases::OnUpdate))
Add a system to the pipeline.
Definition Pipeline.cpp:41
Entity Builder using the registry storages.
Definition Registry.hpp:537
Entities::Builder _builder
Entities builder.
Definition Registry.hpp:643
EntityBuilder & with(std::initializer_list< typename C::value_type > list)
Add a component to the builder target entity.
Definition Registry.hpp:589
Registry & _registry
Owning registry.
Definition Registry.hpp:641
EntityBuilder(const EntityBuilder &other)=delete
Copy constructor is deleted.
constexpr Registry & getRegistry() noexcept
Get a reference to the registry.
Definition Registry.hpp:634
Entity build()
Finalize the entity, making it alive.
Definition Registry.cpp:22
const Entity & getEntity() const noexcept
Get a const reference to the entity being built.
Definition Registry.hpp:610
EntityBuilder & with(Args &&...args)
Add a component to the builder target entity.
Definition Registry.hpp:566
constexpr const Registry & getRegistry() const noexcept
Get a const reference to the registry.
Definition Registry.hpp:622
Registry query allocating everything on the stack (if allocation required).
Definition Registry.hpp:386
ecstasy::query::thread_safe_queryable_t< queryable_type_t< Q >, AutoLock > QueryableType
Get the type of a queryable in this registry query context (with or without lock).
Definition Registry.hpp:308
Base class of RegistryStackQuery.
Definition Registry.hpp:267
Proxy class to use where method.
Definition Registry.hpp:669
RegistryStackQuery< SelectsTraits, MissingsTraits< C, Cs... >, ConditionsTraits< C, Cs... >, ComponentsTraits< C, Cs... > > where()
Query all entities which have all the given components.
Definition Registry.hpp:746
util::meta::filter_t< IsNotCondition, Cs... > ComponentsTraits
util::meta::Traits type helper for the components types from a given template pack
Definition Registry.hpp:705
util::meta::filter_t< IsCondition, Cs... > ConditionsTraits
util::meta::Traits type helper for the conditions types from a given template pack
Definition Registry.hpp:708
RegistryStackQuery< SelectsTraits, MissingsTraits< C, Cs... >, ConditionsTraits< C, Cs... >, ComponentsTraits< C, Cs... >, AutoLock > whereEx()
Query all entities which have all the given components.
Definition Registry.hpp:776
util::meta::Traits< Selects... > SelectsTraits
util::meta::Traits type helper for the Selected queryable template pack
Definition Registry.hpp:695
Select(Registry &registry) noexcept
Construct a new Select object.
Definition Registry.hpp:723
Registry & _registry
Owning registry.
Definition Registry.hpp:790
util::meta::right_outer_join_t< util::meta::apply_t< queryable_type_t, util::meta::filter_t< IsNotCondition, Cs... > >, util::meta::Traits< Selects... > > MissingsTraits
util::meta::Traits type helper for the missing queryable from a given template pack
Definition Registry.hpp:702
Base of an ECS architecture.
Definition Registry.hpp:82
constexpr M::Modifier & getQueryable(ModifierAllocator &allocator)
Get a queryable from a registry variable (component storage, resource, queryable storage....
Definition Registry.hpp:241
Instances< IStorage > _storages
Registry storages.
constexpr const Instances< IStorage > & getStorages() const noexcept
Get a const reference to the storages instances.
getStorageType< C > & addStorage()
Add a new component storage in the registry.
Definition Registry.hpp:902
Entity getEntity(Entity::Index index)
Get the Entity at the index index.
Definition Registry.cpp:38
constexpr M & getQueryable(ModifierAllocator &allocator)
Get a queryable from a registry variable (component storage, resource, queryable storage....
Definition Registry.hpp:234
Instances< ISystem > _systems
Registry systems.
S & getQueryable()
Get a queryable from a registry variable (component storage, resource, queryable storage....
Definition Registry.hpp:112
getStorageType< C > & getStorageSafe() noexcept
Get the Storage of a component and create it if not found.
EntityBuilder entityBuilder() noexcept
Create a new entity builder.
Definition Registry.cpp:33
constexpr Instances< IStorage > & getStorages() noexcept
Get a reference to the storages instances.
ResourceReference< const R, Locked > getResource() const
Get the Resource of type R.
Definition Registry.hpp:937
constexpr Pipeline & getPipeline() noexcept
Get a reference to the registry pipeline.
void runSystems()
Run all systems present in the registry.
Definition Registry.cpp:92
void runSystem()
Run a specific system from the registry.
constexpr S & getFromType()
Get a registry object reference (storage, resource, system, or the registry itself) from its type.
Definition Registry.hpp:152
ResourceReference< Entities, Locked > getEntities()
Get the Entities resource.
constexpr R & getQueryable()
Get a queryable from a registry variable (component storage, resource, queryable storage....
Definition Registry.hpp:104
std::vector< std::reference_wrapper< IStorage > > getEntityStorages(Entity entity)
Get the Entity Storages.
Definition Registry.cpp:43
constexpr R & getFromType() noexcept
Get a registry object reference (storage, resource, system, or the registry itself) from its type.
Definition Registry.hpp:159
ResourceReference< R, Locked > getResource()
Get the Resource of type R.
Definition Registry.hpp:955
Select< queryable_type_t< C >, queryable_type_t< Cs >... > select()
Starts the creation of a complex query in the registry.
R & addResource(Args &&...args)
Add a new resource in the registry.
Definition Registry.hpp:884
constexpr getStorageType< C > & getFromType()
Get a registry object reference (storage, resource, system, or the registry itself) from its type.
Definition Registry.hpp:131
void eraseEntitiesComponents(std::span< Entity > entities)
Definition Registry.cpp:78
void eraseEntityComponents(Entity entity)
Definition Registry.cpp:72
RegistrySelectStackQuery< thread::AUTO_LOCK_DEFAULT, queryable_type_t< C >, queryable_type_t< Cs >... > query()
Construct a query for the given components.
void runSystemsPhase(Pipeline::PhaseId phase)
Run all systems present in the registry for the given phase.
Definition Registry.cpp:97
void clear()
Erase all resources, systems and storages.
Definition Registry.cpp:102
size_t eraseEntities(std::span< Entity > entities)
Instantly erase multiple entities and their components from the registry.
Definition Registry.cpp:62
S & addSystemInPhase(T phaseId, Args &&...args)
Add a new system in the registry in a specific phase.
Definition Registry.hpp:860
constexpr R & getFromType()
Get a registry object reference (storage, resource, system, or the registry itself) from its type.
Definition Registry.hpp:145
S & addSystem(Args &&...args)
Add a new system in the registry.
Definition Registry.hpp:839
bool eraseEntity(Entity entity)
Instantly erase an entity and its components from the registry.
Definition Registry.cpp:52
Instances< IResource > _resources
Registry resources.
const getStorageType< C > & getStorage() const
Get the Storage for the component type C.
Definition Registry.hpp:973
ResourceReference< const Entities, Locked > getEntities() const
Get the Entities resource.
constexpr getStorageType< C > & getQueryable()
Get a queryable from a registry variable (component storage, resource, queryable storage....
Definition Registry.hpp:96
S & getSystem()
Get the System of type S.
S & getFromType()
Get a registry object reference (storage, resource, system, or the registry itself) from its type.
Definition Registry.hpp:138
Pipeline _pipeline
System pipeline.
RegistrySelectStackQuery< AutoLock, queryable_type_t< C >, queryable_type_t< Cs >... > queryEx()
Construct a query for the given components.
getStorageType< C > & getStorage()
Get the Storage for the component type C.
Definition Registry.hpp:991
constexpr const Pipeline & getPipeline() const noexcept
Get a const reference to the registry pipeline.
bool hasResource() const
Check whether the registry has the resource of type R.
Definition Registry.hpp:918
~Registry()=default
Default destructor.
More high-level query class, wrapping the QueryImplementation.
Definition Query.hpp:604
Query components presents in all given queryables.
Definition Query.hpp:47
Thread safe view of a Lockable object.
Get the component type of the given type.
Registry Modifier concept, which are placeholders for the actual query modifiers.
Defines a query modifier type.
Definition Modifier.hpp:31
Defines a type that can be queried.
Defines a type that can be locked.
Definition Lockable.hpp:30
Contains the condition resolution structures.
Filter types from a list.
Check if a type is a std::size_t or convertible to it.
Get the allocator required size for a list of queryables.
Type erased base class for all query modifiers.
typename thread_safe_queryable< Q, ThreadSafe >::type thread_safe_queryable_t
Alias for the thread safe type of a queryable type.
typename thread_safe_reference< T, ThreadSafe >::type thread_safe_reference_t
Alias for the reference type of a maybe thread safe type.
Namespace containing all symbols specific to ecstasy.
Definition ecstasy.hpp:30
ResourceReference< R, AutoLock > RR
ResourceReference alias
Definition Registry.hpp:66
typename getStorageTypeImpl< C >::type getStorageType
Get the storage type to use for a component.
typename queryable_type< C >::type queryable_type_t
Helper to queryable_type<C>::type.
query::thread_safe_reference_t< R, AutoLock > ResourceReference
Resource reference type.
Definition Registry.hpp:63
typename apply< Functor, Ts... >::type apply_t
Helper for apply<...>::type.
Definition apply.hpp:53
typename filter< Filter, Ts... >::type filter_t
Helper for filter<...>::type.
Definition filter.hpp:82
typename right_outer_join< Lefts, Rights >::type right_outer_join_t
Helper for right_outer_join<...>::type.
Namespace regrouping helpers used by ecstasy but not specific to ecstasy.
Definition Queryable.hpp:21
Performs a left outer join between two parameter packs.
Defines the queryable_type type trait.
static constexpr M & get(Registry &registry, ModifierAllocator &allocator)
Specialization of Registry::getQueryable().
Definition Registry.hpp:201
static constexpr Q & getRegistryQueryable(Registry &registry, ModifierAllocator &allocator)
Get a queryable from the registry.
Definition Registry.hpp:223
Proxy structure to extract the operand types using template partial specialization.
Definition Registry.hpp:173
Test whether a given type is a condition.
Definition Registry.hpp:680
Test whether a given type is not a condition.
Definition Registry.hpp:691
Get the allocator required size for a list of queryables.
Get the size of the allocator required for the given queryable types.
Empty parameter pack helper type.
Definition Traits.hpp:28