SUNphi  1.0
SUNphi::Binder< TG, _Refs > Class Template Reference

Class to bind a component of a SmET. More...

#include <Bind.hpp>

Inheritance diagram for SUNphi::Binder< TG, _Refs >:
SUNphi::BaseBinder SUNphi::NnarySmET< Binder< TG, _Refs... > > SUNphi::ConstrainAreSmETs< _Refs... > SUNphi::SmET< Binder< TG, _Refs... > > SUNphi::BaseNnarySmET SUNphi::BaseSmET SUNphi::BaseSmET

Public Types

using Tk = typename NestedTk::template AllButType< TG >
 TensKind of the bound expression
 
using Fund = typename RemRef< Ref< 0 >>::Fund
 
using PosOfResTcsInRefsTk = PosOfTcsOfTkInListOfTks< Tk, typename RemRef< _Refs >::Tk... >
 
using PosOfResTcsPresInRefsTk = PosOfTcsOfTkPresInListOfTks< Tk, typename RemRef< _Refs >::Tk... >
 
using ExtraDelims = IntSeq< pos, pos+1 >
 
using MergeableComps = NnarySmETCompsMergeability< Tuple< typename RemRef< _Refs >::MergeableComps... >, PosOfResTcsInRefsTk, ExtraDelims >
 

Public Member Functions

template<typename TC , int I = 0>
int compSize () const
 
template<typename Tref >
bool isAliasing (const Tref &alias) const
 
decltype(auto) getMaximallyMergedCompsView ()
 
template<typename Is >
decltype(auto) getMergedCompsView () const
 
template<typename... Ts>
decltype(auto) getMergedCompsView (Ts &&...ts)
 
template<typename... Args, int... Head, int... Tail>
decltype(auto) binderInternalEval (IntSeq< Head... >, IntSeq< Tail... >, const Tuple< Args... > &targs) const
 
template<typename... Args>
decltype(auto) eval (const Args &...args) const
 Type of the arguments. More...
 
template<typename Oth >
decltype(auto) operator= (Oth &&oth)
 
template<typename SMET , typename = EnableIf<isSame<Unqualified<SMET>,Unqualified<Ref<0>>>>>
 Binder (SMET &&smet, int id)
 
 ~Binder ()
 Destructor.
 
Binder< TG, _Refs... > & operator~ ()
 
const Binder< TG, _Refs... > & operator~ () const
 
decltype(auto) _refEvalByCompsName (IntSeq< I >, IntSeq< Pos... >, Tp &&targs) const
 < Components to get More...
 
decltype(auto) _refEvalByCompsName (Ts &&...ts)
 
decltype(auto) refEvalByCompsName (Tp &&targs) const
 < Components to get More...
 
decltype(auto) refEvalByCompsName (Tp &&targs)
 
decltype(auto) evalThroughRepresentativeFunctionPassingCompsByName (IntSeq< I... >, const Args &...args) const
 < Components to get More...
 
decltype(auto) evalThroughRepresentativeFunctionPassingCompsByName (Ts &&...ts)
 
decltype(auto) operator() (Oth &&...oth)
 
decltype(auto) operator() (Oth &&...oth) const
 

Static Public Member Functions

template<typename Is , typename = EnableIf<isIntSeq<Is>>>
static constexpr void assertMergeableWith ()
 

Static Public Attributes

static constexpr bool isStoring = false
 
static constexpr bool isAssignable = Unqualified<Ref< 0 >>::isAssignable
 

Private Types

using Refs = Tuple< _Refs... >
 
template<int I>
using Ref = TupleElementType< I, Tuple< _Refs... >>
 
using Tg = TG
 Type to get.
 
using NestedTk = typename RemRef< Ref< 0 >>::Tk
 TensKind of the bound type
 
using NestedTypes = typename NestedTk::types
 Types of the TensKind.
 

Private Attributes

Tuple< Reference< _Refs >... > refs
 
const int id
 Index to get.
 

Static Private Attributes

static constexpr int NSmET = 1
 
static constexpr int pos
 Position inside the reference of the type got by the bounder. More...
 

Detailed Description

template<typename TG, typename... _Refs>
class SUNphi::Binder< TG, _Refs >

Class to bind a component of a SmET.

Definition at line 80 of file Bind.hpp.

Member Typedef Documentation

template<typename TG , typename... _Refs>
using SUNphi::Binder< TG, _Refs >::ExtraDelims = IntSeq<pos,pos+1>

Additional delimiters

Definition at line 123 of file Bind.hpp.

template<typename TG , typename... _Refs>
using SUNphi::Binder< TG, _Refs >::Fund = typename RemRef<Ref< 0 >>::Fund

Same Fund as Ref 0

Definition at line 119 of file Bind.hpp.

