SUNphi
1.0
|
Header file defining basic properties of Smart Expression Templates. More...
#include <ints/IntSeqGetEl.hpp>
#include <metaprogramming/CRTP.hpp>
#include <metaprogramming/SwallowSemicolon.hpp>
#include <metaprogramming/TypeTraits.hpp>
#include <metaprogramming/UniversalReferences.hpp>
#include <iostream>
Go to the source code of this file.
Macros | |
#define | STATIC_CONSTEXPR(DESCRIPTION, LONG_DESCRIPTION, TYPE, NAME, ...) |
Provides an attribute. More... | |
#define | USING(DESCRIPTION, LONG_DESCRIPTION, NAME, ...) |
Provides an attribute. More... | |
#define | DEFINE_GETTER_WITH_DEFAULT(NAME, DEFVAL) |
Define a getter of an attibute, with a default. More... | |
#define | IS_STORING_ATTRIBUTE(LONG_DESCRIPTION, ...) STATIC_CONSTEXPR(/*! Returns whether this SmET is storing */,LONG_DESCRIPTION,bool,isStoring,__VA_ARGS__) |
Provides a isStoring attribute. | |
#define | STORING IS_STORING_ATTRIBUTE(/*! This \c SmET is storing */,true) |
Set the SmET to storing. | |
#define | NOT_STORING IS_STORING_ATTRIBUTE(/*! This \c SmET is not storing */,false) |
Set the SmET to not-storing. | |
#define | PROVIDE_TK(...) |
Provides the Tk member. More... | |
#define | PROVIDE_FUND(...) |
Provides the Fund member. More... | |
#define | PROVIDE_IS_ALIASING(LONG_DESCRIPTION, ...) |
Provides a isAliasing method, taking alias as argument. More... | |
#define | IS_ALIASING_ACCORDING_TO_POINTER(_p) |
#define | IS_ASSIGNABLE_ATTRIBUTE(LONG_DESCRIPTION, ...) STATIC_CONSTEXPR(/*! Returns whether this \c SmET can be the left hand of an assignement */,LONG_DESCRIPTION,bool,isAssignable,__VA_ARGS__) |
Provides a isAssignable attribute. | |
#define | ASSIGNABLE IS_ASSIGNABLE_ATTRIBUTE(/*! This \c SmET can be assigned */,true) |
Set the SmET as assignable. | |
#define | NOT_ASSIGNABLE IS_ASSIGNABLE_ATTRIBUTE(/*! This \c SmET cannot be assigned */,false) |
Set the SmET as not-assignable. | |
#define | PROVIDE_MERGEABLE_COMPS(LONG_DESCRIPTION, ...) |
#define | NOT_MERGEABLE PROVIDE_MERGEABLE_COMPS(/*! The class has no mergeable componentes */,IntSeq<>) |
States that the class has no mergeable component. | |
#define | PROVIDE_MERGEABLE_COMPS_MARKING_ONE_AS_NON_MERGEABLE(LONG_DESCRIPTION, IN_MERGEABLE_COMPS, POS) |
States that the class has no mergeable component. More... | |
#define | PROVIDE_GET_MERGED_COMPS_VIEW(DESCRIPTION, ...) |
Provides a getMergedCompsView method, taking Is as template parameter. More... | |
#define | PROVIDE_POS_OF_TCS_IN_RES_TK_AND_MERGED_DELIMS_FOR_REF(ID) |
#define | STATIC_ASSERT_IS_SMET(...) |
#define | PROVIDE_CALL_OPERATOR(QUALIFIER) |
Provide the call operator with a given qualifier. More... | |
#define | SMET_GOES_ON_LHS(LHS_FUN, SMET) |
Typedefs | |
template<typename T , typename Ret = void> | |
using | SUNphi::EnableIfIsSmET = EnableIf< isSmET< T >,Ret > |
template<typename T > | |
using | SUNphi::ConstrainIsSmET = ConstrainIsBaseOf< BaseSmET,T > |
template<typename T > | |
using | SUNphi::ConstrainIsNotSmET = ConstrainIsNotBaseOf< BaseSmET,T > |
template<typename T , typename = ConstrainIsSmET<T>> | |
using | SUNphi::TkOf = typename RemRef< T >::Tk |
Returns the fundamental type of a class. | |
template<typename T , typename = ConstrainIsSmET<T>> | |
using | SUNphi::FundTypeOf = typename RemRef< T >::Fund |
Returns the fundamental type of a class. | |
Functions | |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_nameHelper () |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_evalHelper () |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_isStoringHelper () |
template<typename T , auto DefVal = false> | |
constexpr bool | SUNphi::_getisStoring () |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_TkHelper () |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_FundHelper () |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_isAliasingHelper () |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_isAssignableHelper () |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_MergeableCompsHelper () |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_assertMergeableWithHelper () |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_getMergedCompsViewHelper () |
Variables | |
template<typename T > | |
constexpr bool | SUNphi::isSmET = isBaseOf<BaseSmET ,T> |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_name = hasMember_nameHelper<RemRef<Type>>() |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_eval = hasMember_evalHelper<RemRef<Type>>() |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_isStoring = hasMember_isStoringHelper<RemRef<Type>>() |
template<typename T , auto DefVal = false> | |
constexpr bool | SUNphi::isStoring = _getisStoring <T, false >() |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_Tk = hasMember_TkHelper<RemRef<Type>>() |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_Fund = hasMember_FundHelper<RemRef<Type>>() |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_isAliasing = hasMember_isAliasingHelper<RemRef<Type>>() |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_isAssignable = hasMember_isAssignableHelper<RemRef<Type>>() |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_MergeableComps = hasMember_MergeableCompsHelper<RemRef<Type>>() |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_assertMergeableWith = hasMember_assertMergeableWithHelper<RemRef<Type>>() |
template<typename Type > | |
constexpr bool | SUNphi::hasMember_getMergedCompsView = hasMember_getMergedCompsViewHelper<RemRef<Type>>() |
Header file defining basic properties of Smart Expression Templates.
Definition in file BaseSmET.hpp.
#define DEFINE_GETTER_WITH_DEFAULT | ( | NAME, | |
DEFVAL | |||
) |
Define a getter of an attibute, with a default.
< Name of the attribute
< Default value
Definition at line 35 of file BaseSmET.hpp.
#define IS_ALIASING_ACCORDING_TO_POINTER | ( | _p | ) |
Set aliasing according to a passed pointer (provided class member)
Definition at line 138 of file BaseSmET.hpp.
#define PROVIDE_CALL_OPERATOR | ( | QUALIFIER | ) |
Provide the call operator with a given qualifier.
Definition at line 277 of file BaseSmET.hpp.
#define PROVIDE_FUND | ( | ... | ) |
Provides the Fund
member.
Definition at line 108 of file BaseSmET.hpp.
#define PROVIDE_GET_MERGED_COMPS_VIEW | ( | DESCRIPTION, | |
... | |||
) |
Provides a getMergedCompsView
method, taking Is as template parameter.
Definition at line 216 of file BaseSmET.hpp.
#define PROVIDE_IS_ALIASING | ( | LONG_DESCRIPTION, | |
... | |||
) |
Provides a isAliasing
method, taking alias
as argument.
Definition at line 127 of file BaseSmET.hpp.
#define PROVIDE_MERGEABLE_COMPS | ( | LONG_DESCRIPTION, | |
... | |||
) |
Provide the MergeableComps type, assertMergebaleWith
and getMaximallyMergedCompsView
The type must be an ordered IntSeq
indicating the splitting point of the TensKind
, as in this example:
Definition at line 179 of file BaseSmET.hpp.
#define PROVIDE_MERGEABLE_COMPS_MARKING_ONE_AS_NON_MERGEABLE | ( | LONG_DESCRIPTION, | |
IN_MERGEABLE_COMPS, | |||
POS | |||
) |
States that the class has no mergeable component.
Definition at line 201 of file BaseSmET.hpp.
#define PROVIDE_POS_OF_TCS_IN_RES_TK_AND_MERGED_DELIMS_FOR_REF | ( | ID | ) |
Provides the MergedDelim
attribute for Refs of a given ID
Definition at line 236 of file BaseSmET.hpp.
#define PROVIDE_TK | ( | ... | ) |
Provides the Tk
member.
Definition at line 94 of file BaseSmET.hpp.
#define SMET_GOES_ON_LHS | ( | LHS_FUN, | |
SMET | |||
) |
Defines a simple way to swap an SmET from rhs to lhs
why can't we make only const & on rhs?
we need to enforce SmET
< External builder
Definition at line 299 of file BaseSmET.hpp.
#define STATIC_ASSERT_IS_SMET | ( | ... | ) |
Defines the check for a SmET
add costRead
add costEval
add isAliasing
Definition at line 257 of file BaseSmET.hpp.
#define STATIC_CONSTEXPR | ( | DESCRIPTION, | |
LONG_DESCRIPTION, | |||
TYPE, | |||
NAME, | |||
... | |||
) |
Provides an attribute.
Definition at line 19 of file BaseSmET.hpp.
#define USING | ( | DESCRIPTION, | |
LONG_DESCRIPTION, | |||
NAME, | |||
... | |||
) |
Provides an attribute.
Definition at line 27 of file BaseSmET.hpp.
using SUNphi::ConstrainIsNotSmET = typedef ConstrainIsNotBaseOf<BaseSmET ,T> |
Class forcing T not to inherits from BaseSmET
Definition at line 64 of file BaseSmET.hpp.
using SUNphi::ConstrainIsSmET = typedef ConstrainIsBaseOf<BaseSmET ,T> |
Class forcing T to inherits from BaseSmET
Definition at line 64 of file BaseSmET.hpp.
using SUNphi::EnableIfIsSmET = typedef EnableIf< isSmET <T> ,Ret> |
Provides the class itself if T is of the given type
Provides the class itself if T satisfies the condition
Definition at line 64 of file BaseSmET.hpp.
constexpr bool SUNphi::_getisStoring | ( | ) |
Provides a function to get isStoring , or a false if not present
and no external Defval
is provided
Internal implentation
Definition at line 89 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_assertMergeableWithHelper | ( | ) |
Intemediate function to distinguish the non-class case
Definition at line 213 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_evalHelper | ( | ) |
Intemediate function to distinguish the non-class case
Definition at line 70 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_FundHelper | ( | ) |
Intemediate function to distinguish the non-class case
Definition at line 113 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_getMergedCompsViewHelper | ( | ) |
Intemediate function to distinguish the non-class case
Definition at line 231 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_isAliasingHelper | ( | ) |
Intemediate function to distinguish the non-class case
Definition at line 124 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_isAssignableHelper | ( | ) |
Intemediate function to distinguish the non-class case
Definition at line 152 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_isStoringHelper | ( | ) |
Intemediate function to distinguish the non-class case
Definition at line 75 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_MergeableCompsHelper | ( | ) |
Intemediate function to distinguish the non-class case
Definition at line 210 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_nameHelper | ( | ) |
Intemediate function to distinguish the non-class case
Definition at line 67 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_TkHelper | ( | ) |
Intemediate function to distinguish the non-class case
Definition at line 99 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_assertMergeableWith = hasMember_assertMergeableWithHelper<RemRef<Type>>() |
Detect if Type
has member (variable or method) assertMergeableWith
Uses SFINAE to induce ambiguity in the detection of the member
Definition at line 213 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_eval = hasMember_evalHelper<RemRef<Type>>() |
Detect if Type
has member (variable or method) eval
Uses SFINAE to induce ambiguity in the detection of the member
Definition at line 70 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_Fund = hasMember_FundHelper<RemRef<Type>>() |
Detect if Type
has member (variable or method) Fund
Uses SFINAE to induce ambiguity in the detection of the member
Definition at line 113 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_getMergedCompsView = hasMember_getMergedCompsViewHelper<RemRef<Type>>() |
Detect if Type
has member (variable or method) getMergedCompsView
Uses SFINAE to induce ambiguity in the detection of the member
Definition at line 231 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_isAliasing = hasMember_isAliasingHelper<RemRef<Type>>() |
Detect if Type
has member (variable or method) isAliasing
Uses SFINAE to induce ambiguity in the detection of the member
Definition at line 124 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_isAssignable = hasMember_isAssignableHelper<RemRef<Type>>() |
Detect if Type
has member (variable or method) isAssignable
Uses SFINAE to induce ambiguity in the detection of the member
Definition at line 152 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_isStoring = hasMember_isStoringHelper<RemRef<Type>>() |
Detect if Type
has member (variable or method) isStoring
Uses SFINAE to induce ambiguity in the detection of the member
Definition at line 75 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_MergeableComps = hasMember_MergeableCompsHelper<RemRef<Type>>() |
Detect if Type
has member (variable or method) MergeableComps
Uses SFINAE to induce ambiguity in the detection of the member
Definition at line 210 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_name = hasMember_nameHelper<RemRef<Type>>() |
Detect if Type
has member (variable or method) name
Uses SFINAE to induce ambiguity in the detection of the member
Definition at line 67 of file BaseSmET.hpp.
constexpr bool SUNphi::hasMember_Tk = hasMember_TkHelper<RemRef<Type>>() |
Detect if Type
has member (variable or method) Tk
Uses SFINAE to induce ambiguity in the detection of the member
Definition at line 99 of file BaseSmET.hpp.
constexpr bool SUNphi::isSmET = isBaseOf<BaseSmET ,T> |
Expression which is true if T inherits from BaseSmET
Definition at line 64 of file BaseSmET.hpp.
constexpr bool SUNphi::isStoring = _getisStoring <T, false >() |
Provides a function to get isStoring , or a false if not present
Gives visibility to internal implementation
Definition at line 89 of file BaseSmET.hpp.