CommonTools
Utils
interface
ExpressionEvaluator.h
Go to the documentation of this file.
1
#ifndef CommonToolsUtilsExpressionEvaluator_H
2
#define CommonToolsUtilsExpressionEvaluator_H
3
4
#include <string>
5
6
namespace
reco
{
7
8
class
ExpressionEvaluator
{
9
public
:
10
ExpressionEvaluator
(
const
char
*
pkg
,
const
char
* iname,
const
std::string
& iexpr);
11
~ExpressionEvaluator
();
12
13
template
<
typename
EXPR,
typename
... CArgs>
14
EXPR*
expr
()
const
{
15
typedef
EXPR* factoryP();
16
return
reinterpret_cast<factoryP*>(
m_expr
)();
17
}
18
19
private
:
20
std::string
m_name
;
21
void
*
m_expr
;
22
};
23
24
template
<
typename
EXPR>
25
EXPR*
expressionEvaluator
(
const
char
*
pkg
,
const
char
* iname,
const
std::string
& iexpr) {
26
ExpressionEvaluator
ee(
pkg
, iname, iexpr);
27
return
ee.
expr
<EXPR>();
28
}
29
30
}
// namespace reco
31
32
#define SINGLE_ARG(...) __VA_ARGS__
33
#define RECO_XSTR(...) RECO_STR(__VA_ARGS__)
34
#define RECO_STR(...) #__VA_ARGS__
35
#define reco_expressionEvaluator(pkg, EXPR, iexpr) reco::expressionEvaluator<EXPR>(pkg, RECO_XSTR(EXPR), iexpr)
36
37
#endif // CommonToolsUtilsExpressionEvaluator_H
reco::ExpressionEvaluator::m_expr
void * m_expr
Definition:
ExpressionEvaluator.h:21
reco::expressionEvaluator
EXPR * expressionEvaluator(const char *pkg, const char *iname, const std::string &iexpr)
Definition:
ExpressionEvaluator.h:25
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
reco::ExpressionEvaluator::m_name
std::string m_name
Definition:
ExpressionEvaluator.h:20
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
reco::ExpressionEvaluator::~ExpressionEvaluator
~ExpressionEvaluator()
Definition:
ExpressionEvaluator.cc:150
reco::ExpressionEvaluator::ExpressionEvaluator
ExpressionEvaluator(const char *pkg, const char *iname, const std::string &iexpr)
Definition:
ExpressionEvaluator.cc:45
pkg
Definition:
pkg.py:1
reco::ExpressionEvaluator::expr
EXPR * expr() const
Definition:
ExpressionEvaluator.h:14
reco::ExpressionEvaluator
Definition:
ExpressionEvaluator.h:8
Generated for CMSSW Reference Manual by
1.8.16