ECSTASY
All in the name
Loading...
Searching...
No Matches
ecstasy::query Namespace Reference

Namespace regrouping the internal ecstasy query system. More...

Namespaces

namespace  modifier
 Namespaces regrouping all the available query modifiers.
 

Classes

struct  Condition
 Condition resolution structure. More...
 
struct  Condition< Left, ptr, Comparer >
 Condition resolution structure for a constant left operand and a member right operand. More...
 
struct  Condition< Left, Right, Comparer >
 Condition resolution structure for two constant operands. More...
 
struct  Condition< ptr, Right, Comparer >
 Condition resolution structure for a member left operand and a constant right operand. More...
 
struct  Condition< ptrLeft, ptrRight, Comparer >
 Condition resolution structure for a member left operand and a member right operand. More...
 
struct  ConditionBase
 Base class for all conditions. More...
 
struct  is_queryable
 Checks if the given type match the Queryable concept. More...
 
struct  is_queryable< T >
 Checks if the given type match the Queryable concept. More...
 
struct  is_queryable_with_adjust
 Checks if the given type match the QueryableNeedAdjust concept. More...
 
struct  is_queryable_with_adjust< T >
 Checks if the given type match the QueryableNeedAdjust concept. More...
 
class  Query
 More high-level query class, wrapping the QueryImplementation. More...
 
struct  queryable_data
 Get the query data type of a queryable object. More...
 
struct  queryable_data< const Q >
 Get the query data type of a queryable object. More...
 
struct  queryable_data< W >
 Get the query data type of a queryable object. More...
 
struct  queryable_qualifiers
 Get the queryable type with the correct qualifiers. More...
 
struct  queryable_qualifiers< Q, true >
 Get the queryable type with the correct qualifiers. More...
 
class  QueryImplementation
 Query components presents in all given queryables. More...
 
class  QueryImplementation< util::meta::Traits< First, Others... >, util::meta::Traits< Conditions... >, AutoLock >
 QueryImplementation specialization. More...
 
struct  Select
 Advanced Query. More...
 
struct  thread_safe_queryable
 Get the thread safe type of a queryable type. More...
 
struct  thread_safe_queryable< Q, true >
 Get the thread safe type of a queryable type. More...
 
struct  thread_safe_reference
 Get the reference type of a maybe thread safe type. More...
 
struct  thread_safe_reference< T, true >
 Get the reference type of a maybe thread safe type. More...
 
class  ThreadSafeQuery
 More high-level query class, wrapping the QueryImplementation and locking all Lockable queryables. More...
 
struct  views_allocator_size
 Get the size of the allocator required for the given queryable types. More...
 
struct  views_allocator_size< AutoLock, Q, Qs... >
 Get the size of the allocator required for the given queryable types. More...
 
struct  views_allocator_size< true, Q, Qs... >
 Get the thread safe type of a queryable type. More...
 

Concepts

concept  QCondition
 Query Condition concept.
 
concept  QConditionConst
 Condition with two constant operands.
 
concept  QConditionLeft
 Condition with a runtime left operand and a constant right operand.
 
concept  QConditionRight
 Condition with a constant left operand and a runtime right operand.
 
concept  QConditionLeftRight
 Condition with two runtime operands.
 
concept  Modifier
 Defines a query modifier type.
 
concept  QueryableObject
 Defines a type that can be queried.
 
concept  ConstQueryableObject
 Defines a type that can be queried in a const context.
 
concept  QueryableWrapper
 Defines a type that can be queried through a wrapper.
 
concept  Queryable
 Defines a type that can be queried.
 
concept  QueryableObjectNeedAdjust
 Defines a Queryable object type which has the adjustMask() implemented.
 
concept  QueryableWrapperNeedAdjust
 Defines a Queryable wrapper type which has the adjustMask() implemented.
 
concept  QueryableNeedAdjust
 Defines a Queryable type which has the adjustMask() implemented.
 

Typedefs

template<typename Q >
using queryable_data_t = typename queryable_data< Q >::type
 Alias for the query data type of a queryable object.
 
template<typename Q , bool ThreadSafe = true>
using thread_safe_queryable_t = typename thread_safe_queryable< Q, ThreadSafe >::type
 Alias for the thread safe type of a queryable type.
 
template<typename T , bool ThreadSafe = true>
using thread_safe_reference_t = typename thread_safe_reference< T, ThreadSafe >::type
 Alias for the reference type of a maybe thread safe type.
 
template<typename Q , bool AutoLock = false>
using queryable_qualifiers_t = typename queryable_qualifiers< Q, AutoLock >::type
 Alias for the queryable type with the correct qualifiers.
 

Functions

template<Queryable Q>
constexpr const util::BitSetgetQueryableMask (const Q &queryable)
 Get the mask of the queryable object.
 
template<Queryable Q>
constexpr queryable_data_t< Q > getQueryableData (Q &queryable, size_t index)
 Get the query data at the given index.
 
template<typename T >
constexpr void adjustMask (T &queryable, size_t maxSize) noexcept
 Adjust the queryable mask if needed.
 
template<QueryableNeedAdjust Q>
constexpr void adjustMask (Q &queryable, size_t maxSize)
 Adjust the queryable mask if needed.
 

Variables

template<typename T >
static constexpr bool is_queryable_v = is_queryable<T>::value
 Helper for is_queryable<T>::value.
 
template<bool AutoLock, Queryable... Qs>
size_t constexpr views_allocator_size_v = views_allocator_size<AutoLock, Qs...>::value
 Helper for views_allocator_size<AutoLock, Qs...>::value.
 
