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

Binary query modifier which performs a and between at least two queryables. More...

#include <And.hpp>

Inheritance diagram for ecstasy::query::modifier::AndImpl< AutoLock, Q1, Q2, Qs >:
Collaboration diagram for ecstasy::query::modifier::AndImpl< AutoLock, Q1, Q2, Qs >:

Public Member Functions

 AndImpl (Q1 &firstOperand, Q2 &secondOperand, Qs &...otherOperands)
 Construct a new And Queryable modifier.
 
template<size_t operandId>
ModifierClass::template OperandData< operandId > getOperandData (size_t index)
 Get the specified operand data at the given index.
 
void reloadMask ()
 Update the mask to be up to date with the operands bitmasks.
 
- Public Member Functions inherited from ecstasy::query::modifier::BinaryModifier< AndImpl< AutoLock, Q1, Q2, Qs... >, AutoLock, std::type_identity, Q1, Q2, Qs... >
 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.
 

Private Types

using ModifierClass = BinaryModifier< AndImpl< AutoLock, Q1, Q2, Qs... >, AutoLock, std::type_identity, Q1, Q2, Qs... >
 Helper type for the base class.
 

Private Member Functions

template<size_t... ints>
void combineOperandMasks (std::integer_sequence< size_t, ints... > int_seq)
 Combine all the operands' bitmasks.
 

Additional Inherited Members

- Public Types inherited from ecstasy::query::modifier::BinaryModifier< AndImpl< AutoLock, Q1, Q2, Qs... >, AutoLock, std::type_identity, Q1, Q2, Qs... >
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 std::type_identity< typename Q1::QueryData >::type, typename std::type_identity< typename Q2::QueryData >::type, typename std::type_identity< typename Qs::QueryData >::type... >
 Queryable constaint.
 
using OperandData = std::tuple_element_t< operandId, QueryData >
 QueryData for the given operand.
 
- Protected Member Functions inherited from ecstasy::query::modifier::BinaryModifier< AndImpl< AutoLock, Q1, Q2, Qs... >, AutoLock, std::type_identity, Q1, Q2, Qs... >
QueryData getQueryData (size_t index, std::integer_sequence< size_t, ints... > int_seq)
 Get the query data.
 
OperandData< operandId > getDerivedOperandData (size_t index)
 
- Protected Attributes inherited from ecstasy::query::modifier::BinaryModifier< AndImpl< AutoLock, Q1, Q2, Qs... >, AutoLock, std::type_identity, Q1, Q2, Qs... >
Internal _operands
 Tuple containing the queryables.
 
util::BitSet _mask
 Mask of the queryables.
 

Detailed Description

template<bool AutoLock, Queryable Q1, Queryable Q2, Queryable... Qs>
class ecstasy::query::modifier::AndImpl< AutoLock, Q1, Q2, Qs >

Binary query modifier which performs a and between at least two queryables.

Note
The mask is the result of the operation: Q1 & Q2 & Qs...
Template Parameters
AutoLockLock the Lockable queryables if true.
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 34 of file And.hpp.

Member Typedef Documentation

◆ ModifierClass

template<bool AutoLock, Queryable Q1, Queryable Q2, Queryable... Qs>
using ecstasy::query::modifier::AndImpl< AutoLock, Q1, Q2, Qs >::ModifierClass = BinaryModifier<AndImpl<AutoLock, Q1, Q2, Qs...>, AutoLock, std::type_identity, Q1, Q2, Qs...>
private

Helper type for the base class.

Definition at line 38 of file And.hpp.

Constructor & Destructor Documentation

◆ AndImpl()

template<bool AutoLock, Queryable Q1, Queryable Q2, Queryable... Qs>
ecstasy::query::modifier::AndImpl< AutoLock, Q1, Q2, Qs >::AndImpl ( Q1 &  firstOperand,
Q2 &  secondOperand,
Qs &...  otherOperands 
)
inline

Construct a new And Queryable 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 52 of file And.hpp.

53 : ModifierClass(firstOperand, secondOperand, otherOperands...)
54 {
55 }
BinaryModifier< AndImpl< AutoLock, Q1, Q2, Qs... >, AutoLock, std::type_identity, Q1, Q2, Qs... > ModifierClass
Helper type for the base class.
Definition And.hpp:39

Member Function Documentation

◆ combineOperandMasks()

template<bool AutoLock, Queryable Q1, Queryable Q2, Queryable... Qs>
template<size_t... ints>
void ecstasy::query::modifier::AndImpl< AutoLock, Q1, Q2, Qs >::combineOperandMasks ( std::integer_sequence< size_t, ints... >  int_seq)
inlineprivate

Combine all the operands' bitmasks.

Template Parameters
intsSequence values.
Parameters
[in]int_seqSequence containing the queryable ids.
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 104 of file And.hpp.

105 {
106 this->_mask = ((util::BitSet(getQueryableMask(std::get<0>(this->_operands)))
107 & getQueryableMask(std::get<1>(this->_operands))) &= ... &=
108 getQueryableMask(std::get<ints + 2>(this->_operands)));
109 }
Mimics the API of std::bitset but with the dynamic properties of std::vector<bool>
Definition BitSet.hpp:35
constexpr const util::BitSet & getQueryableMask(const Q &queryable)
Get the mask of the queryable object.

◆ getOperandData()

template<bool AutoLock, Queryable Q1, Queryable Q2, Queryable... Qs>
template<size_t operandId>
ModifierClass::template OperandData< operandId > ecstasy::query::modifier::AndImpl< AutoLock, Q1, Q2, Qs >::getOperandData ( size_t  index)
inline

Get the specified operand data at the given index.

Warning
May throw exceptions, look at the specified operand type equivalent method documentation.
Template Parameters
operandIdId of the operand (where 0 is Q1, 1 is Q2...).
Parameters
[in]indexIndex of the entity.
Returns
auto The operand data at index 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 (2022-10-27)

Definition at line 72 of file And.hpp.

73 {
74 return getQueryableData(std::get<operandId>(this->_operands), index);
75 }
constexpr queryable_data_t< Q > getQueryableData(Q &queryable, size_t index)
Get the query data at the given index.

◆ reloadMask()

template<bool AutoLock, Queryable Q1, Queryable Q2, Queryable... Qs>
void ecstasy::query::modifier::AndImpl< AutoLock, Q1, Q2, Qs >::reloadMask ( )
inline

Update the mask to be up to date with the operands bitmasks.

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 83 of file And.hpp.

84 {
85 if constexpr (sizeof...(Qs) > 0)
87 else
88 this->_mask = ecstasy::query::getQueryableMask(std::get<0>(this->_operands))
89 & ecstasy::query::getQueryableMask(std::get<1>(this->_operands));
90 }
void combineOperandMasks(std::integer_sequence< size_t, ints... > int_seq)
Combine all the operands' bitmasks.
Definition And.hpp:104

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