SUNphi  1.0
BinarySmET.hpp File Reference

Header file defining basic properties of Binary SmET. More...

Go to the source code of this file.

Classes

struct  SUNphi::BaseBinarySmET
 Defines the BinarySmET type traits. More...
 
struct  SUNphi::ConstrainAreBinarySmETs< Args >
 
struct  SUNphi::HasMember_ref1< Type >
 
struct  SUNphi::HasMember_ref1< Type >::Fallback
 
struct  SUNphi::HasMember_ref1< Type >::Derived
 
struct  SUNphi::HasMember_ref1< Type >::Check< U, U >
 
struct  SUNphi::ConstrainHasMember_ref1< T >
 Class forcing T to have a member "ref1" defined. More...
 
struct  SUNphi::HasMember_ref2< Type >
 
struct  SUNphi::HasMember_ref2< Type >::Fallback
 
struct  SUNphi::HasMember_ref2< Type >::Derived
 
struct  SUNphi::HasMember_ref2< Type >::Check< U, U >
 
struct  SUNphi::ConstrainHasMember_ref2< T >
 Class forcing T to have a member "ref2" defined. More...
 
struct  SUNphi::BinarySmET< T >
 Binary SmET. More...
 

Namespaces

 SUNphi::PairOfTensKindMergeability
 Determine mergeability of pair of TensKind.
 

Macros

#define STATIC_ASSERT_IS_BINARY_SMET(...)
 Defines the check for a Binary SmET. More...
 
#define PROVIDE_BINARY_SMET_REFS
 Provide the reference to the objects. More...
 
#define PROVIDE_BINARY_SMET_SIMPLE_CREATOR(BINARY_SMET)
 Defines a simple creator taking a reference. More...
 
#define SIMPLE_BINARY_SMET_BUILDER(BUILDER, BINARY_SMET)
 Create a simple builder with a name and a BINARY_SMET returned type. More...
 
#define FORWARD_IS_ALIASING_TO_PAIR_OF_REFS
 
#define PROVIDE_MERGEABLE_COMPS_ACCORDING_TO_TWO_REFS
 

Typedefs

template<typename T , typename Ret = void>
using SUNphi::EnableIfIsBinarySmET = EnableIf< isBinarySmET< T >,Ret >
 
template<typename T >
using SUNphi::ConstrainIsBinarySmET = ConstrainIsBaseOf< BaseBinarySmET,T >
 
template<typename T >
using SUNphi::ConstrainIsNotBinarySmET = ConstrainIsNotBaseOf< BaseBinarySmET,T >
 
using SUNphi::PairOfTensKindMergeability::AbsentInBoth = IntSeq< false, false >
 Type returned when is absent in both.
 
template<typename MD1 , typename MD2 , typename I1 , typename I2 >
using SUNphi::PairOfTensKindMergeability::CompsMergeability = decltype(_compsMergeability(MD1{}, MD2{}, I1{}, I2{}))
 

Functions

template<typename Type >
constexpr bool SUNphi::hasMember_ref1Helper ()
 
template<typename Type >
constexpr bool SUNphi::hasMember_ref2Helper ()
 
template<typename PrevPres = AbsentInBoth, int ResPos = 0, int PrevPos1 = 0, int PrevPos2 = 0, int... MDel1, int... MDel2>
decltype(auto) SUNphi::PairOfTensKindMergeability::_compsMergeability (IntSeq< MDel1... > MD1, IntSeq< MDel2... > MD2, IntSeq<> P1, IntSeq<> P2)
 
template<typename PrevPres = AbsentInBoth, int ResPos = 0, int PrevPos1 = 0, int PrevPos2 = 0, int... MDel1, int... MDel2, int Head1, int... Tail1, int Head2, int... Tail2>
decltype(auto) SUNphi::PairOfTensKindMergeability::_compsMergeability (IntSeq< MDel1... > MD1, IntSeq< MDel2... > MD2, IntSeq< Head1, Tail1... > P1, IntSeq< Head2, Tail2... > P2)
 

Variables

template<typename T >
constexpr bool SUNphi::isBinarySmET = isBaseOf<BaseBinarySmET ,T>
 
template<typename Type >
constexpr bool SUNphi::hasMember_ref1 = hasMember_ref1Helper<RemRef<Type>>()
 
template<typename Type >
constexpr bool SUNphi::hasMember_ref2 = hasMember_ref2Helper<RemRef<Type>>()
 

Detailed Description

Header file defining basic properties of Binary SmET.

Definition in file BinarySmET.hpp.

Macro Definition Documentation

#define FORWARD_IS_ALIASING_TO_PAIR_OF_REFS
Value:
\
template <typename Tref> \
bool isAliasing(const Tref& alias) const \
{ \
return \
ref1.isAliasing(alias) or \
ref2.isAliasing(alias); \
}

Set aliasing according to the isAliasing of references 1 and 2

Todo:
enforce cehck only with TensClass

Definition at line 81 of file BinarySmET.hpp.

#define PROVIDE_BINARY_SMET_REFS
Value:
#define PROVIDE_SMET_REF(NUM)
Provide the reference to the object.
Definition: Reference.hpp:29

Provide the reference to the objects.

Definition at line 41 of file BinarySmET.hpp.

#define PROVIDE_BINARY_SMET_SIMPLE_CREATOR (   BINARY_SMET)
Value:
\
template <typename SMET1, \
typename SMET2, \
typename=EnableIf<isSame<Unqualified<SMET1>,Unqualified<Ref1>>>, \
typename=EnableIf<isSame<Unqualified<SMET2>,Unqualified<Ref2>>>> \
explicit BINARY_SMET(SMET1&& smet1,SMET2&& smet2) : ref1(forw<SMET1>(smet1)),ref2(forw<SMET2>(smet2)) \
{ \
}
constexpr T && forw(U &&u)
Forward according to http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2951.html.

Defines a simple creator taking a reference.

< Name of the BinarySmET

Definition at line 48 of file BinarySmET.hpp.

#define PROVIDE_MERGEABLE_COMPS_ACCORDING_TO_TWO_REFS
Value:
PairOfTensKindMergeability::template CompsMergeability< \
typename RemRef<Ref1>::MergeableComps, \
typename RemRef<Ref2>::MergeableComps, \
PosOfRef1TcsInResTk, \
PosOfRef2TcsInResTk>)
decltype(_compsMergeability(MD1{}, MD2{}, I1{}, I2{})) CompsMergeability
Definition: BinarySmET.hpp:197
#define PROVIDE_MERGEABLE_COMPS(LONG_DESCRIPTION,...)
Definition: BaseSmET.hpp:179

Provide component-mergeabilty according to the two refs, and the visible Tk

Todo:
check that this is general enough... probably not

Definition at line 202 of file BinarySmET.hpp.

#define SIMPLE_BINARY_SMET_BUILDER (   BUILDER,
  BINARY_SMET 
)
Value:
\ \ \ \
template <typename T1, /* Type of the first SmET to get */ \
typename T2, /* Type of the second SmET to get */ \
BINARY_SMET<T1,T2> BUILDER(T1&& smet1, \
T2&& smet2, \
{ \
\
return BINARY_SMET<T1,T2>(forw<T1>(smet1),forw<T2>(smet2)); \
} \
#define SFINAE_WORSEN_DEFAULT_VERSION_TEMPLATE_PARS
Definition: SFINAE.hpp:58
#define SWALLOW_SEMICOLON_AT_GLOBAL_SCOPE
#define SFINAE_WORSEN_DEFAULT_VERSION_ARGS_CHECK
Check that no extra arg is passed.
Definition: SFINAE.hpp:66
#define SFINAE_WORSEN_DEFAULT_VERSION_ARGS
Provide empty list of args, used to unprioritize default version.
Definition: SFINAE.hpp:62

Create a simple builder with a name and a BINARY_SMET returned type.

< Name of builder function

Definition at line 61 of file BinarySmET.hpp.

#define STATIC_ASSERT_IS_BINARY_SMET (   ...)
Value:
STATIC_ASSERT_IS_SMET(__VA_ARGS__); \
STATIC_ASSERT_HAS_MEMBER(ref1,__VA_ARGS__); \
STATIC_ASSERT_HAS_MEMBER(ref2,__VA_ARGS__)
#define STATIC_ASSERT_IS_SMET(...)
Definition: BaseSmET.hpp:257
#define STATIC_ASSERT_HAS_MEMBER(TAG,...)
Definition: TypeTraits.hpp:560

Defines the check for a Binary SmET.

Definition at line 24 of file BinarySmET.hpp.

Typedef Documentation

template<typename T >
using SUNphi::ConstrainIsBinarySmET = typedef ConstrainIsBaseOf<BaseBinarySmET ,T>

Class forcing T to inherits from BaseBinarySmET

Definition at line 15 of file BinarySmET.hpp.

template<typename T >
using SUNphi::ConstrainIsNotBinarySmET = typedef ConstrainIsNotBaseOf<BaseBinarySmET ,T>

Class forcing T not to inherits from BaseBinarySmET

Definition at line 15 of file BinarySmET.hpp.

template<typename T , typename Ret = void>
using SUNphi::EnableIfIsBinarySmET = typedef EnableIf< isBinarySmET <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 15 of file BinarySmET.hpp.

Function Documentation

template<typename Type >
constexpr bool SUNphi::hasMember_ref1Helper ( )

Intemediate function to distinguish the non-class case

Definition at line 18 of file BinarySmET.hpp.

template<typename Type >
constexpr bool SUNphi::hasMember_ref2Helper ( )

Intemediate function to distinguish the non-class case

Definition at line 21 of file BinarySmET.hpp.

Variable Documentation

template<typename Type >
constexpr bool SUNphi::hasMember_ref1 = hasMember_ref1Helper<RemRef<Type>>()

Detect if Type has member (variable or method) ref1

Uses SFINAE to induce ambiguity in the detection of the member

Definition at line 18 of file BinarySmET.hpp.

template<typename Type >
constexpr bool SUNphi::hasMember_ref2 = hasMember_ref2Helper<RemRef<Type>>()

Detect if Type has member (variable or method) ref2

Uses SFINAE to induce ambiguity in the detection of the member

Definition at line 21 of file BinarySmET.hpp.

template<typename T >
constexpr bool SUNphi::isBinarySmET = isBaseOf<BaseBinarySmET ,T>

Expression which is true if T inherits from BaseBinarySmET

Definition at line 15 of file BinarySmET.hpp.