AmpGen
2.1
Toggle main menu visibility
Loading...
Searching...
No Matches
KeyedFunctors.h
Go to the documentation of this file.
1
#ifndef AMPGEN_LITESPAN_H
2
#define AMPGEN_LITESPAN_H
3
4
#include "
AmpGen/MsgService.h
"
5
#include "
AmpGen/Utilities.h
"
6
7
namespace
AmpGen
{
8
template
<
typename
return_type,
typename
... arg_types>
struct
KeyedFunctors
;
9
10
template
<
typename
return_type,
typename
... arg_types>
struct
KeyedFunctors
<return_type(arg_types...)> {
11
std::vector<std::function<return_type(arg_types...)>>
functors
;
12
std::vector<std::string>
keys
;
13
std::vector<std::string>
titles
;
14
template
<
typename
functor_type>
void
add
(
const
functor_type &functor,
const
std::string &key,
const
std::string &title =
""
) {
15
functors
.push_back(functor);
16
keys
.push_back(key);
17
titles
.push_back(title);
18
}
19
std::vector<return_type>
operator()
(arg_types... arg)
const
{
20
std::vector<return_type> rt;
21
for
(
auto
&f :
functors
) rt.push_back(f(arg...));
22
return
rt;
23
}
24
};
25
26
}
27
28
#endif
MsgService.h
Utilities.h
AmpGen
Definition
AddCPConjugate.h:2
AmpGen::KeyedFunctors
Definition
KeyedFunctors.h:8
AmpGen::KeyedFunctors< return_type(arg_types...)>::functors
std::vector< std::function< return_type(arg_types...)> > functors
Definition
KeyedFunctors.h:11
AmpGen::KeyedFunctors< return_type(arg_types...)>::operator()
std::vector< return_type > operator()(arg_types... arg) const
Definition
KeyedFunctors.h:19
AmpGen::KeyedFunctors< return_type(arg_types...)>::titles
std::vector< std::string > titles
Definition
KeyedFunctors.h:13
AmpGen::KeyedFunctors< return_type(arg_types...)>::add
void add(const functor_type &functor, const std::string &key, const std::string &title="")
Definition
KeyedFunctors.h:14
AmpGen::KeyedFunctors< return_type(arg_types...)>::keys
std::vector< std::string > keys
Definition
KeyedFunctors.h:12
AmpGen
KeyedFunctors.h
Generated on
for AmpGen by
1.17.0