template<typename T >
static constexpr bool is_queryable_with_adjust_v = is_queryable_with_adjust<T>::value
 Helper for is_queryable_with_adjust.
 

Detailed Description

Namespace regrouping the internal ecstasy query system.

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-11-18)

Typedef Documentation

◆ queryable_data_t

template<typename Q >
using ecstasy::query::queryable_data_t = typedef typename queryable_data<Q>::type

Alias for the query data type of a queryable object.

Template Parameters
QQueryable object.
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-03)

Definition at line 176 of file Queryable.hpp.

◆ queryable_qualifiers_t

template<typename Q , bool AutoLock = false>
using ecstasy::query::queryable_qualifiers_t = typedef typename queryable_qualifiers<Q, AutoLock>::type

Alias for the queryable type with the correct qualifiers.

Template Parameters
QQueryable object.
AutoLockWhether the queryable should be locked while used or not.
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-04)

Definition at line 282 of file Queryable.hpp.

◆ thread_safe_queryable_t

template<typename Q , bool ThreadSafe = true>
using ecstasy::query::thread_safe_queryable_t = typedef typename thread_safe_queryable<Q, ThreadSafe>::type

Alias for the thread safe type of a queryable type.

Template Parameters
QQueryable type.
ThreadSafeWhether the queryable should be thread safe or not. Default to true.
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-06)

Definition at line 210 of file Queryable.hpp.

◆ thread_safe_reference_t

template<typename T , bool ThreadSafe = true>
using ecstasy::query::thread_safe_reference_t = typedef typename thread_safe_reference<T, ThreadSafe>::type

Alias for the reference type of a maybe thread safe type.

Template Parameters
TType.
ThreadSafeWhether the type should be thread safe or not. Default to true.
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-17)

Definition at line 245 of file Queryable.hpp.

Function Documentation

◆ adjustMask() [1/2]

template<QueryableNeedAdjust Q>
constexpr void ecstasy::query::adjustMask ( Q &  queryable,
size_t  maxSize 
)
constexpr

Adjust the queryable mask if needed.

Note
This is mainly for modifiers purposes.
This will call adjustMask() method if implemented (see QueryableNeedAdjust concept).
Template Parameters
TType of the queryable.
Parameters
[in]queryablequeryable value.
[in]maxSizemaxSize of the mask that will be compared to the queryable mask.
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-25)

Definition at line 88 of file QueryableNeedAdjust.hpp.

89 {
90 if constexpr (QueryableWrapper<Q>)
91 queryable->adjustMask(maxSize);
92 else
93 queryable.adjustMask(maxSize);
94 }
Defines a type that can be queried through a wrapper.
Definition Queryable.hpp:91

◆ adjustMask() [2/2]

template<typename T >
constexpr void ecstasy::query::adjustMask ( T &  queryable,
size_t  maxSize 
)
constexprnoexcept

Adjust the queryable mask if needed.

Note
This is mainly for modifiers purposes.
This will call adjustMask() method if implemented (see QueryableNeedAdjust concept).
Template Parameters
TType of the queryable.
Parameters
[in]queryablequeryable value.
[in]maxSizemaxSize of the mask that will be compared to the queryable mask.
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-25)

Definition at line 82 of file QueryableNeedAdjust.hpp.

83 {
84 }

◆ getQueryableData()

template<Queryable Q>
constexpr queryable_data_t< Q > ecstasy::query::getQueryableData ( Q &  queryable,
size_t  index 
)
constexpr

Get the query data at the given index.

Note
Required because the dot operator is not overloadable for QueryableWrapper.
Template Parameters
QQueryable object.
Parameters
[in]queryableQueryable object.
[in]indexIndex of the query data to fetch.
Returns
constexpr ecstasy::query::queryable_data_t<Q> Query data at the given index.
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-03)

Definition at line 326 of file Queryable.hpp.

327 {
328 if constexpr (QueryableWrapper<Q>)
329 return queryable->getQueryData(index);
330 else
331 return queryable.getQueryData(index);
332 }

◆ getQueryableMask()

template<Queryable Q>
constexpr const util::BitSet & ecstasy::query::getQueryableMask ( const Q &  queryable)
constexpr

Get the mask of the queryable object.

Note
Required because the dot operator is not overloadable for QueryableWrapper.
Template Parameters
QQueryable object.
Parameters
[in]queryableQueryable object.
Returns
constexpr const util::BitSet& Mask of the queryable object.
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-03)

Definition at line 301 of file Queryable.hpp.

302 {
303 if constexpr (QueryableWrapper<Q>)
304 return queryable->getMask();
305 else
306 return queryable.getMask();
307 }

Variable Documentation

◆ is_queryable_v

template<typename T >
constexpr bool ecstasy::query::is_queryable_v = is_queryable<T>::value
inlinestaticconstexpr

Helper for is_queryable<T>::value.

Template Parameters
TEvaluated type.
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-30)

Definition at line 358 of file Queryable.hpp.

◆ is_queryable_with_adjust_v

template<typename T >
constexpr bool ecstasy::query::is_queryable_with_adjust_v = is_queryable_with_adjust<T>::value
inlinestaticconstexpr

Helper for is_queryable_with_adjust.

Template Parameters
TEvaluated type.
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-30)

Definition at line 121 of file QueryableNeedAdjust.hpp.

◆ views_allocator_size_v

template<bool AutoLock, Queryable... Qs>
size_t constexpr ecstasy::query::views_allocator_size_v = views_allocator_size<AutoLock, Qs...>::value
constexpr

Helper for views_allocator_size<AutoLock, Qs...>::value.

Template Parameters
AutoLockWhether the queryable should be locked while used or not.
QsQueryable types.
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 402 of file Queryable.hpp.