ECSTASY
All in the name
Loading...
Searching...
No Matches
ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs > Class Template Reference

Base class of query modifier operating on at least two queryables. More...

#include <BinaryModifier.hpp>

Inheritance diagram for ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >:
Collaboration diagram for ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >:

Public Types

using Operands = util::meta::Traits< Q1, Q2, Qs... >
 Modifier constraint.
 
using Internal = std::tuple< queryable_qualifiers_t< Q1, AutoLock >, queryable_qualifiers_t< Q2, AutoLock >, queryable_qualifiers_t< Qs, AutoLock >... >
 
using QueryData = std::tuple< typename DataModifier< typename Q1::QueryData >::type, typename DataModifier< typename Q2::QueryData >::type, typename DataModifier< typename Qs::QueryData >::type... >
 Queryable constaint.
 
template<size_t operandId>
using OperandData = std::tuple_element_t< operandId, QueryData >
 QueryData for the given operand.
 

Public Member Functions

 BinaryModifier (Q1 &firstOperand, Q2 &secondOperand, Qs &...otherOperands)
 Construct a new binary query modifier.
 
constexpr const util::BitSetgetMask () const noexcept
 Get the Mask of the internal queryables.
 
QueryData getQueryData (size_t index)
 Get the operands data at the given index.
 
- Public Member Functions inherited from ecstasy::query::modifier::Modifier< AutoLock >
virtual ~Modifier ()=default
 Destroy the modifier base object.
 
- Public Member Functions inherited from ecstasy::query::modifier::ModifierBase
virtual ~ModifierBase ()=default
 Destroy the modifier base object.
 

Protected Member Functions

template<size_t operandId>
OperandData< operandId > getDerivedOperandData (size_t index)
 
template<size_t... ints>
QueryData getQueryData (size_t index, std::integer_sequence< size_t, ints... > int_seq)
 Get the query data.
 

Protected Attributes

Internal _operands
 Tuple containing the queryables.
 
util::BitSet _mask
 Mask of the queryables.
 

Detailed Description

template<typename Derived, bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
class ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >

Base class of query modifier operating on at least two queryables.

Template Parameters
DerivedDerived class implementing the modifier.
AutoLockLock the Lockable queryables if true.
DataModifierMeta class implementing a type modifying the queryable data types (example std::optional).
Q1Left operand queryable type.
Q2Right operand queryable type.
QsAdditional operand queryable 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 (2022-10-27)

Definition at line 35 of file BinaryModifier.hpp.

Member Typedef Documentation

◆ Internal

template<typename Derived , bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
using ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >::Internal = std::tuple<queryable_qualifiers_t<Q1, AutoLock>, queryable_qualifiers_t<Q2, AutoLock>, queryable_qualifiers_t<Qs, AutoLock>...>

Definition at line 39 of file BinaryModifier.hpp.

◆ OperandData

template<typename Derived , bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
template<size_t operandId>
using ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >::OperandData = std::tuple_element_t<operandId, QueryData>

QueryData for the given operand.

Definition at line 52 of file BinaryModifier.hpp.

◆ Operands

template<typename Derived , bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
using ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >::Operands = util::meta::Traits<Q1, Q2, Qs...>

Modifier constraint.

Definition at line 38 of file BinaryModifier.hpp.

◆ QueryData

template<typename Derived , bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
using ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >::QueryData = std::tuple< typename DataModifier<typename Q1::QueryData>::type, typename DataModifier<typename Q2::QueryData>::type, typename DataModifier<typename Qs::QueryData>::type...>

Queryable constaint.

Definition at line 44 of file BinaryModifier.hpp.

Constructor & Destructor Documentation

◆ BinaryModifier()

template<typename Derived , bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >::BinaryModifier ( Q1 &  firstOperand,
Q2 &  secondOperand,
Qs &...  otherOperands 
)
inline

Construct a new binary query modifier.

Parameters
[in]firstOperandleft queryable operand.
[in]secondOperandright queryable operand.
[in]otherOperandsadditional operands (optional).
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-27)

Definition at line 64 of file BinaryModifier.hpp.

65 : _operands(firstOperand, secondOperand, otherOperands...)
66 {
67 static_cast<Derived &>(*this).reloadMask();
68 }
Internal _operands
Tuple containing the queryables.

Member Function Documentation

◆ getDerivedOperandData()

template<typename Derived , bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
template<size_t operandId>
OperandData< operandId > ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >::getDerivedOperandData ( size_t  index)
inlineprotected

Definition at line 116 of file BinaryModifier.hpp.

117 {
118 return static_cast<Derived &>(*this).template getOperandData<operandId>(index);
119 }

◆ getMask()

template<typename Derived , bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
constexpr const util::BitSet & ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >::getMask ( ) const
inlineconstexprnoexcept

Get the Mask of the internal queryables.

Note
Queryable constraint.
Warning
Use reloadMask() if the operand masks have changed since the construction.
Returns
const util::BitSet& resulting 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-27)

Definition at line 81 of file BinaryModifier.hpp.

82 {
83 return _mask;
84 }
util::BitSet _mask
Mask of the queryables.

◆ getQueryData() [1/2]

template<typename Derived , bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
QueryData ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >::getQueryData ( size_t  index)
inline

Get the operands data at the given index.

Note
Queryable constraint.
Parameters
[in]indexIndex of the entity.
Returns
QueryData A tuple containing the operands data.
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-27)

Definition at line 98 of file BinaryModifier.hpp.

99 {
100 return getQueryData(index, std::make_index_sequence<(sizeof...(Qs))>());
101 }
QueryData getQueryData(size_t index)
Get the operands data at the given index.

◆ getQueryData() [2/2]

template<typename Derived , bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
template<size_t... ints>
QueryData ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >::getQueryData ( size_t  index,
std::integer_sequence< size_t, ints... >  int_seq 
)
inlineprotected

Get the query data.

Template Parameters
intsSequence values.
Parameters
[in]indexId of the query data to fetch.
[in]int_seqSequence containing the queryables ids.
Returns
QueryData A tuple of std::optional containing the operands data if existing.
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-21)

Definition at line 135 of file BinaryModifier.hpp.

136 {
137 return {getDerivedOperandData<0>(index), getDerivedOperandData<1>(index),
138 getDerivedOperandData<ints + 2>(index)...};
139 }

Member Data Documentation

◆ _mask

template<typename Derived , bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
util::BitSet ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >::_mask
protected

Mask of the queryables.

Definition at line 144 of file BinaryModifier.hpp.

◆ _operands

template<typename Derived , bool AutoLock, template< typename > class DataModifier, Queryable Q1, Queryable Q2, Queryable... Qs>
Internal ecstasy::query::modifier::BinaryModifier< Derived, AutoLock, DataModifier, Q1, Q2, Qs >::_operands
protected

Tuple containing the queryables.

Definition at line 142 of file BinaryModifier.hpp.


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