Jpp
software
JTrigger
JBind2nd.hh
Go to the documentation of this file.
1
#ifndef __JTRIGGER__JBIND2ND__
2
#define __JTRIGGER__JBIND2ND__
3
4
#include <functional>
5
6
#include "
JTrigger/JMatch.hh
"
7
8
9
/**
10
* \author mdejong
11
*/
12
13
namespace
JTRIGGER
{}
14
namespace
JPP
{
using namespace
JTRIGGER
; }
15
16
namespace
JTRIGGER
{
17
18
19
/**
20
* Auxiliary class to convert binary JMatch operator and given hit to unary match operator.
21
*
22
* This class is equivalent to the STD binder2nd class but it uses references to the JMatch
23
* interface rather than copies of a derived class.
24
*/
25
template
<
class
JHit_t>
26
class
JBinder2nd
:
27
public
std::unary_function<JHit_t, bool>
28
{
29
public
:
30
/**
31
* Constructor.
32
*
33
* \param __match match operator
34
* \param __second second hit
35
*/
36
JBinder2nd
(
const
JMatch<JHit_t>
& __match,
37
const
JHit_t& __second) :
38
match
(__match),
39
second
(__second)
40
{}
41
42
43
/**
44
* Unary match operator.
45
*
46
* \param first first hit
47
* \return true if first and second hit match; else false
48
*/
49
inline
bool
operator()
(
const
JHit_t& first)
const
50
{
51
return
match
(first,
second
);
52
}
53
54
55
protected
:
56
const
JMatch<JHit_t>
&
match
;
57
const
JHit_t&
second
;
58
};
59
60
61
/**
62
* Auxiliary method to create JBinder2nd object.
63
*
64
* \param match match operator
65
* \param second second hit
66
* \return JBinder2nd
67
*/
68
template
<
class
JHit_t>
69
inline
JBinder2nd<JHit_t>
70
JBind2nd
(
const
JMatch<JHit_t>
& match,
const
JHit_t& second)
71
{
72
return
JBinder2nd<JHit_t>
(match, second);
73
}
74
}
75
76
#endif
JTRIGGER::JBind2nd
JBinder2nd< JHit_t > JBind2nd(const JMatch< JHit_t > &match, const JHit_t &second)
Auxiliary method to create JBinder2nd object.
Definition:
JBind2nd.hh:70
JTRIGGER::JMatch
Function object interface for hit matching.
Definition:
JMatch.hh:25
JTRIGGER::JBinder2nd
Auxiliary class to convert binary JMatch operator and given hit to unary match operator.
Definition:
JBind2nd.hh:26
JTRIGGER::JBinder2nd::match
const JMatch< JHit_t > & match
Definition:
JBind2nd.hh:56
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition:
JAAnetToolkit.hh:37
JTRIGGER::JBinder2nd::JBinder2nd
JBinder2nd(const JMatch< JHit_t > &__match, const JHit_t &__second)
Constructor.
Definition:
JBind2nd.hh:36
JTRIGGER::JBinder2nd::operator()
bool operator()(const JHit_t &first) const
Unary match operator.
Definition:
JBind2nd.hh:49
JTRIGGER::JBinder2nd::second
const JHit_t & second
Definition:
JBind2nd.hh:57
JMatch.hh
JTRIGGER
Checksum.
Definition:
JSupport/JSupport.hh:35
Generated by
1.8.16