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

Functor factory from the functional composition of two functors. More...

#include <Functional.h>

Public Member Functions

 operator FunctorTag ()
 Marker function for the isFunctor test.
 
 Composition ()=default
 Allow default construction.
 
 Composition (const AFunctor2 &functor2)
 Constructor from the nested functor.
 
 Composition (const AFunctor1 &functor1, const AFunctor2 &functor2)
 Constructor from the first and the nested functor.
 
template<class T >
auto operator() (const T &t) const -> decltype(m_functor1(m_functor2(t)))
 Operator getting the result of the function composition.
 

Private Attributes

AFunctor1 m_functor1
 Memory for the nested functor.
 
AFunctor2 m_functor2
 Memory for the nested functor.
 

Detailed Description

template<class AFunctor1, class AFunctor2>
struct Belle2::TrackFindingCDC::Composition< AFunctor1, AFunctor2 >

Functor factory from the functional composition of two functors.

Definition at line 87 of file Functional.h.

Constructor & Destructor Documentation

◆ Composition() [1/2]

Composition ( const AFunctor2 &  functor2)
inlineexplicit

Constructor from the nested functor.

Definition at line 95 of file Functional.h.

96 : m_functor1()
97 , m_functor2(functor2)
98 {
99 }
AFunctor2 m_functor2
Memory for the nested functor.
Definition: Functional.h:113
AFunctor1 m_functor1
Memory for the nested functor.
Definition: Functional.h:110

◆ Composition() [2/2]

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

Constructor from the first and the nested functor.

Definition at line 102 of file Functional.h.

103 : m_functor1(functor1)
104 , m_functor2(functor2)
105 {
106 }

Member Function Documentation

◆ operator()()

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

Operator getting the result of the function composition.

Definition at line 118 of file Functional.h.

119 {
120 return m_functor1(m_functor2(t));
121 }

Member Data Documentation

◆ m_functor1

AFunctor1 m_functor1
private

Memory for the nested functor.

Definition at line 110 of file Functional.h.

◆ m_functor2

AFunctor2 m_functor2
private

Memory for the nested functor.

Definition at line 113 of file Functional.h.


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