template<typename TG , typename... _Refs>
using SUNphi::Binder< TG, _Refs >::MergeableComps = NnarySmETCompsMergeability< Tuple<typename RemRef<_Refs>::MergeableComps...>, PosOfResTcsInRefsTk, ExtraDelims>

List of points where the TensKind can be split

Using MergingDelimsForRefs and ExtraDelims to determine the mergability

Definition at line 125 of file Bind.hpp.

template<typename TG , typename... _Refs>
using SUNphi::Binder< TG, _Refs >::PosOfResTcsInRefsTk = PosOfTcsOfTkInListOfTks<Tk,typename RemRef<_Refs>::Tk...>

Position of all the Result TensComp in each Refs Tk

Definition at line 121 of file Bind.hpp.

template<typename TG , typename... _Refs>
using SUNphi::Binder< TG, _Refs >::PosOfResTcsPresInRefsTk = PosOfTcsOfTkPresInListOfTks<Tk,typename RemRef<_Refs>::Tk...>

Position of all the Result TensComp present in each Refs Tk

Definition at line 121 of file Bind.hpp.

template<typename TG , typename... _Refs>
template<int I>
using SUNphi::Binder< TG, _Refs >::Ref = TupleElementType<I,Tuple<_Refs...>>
private

Type of I-th SmET

Definition at line 85 of file Bind.hpp.

template<typename TG , typename... _Refs>
using SUNphi::Binder< TG, _Refs >::Refs = Tuple<_Refs...>
private

Type of the binding references

Definition at line 85 of file Bind.hpp.

Constructor & Destructor Documentation

template<typename TG , typename... _Refs>
template<typename SMET , typename = EnableIf<isSame<Unqualified<SMET>,Unqualified<Ref<0>>>>>
SUNphi::Binder< TG, _Refs >::Binder ( SMET &&  smet,
int  id 
)
inlineexplicit

Constructor taking a universal reference and the id

Todo:
add check on SMET
Parameters
smetReference to bind
idComponent to get

Definition at line 194 of file Bind.hpp.

Member Function Documentation

decltype(auto) SUNphi::NnarySmET< Binder< TG, _Refs... > >::_refEvalByCompsName ( IntSeq< I >  ,
IntSeq< Pos... >  ,
Tp &&  targs 
) const
inlineinherited

< Components to get

Evaluate the I-th reference, getting from the Tuple targs the element Pos

Internal implementation

Definition at line 54 of file NnarySmET.hpp.

decltype(auto) SUNphi::NnarySmET< Binder< TG, _Refs... > >::_refEvalByCompsName ( Ts &&...  ts)
inlineinherited

Overload the _refEvalByCompsName const method passing all args

Parameters
tsArguments

Definition at line 61 of file NnarySmET.hpp.

template<typename TG , typename... _Refs>
template<typename Is , typename = EnableIf<isIntSeq<Is>>>
static constexpr void SUNphi::Binder< TG, _Refs >::assertMergeableWith ( )
inlinestatic

Assert that a given merging condition is valid

Definition at line 125 of file Bind.hpp.

template<typename TG , typename... _Refs>
template<typename... Args, int... Head, int... Tail>
decltype(auto) SUNphi::Binder< TG, _Refs >::binderInternalEval ( IntSeq< Head... >  ,
IntSeq< Tail... >  ,
const Tuple< Args... > &  targs 
) const
inline

Evaluator for Binder

Internal Evaluator, inserting the id at the correct position in the list of args. Check on type B is omitted, as the function is called only from an already checked smet

Parameters
targsComponents to get

Definition at line 137 of file Bind.hpp.

template<typename TG , typename... _Refs>
template<typename TC , int I = 0>
int SUNphi::Binder< TG, _Refs >::compSize ( ) const
inline

Returns the size in the first found ref

TensKind of the I-th SmET

Check if the TensKind contains the TensComp asked

Definition at line 110 of file Bind.hpp.

template<typename TG , typename... _Refs>
template<typename... Args>
decltype(auto) SUNphi::Binder< TG, _Refs >::eval ( const Args &...  args) const
inline

Type of the arguments.

Evaluator, external interface

Pass to the internal implementation the integer sequence needed to deal properly with the insertion of the arg in the correct position

Position of the args to forward before insertion

Position of the args to forward after insertion

Parameters
argsComponents to get

Definition at line 155 of file Bind.hpp.

decltype(auto) SUNphi::NnarySmET< Binder< TG, _Refs... > >::evalThroughRepresentativeFunctionPassingCompsByName ( IntSeq< I... >  ,
const Args &...  args 
) const
inlineinherited

< Components to get

Evaluate the result by calling a representative function

The result is obtained after splitting the components, identifying them trough the name of each TensComp

