ECSTASY
All in the name
Loading...
Searching...
No Matches
ecstasy::Registry::Select< Selects > Class Template Reference

Proxy class to use where method. More...

#include <Registry.hpp>

Collaboration diagram for ecstasy::Registry::Select< Selects >:

Classes

struct  IsCondition
 Test whether a given type is a condition. More...
 
struct  IsNotCondition
 Test whether a given type is not a condition. More...
 

Public Member Functions

 Select (Registry &registry) noexcept
 Construct a new Select object.
 
template<typename C , typename... Cs>
RegistryStackQuery< SelectsTraits, MissingsTraits< C, Cs... >, ConditionsTraits< C, Cs... >, ComponentsTraits< C, Cs... > > where ()
 Query all entities which have all the given components.
 
template<bool AutoLock, typename C , typename... Cs>
RegistryStackQuery< SelectsTraits, MissingsTraits< C, Cs... >, ConditionsTraits< C, Cs... >, ComponentsTraits< C, Cs... >, AutoLock > whereEx ()
 Query all entities which have all the given components.
 

Private Types

using SelectsTraits = util::meta::Traits< Selects... >
 util::meta::Traits type helper for the Selected queryable template pack
 
template<typename... Cs>
using MissingsTraits = util::meta::right_outer_join_t< util::meta::apply_t< queryable_type_t, util::meta::filter_t< IsNotCondition, Cs... > >, util::meta::Traits< Selects... > >
 util::meta::Traits type helper for the missing queryable from a given template pack
 
template<typename... Cs>
using ComponentsTraits = util::meta::filter_t< IsNotCondition, Cs... >
 util::meta::Traits type helper for the components types from a given template pack
 
template<typename... Cs>
using ConditionsTraits = util::meta::filter_t< IsCondition, Cs... >
 util::meta::Traits type helper for the conditions types from a given template pack
 
template<typename... Cs>
using QueryType = query::QueryImplementation< SelectsTraits, ConditionsTraits< Cs... > >
 query::QueryImplementation type for the given where clause
 

Private Attributes

Registry_registry
 Owning registry.
 

Detailed Description

template<query::Queryable... Selects>
class ecstasy::Registry::Select< Selects >

Proxy class to use where method.

Note
This is a registry helper for the Select implementation.
Template Parameters
Selectstype of selected queryables.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-10-22)

Definition at line 669 of file Registry.hpp.

Member Typedef Documentation

◆ ComponentsTraits

template<query::Queryable... Selects>
template<typename... Cs>
using ecstasy::Registry::Select< Selects >::ComponentsTraits = util::meta::filter_t<IsNotCondition, Cs...>
private

util::meta::Traits type helper for the components types from a given template pack

Definition at line 705 of file Registry.hpp.

◆ ConditionsTraits

template<query::Queryable... Selects>
template<typename... Cs>
using ecstasy::Registry::Select< Selects >::ConditionsTraits = util::meta::filter_t<IsCondition, Cs...>
private

util::meta::Traits type helper for the conditions types from a given template pack

Definition at line 708 of file Registry.hpp.

◆ MissingsTraits

template<query::Queryable... Selects>
template<typename... Cs>
using ecstasy::Registry::Select< Selects >::MissingsTraits = util::meta::right_outer_join_t< util::meta::apply_t<queryable_type_t, util::meta::filter_t<IsNotCondition, Cs...> >, util::meta::Traits<Selects...> >
private

util::meta::Traits type helper for the missing queryable from a given template pack

Definition at line 698 of file Registry.hpp.

◆ QueryType

template<query::Queryable... Selects>
template<typename... Cs>
using ecstasy::Registry::Select< Selects >::QueryType = query::QueryImplementation<SelectsTraits, ConditionsTraits<Cs...> >
private

query::QueryImplementation type for the given where clause

Definition at line 711 of file Registry.hpp.

◆ SelectsTraits

template<query::Queryable... Selects>
using ecstasy::Registry::Select< Selects >::SelectsTraits = util::meta::Traits<Selects...>
private

util::meta::Traits type helper for the Selected queryable template pack

Definition at line 695 of file Registry.hpp.

Constructor & Destructor Documentation

◆ Select()

template<query::Queryable... Selects>
ecstasy::Registry::Select< Selects >::Select ( Registry registry)
inlinenoexcept

Construct a new Select object.

Parameters
[in]registryregistry owning the searched components.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-10-22)

Definition at line 723 of file Registry.hpp.

723 : _registry(registry)
724 {
725 }
Registry & _registry
Owning registry.
Definition Registry.hpp:790

Member Function Documentation

◆ where()

template<query::Queryable... Selects>
template<typename C , typename... Cs>
RegistryStackQuery< SelectsTraits, MissingsTraits< C, Cs... >, ConditionsTraits< C, Cs... >, ComponentsTraits< C, Cs... > > ecstasy::Registry::Select< Selects >::where ( )
inline

Query all entities which have all the given components.

Template Parameters
CFirst constraint Type (Queryable or Condition).
CsOther constraint Types (Queryables or Conditions).
Returns
QueryType<C, Cs...> Resulting query.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-10-22)

Definition at line 746 of file Registry.hpp.

747 {
748 return RegistryStackQuery<
750 MissingsTraits<C, Cs...>,
751 ConditionsTraits<C, Cs...>,
752 ComponentsTraits<C, Cs...>
753 >(_registry);
754 }
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
util::meta::Traits< Selects... > SelectsTraits
util::meta::Traits type helper for the Selected queryable template pack
Definition Registry.hpp:695
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

◆ whereEx()

template<query::Queryable... Selects>
template<bool AutoLock, typename C , typename... Cs>
RegistryStackQuery< SelectsTraits, MissingsTraits< C, Cs... >, ConditionsTraits< C, Cs... >, ComponentsTraits< C, Cs... >, AutoLock > ecstasy::Registry::Select< Selects >::whereEx ( )
inline

Query all entities which have all the given components.

This extended version allows to set the AutoLock value.

Template Parameters
AutoLockWhether or not the queryables should be locked.
CFirst constraint Type (Queryable or Condition).
CsOther constraint Types (Queryables or Conditions).
Returns
RegistryStackQuery Query object which can be iterated.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2024-04-07)

Definition at line 776 of file Registry.hpp.

777 {
778 return RegistryStackQuery<
780 MissingsTraits<C, Cs...>,
781 ConditionsTraits<C, Cs...>,
782 ComponentsTraits<C, Cs...>,
783 AutoLock
784 >(_registry);
785 }

Member Data Documentation

◆ _registry

template<query::Queryable... Selects>
Registry& ecstasy::Registry::Select< Selects >::_registry
private

Owning registry.

Definition at line 790 of file Registry.hpp.


The documentation for this class was generated from the following file: