Belle II Software development
BinaryJoin< ABinaryOp, AFunctor1, AFunctor2 > Struct Template Reference

Functor factory turning a binary functor and two functors into a new functor which executes the binary operation with input from the two given functors. More...

#include <Functional.h>

Inheritance diagram for BinaryJoin< ABinaryOp, AFunctor1, AFunctor2 >:

Public Member Functions

 operator FunctorTag ()
 Marker function for the isFunctor test.
 
 BinaryJoin ()=default
 Allow default construction.
 
 BinaryJoin (const ABinaryOp &binaryOp, const AFunctor1 &functor1, const AFunctor2 &functor2)
 Constructor from the nested functors.
 
 BinaryJoin (const AFunctor1 &functor1, const AFunctor2 &functor2)
 Constructor from the nested functors.
 
template<class T1 , class T2 >
auto operator() (const T1 &t1, const T2 &t2) const -> decltype(m_binaryOp(m_functor1(t1), m_functor2(t2)))
 Operator getting the result of the binary operation from two objects transformed by the two functors.
 
template<class T >
auto operator() (const T &t) const -> decltype(m_binaryOp(m_functor1(t), m_functor2(t)))
 Operator getting the result of the binary operation from one object transformed by the two functors.
 

Private Attributes

ABinaryOp m_binaryOp
 Memory for the binary operation.
 
AFunctor1 m_functor1
 Memory for the first nested functor.
 
AFunctor2 m_functor2
 Memory for the second nested functor.
 

Detailed Description

template<class ABinaryOp, class AFunctor1, class AFunctor2 = AFunctor1>
struct Belle2::TrackFindingCDC::BinaryJoin< ABinaryOp, AFunctor1, AFunctor2 >

Functor factory turning a binary functor and two functors into a new functor which executes the binary operation with input from the two given functors.

Definition at line 127 of file Functional.h.

Constructor & Destructor Documentation

◆ BinaryJoin() [1/2]

BinaryJoin ( const ABinaryOp &  binaryOp,
const AFunctor1 &  functor1,
const AFunctor2 &  functor2 
)
inline

Constructor from the nested functors.

Definition at line 136 of file Functional.h.

137 : m_binaryOp(binaryOp)
138 , m_functor1(functor1)
139 , m_functor2(functor2)
140 {
141 }
AFunctor2 m_functor2
Memory for the second nested functor.
Definition: Functional.h:160
ABinaryOp m_binaryOp
Memory for the binary operation.
Definition: Functional.h:154
AFunctor1 m_functor1
Memory for the first nested functor.
Definition: Functional.h:157

◆ BinaryJoin() [2/2]

BinaryJoin ( const AFunctor1 &  functor1,
const AFunctor2 &  functor2 
)
inline

Constructor from the nested functors.

Definition at line 145 of file Functional.h.

146 : m_binaryOp()
147 , m_functor1(functor1)
148 , m_functor2(functor2)
149 {
150 }

Member Function Documentation

◆ operator()() [1/2]

auto operator() ( const T &  t) const -> decltype(m_binaryOp(m_functor1(t), m_functor2(t)))
inline

Operator getting the result of the binary operation from one object transformed by the two functors.

Definition at line 172 of file Functional.h.

173 {
174 return m_binaryOp(m_functor1(t), m_functor2(t));
175 }

◆ operator()() [2/2]

auto operator() ( const T1 &  t1,
const T2 &  t2 
) const -> decltype(m_binaryOp(m_functor1(t1), m_functor2(t2)))
inline

Operator getting the result of the binary operation from two objects transformed by the two functors.

Definition at line 165 of file Functional.h.

166 {
167 return m_binaryOp(m_functor1(t1), m_functor2(t2));
168 }

Member Data Documentation

◆ m_binaryOp

ABinaryOp m_binaryOp
private

Memory for the binary operation.

Definition at line 154 of file Functional.h.

◆ m_functor1

AFunctor1 m_functor1
private

Memory for the first nested functor.

Definition at line 157 of file Functional.h.

◆ m_functor2

AFunctor2 m_functor2
private

Memory for the second nested functor.

Definition at line 160 of file Functional.h.


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