Definition at line 93 of file NnarySmET.hpp.

decltype(auto) SUNphi::NnarySmET< Binder< TG, _Refs... > >::evalThroughRepresentativeFunctionPassingCompsByName ( Ts &&...  ts)
inlineinherited

Overload the evalThroughRepresentativeFunctionPassingCompsByName const method passing all args

Parameters
tsArguments

Definition at line 101 of file NnarySmET.hpp.

template<typename TG , typename... _Refs>
decltype(auto) SUNphi::Binder< TG, _Refs >::getMaximallyMergedCompsView ( )
inline

Returns the maximal possible merged comps view

Definition at line 125 of file Bind.hpp.

template<typename TG , typename... _Refs>
template<typename Is >
decltype(auto) SUNphi::Binder< TG, _Refs >::getMergedCompsView ( ) const
inline

Merge the components and create a new Binder taking the same component

Definition at line 127 of file Bind.hpp.

template<typename TG , typename... _Refs>
template<typename... Ts>
decltype(auto) SUNphi::Binder< TG, _Refs >::getMergedCompsView ( Ts &&...  ts)
inline

Overload the getMergedCompsView const method passing all args

Parameters
tsArguments

Definition at line 127 of file Bind.hpp.

template<typename TG , typename... _Refs>
template<typename Tref >
bool SUNphi::Binder< TG, _Refs >::isAliasing ( const Tref &  alias) const
inline

Forward aliasing check to the references

Definition at line 114 of file Bind.hpp.

decltype(auto) SUNphi::SmET< Binder< TG, _Refs... > >::operator() ( Oth &&...  oth)
inlineinherited

Implements the call operator via CRTP

Parameters
othOther quantit

Definition at line 289 of file BaseSmET.hpp.

decltype(auto) SUNphi::SmET< Binder< TG, _Refs... > >::operator() ( Oth &&...  oth) const
inlineinherited

Implements the const call operator via CRTP

< Other quantit

Definition at line 290 of file BaseSmET.hpp.

template<typename TG , typename... _Refs>
template<typename Oth >
decltype(auto) SUNphi::Binder< TG, _Refs >::operator= ( Oth &&  oth)
inline

Assign from another object

Parameters
othOther object

Definition at line 187 of file Bind.hpp.

Binder< TG, _Refs... > & SUNphi::NnarySmET< Binder< TG, _Refs... > >::operator~ ( )
inlineinherited

Cast operator to class T

Definition at line 46 of file NnarySmET.hpp.

const Binder< TG, _Refs... > & SUNphi::NnarySmET< Binder< TG, _Refs... > >::operator~ ( ) const
inlineinherited

Constant cast operator to class T

Definition at line 46 of file NnarySmET.hpp.

decltype(auto) SUNphi::NnarySmET< Binder< TG, _Refs... > >::refEvalByCompsName ( Tp &&  targs) const
inlineinherited

< Components to get

Evaluate the I-th reference, getting from the Tuple targs the element Pos

External implementation, using PosOfResTcsPresInRefsTk to dispatch components

Position of TensComp of the reference Tk present in thr result

Definition at line 68 of file NnarySmET.hpp.

decltype(auto) SUNphi::NnarySmET< Binder< TG, _Refs... > >::refEvalByCompsName ( Tp &&  targs)
inlineinherited

Evaluate the I-th reference, getting from the Tuple targs the element Pos

Non const version

Definition at line 82 of file NnarySmET.hpp.

Member Data Documentation

template<typename TG , typename... _Refs>
constexpr bool SUNphi::Binder< TG, _Refs >::isAssignable = Unqualified<Ref< 0 >>::isAssignable
static

Returns whether this SmET can be the left hand of an assignement

As assignable as ref 0

Definition at line 185 of file Bind.hpp.

template<typename TG , typename... _Refs>
constexpr bool SUNphi::Binder< TG, _Refs >::isStoring = false
static

Returns whether this SmET is storing

This SmET is not storing

Definition at line 113 of file Bind.hpp.

template<typename TG , typename... _Refs>
constexpr int SUNphi::Binder< TG, _Refs >::NSmET = 1
staticprivate

Number or SmET to act upon

Definition at line 85 of file Bind.hpp.

template<typename TG , typename... _Refs>
constexpr int SUNphi::Binder< TG, _Refs >::pos
staticprivate
Initial value:
=
posOfType<TG,typename NestedTk::types>

Position inside the reference of the type got by the bounder.

Definition at line 105 of file Bind.hpp.

template<typename TG , typename... _Refs>
Tuple<Reference<_Refs>...> SUNphi::Binder< TG, _Refs >::refs
private

Reference to the 1 object

Definition at line 85 of file Bind.hpp.


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