1 #ifndef SelectorUtils_Expressions_h
2 #define SelectorUtils_Expressions_h
33 template<
class AnExpr>
39 Expr(
const AnExpr& expr = AnExpr() ):
mExpr(expr) {};
49 template<
class Value,
class ActON >
68 template <
class RETType >
81 template<
class Value,
class ActON >
195 template<
class A,
class Operation,
class B >
205 {
return Operation::apply(
mA(x),
mB(x) );}
215 template<
class A,
class B >
258 template<
class A,
class B >
261 template<
class A,
class B >
270 template<
class A ,
class ArgType>
273 template<
class ArgType>
278 template<
class ArgType>
287 template<
template<
class T>
class Op,
class A,
class B >
290 template<
template<
class T>
class Op,
class A,
class B>
299 template<
template<
class T>
class Op,
class A,
class B >
303 typedef typename ToExprTrait<A, ArgType>::ToExprType
ToExprType;
311 template<
template<
class T>
class Op,
class A,
class B >
315 typedef typename ToExprTrait<B, ArgType>::ToExprType
ToExprType;
330 template<
class A,
class B >
334 typedef typename operator_trait< Expr<A>, Add, TExpr<B> >::ReturnType ReturnType;
335 return ReturnType( ReturnBaseType(A, B) );
338 template<
class A,
class B >
339 typename operator_trait< A, Add , Expr<B> >::ReturnType
344 return ReturnType( ReturnBaseType(LToExpr(A), B) );
347 template<
class A,
class B >
348 typename operator_trait< Expr<A>, Add,
B >::ReturnType
351 typedef typename operator_trait< Expr<A>, Add, B >::ReturnBaseType ReturnBaseType;
352 typedef typename operator_trait< Expr<A>, Add, B >::ReturnType ReturnType;
353 return ReturnType( ReturnBaseType(A, RToExpr(B)) );
358 template<
class A,
class B >
359 typename operator_trait< Expr<A>, Mul, Expr<B> >::ReturnType
362 typedef typename operator_trait< Expr<A>, Mul,
Expr<B> >::ReturnType ReturnType;
363 return ReturnType( ReturnBaseType(A, B) );
366 template<
class A,
class B >
367 typename operator_trait< A, Mul, Expr<B> >::ReturnType
372 return ReturnType( ReturnBaseType(LToExpr(A), B) );
375 template<
class A,
class B >
376 typename operator_trait< Expr<A>, Mul,
B >::ReturnType
379 typedef typename operator_trait< Expr<A>, Mul, B >::ReturnBaseType ReturnBaseType;
380 typedef typename operator_trait< Expr<A>, Mul, B >::ReturnType ReturnType;
381 return ReturnType( ReturnBaseType(A, RToExpr(B)) );
386 template<
class A,
class B >
387 typename operator_trait< Expr<A>,
Div, Expr<B> >::ReturnType
390 typedef typename operator_trait< Expr<A>,
Div,
Expr<B> >::ReturnType ReturnType;
391 return ReturnType( ReturnBaseType(A, B) );
394 template<
class A,
class B >
395 typename operator_trait< A , Div, Expr<B> >::ReturnType
400 return ReturnType( ReturnBaseType(LToExpr(A), B) );
403 template<
class A,
class B >
404 typename operator_trait< Expr<A>,
Div,
B >::ReturnType
407 typedef typename operator_trait< Expr<A>,
Div, B >::ReturnBaseType ReturnBaseType;
408 typedef typename operator_trait< Expr<A>,
Div, B >::ReturnType ReturnType;
409 return ReturnType( ReturnBaseType(A, RToExpr(B)) );
414 template<
class A,
class B >
415 typename operator_trait< Expr<A>, And, Expr<B> >::ReturnType
419 typedef typename operator_trait< Expr<A>, And,
Expr<B> >::ReturnType ReturnType;
420 return ReturnType( ReturnBaseType(A, B) );
424 template<
class A,
class B >
425 typename operator_trait< A, And, Expr<B> >::ReturnType
430 return ReturnType( ReturnBaseType(LToExpr(A), B) );
433 template<
class A,
class B >
434 typename operator_trait< Expr<A>, And,
B >::ReturnType
437 typedef typename operator_trait< Expr<A>, And, B >::ReturnBaseType ReturnBaseType;
438 typedef typename operator_trait< Expr<A>, And, B >::ReturnType ReturnType;
439 return ReturnType( ReturnBaseType(A, RToExpr(B)) );
444 template<
class A,
class B >
445 typename operator_trait< Expr<A>, Or, Expr<B> >::ReturnType
448 typedef typename operator_trait< Expr<A>, Or,
Expr<B> >::ReturnType ReturnType;
449 return ReturnType( ReturnBaseType(A, B) );
452 template<
class A,
class B >
453 typename operator_trait< A, Or, Expr<B> >::ReturnType
458 return ReturnType( ReturnBaseType(LToExpr(A), B) );
461 template<
class A,
class B >
462 typename operator_trait< Expr<A>, Or,
B >::ReturnType
465 typedef typename operator_trait< Expr<A>, Or, B >::ReturnBaseType ReturnBaseType;
466 typedef typename operator_trait< Expr<A>, Or, B >::ReturnType ReturnType;
467 return ReturnType( ReturnBaseType(A, RToExpr(B)) );
472 template<
class A,
class B >
473 typename operator_trait< Expr<A>, Less, Expr<B> >::ReturnType
476 typedef typename operator_trait< Expr<A>, Less,
Expr<B> >::ReturnType ReturnType;
477 return ReturnType( ReturnBaseType(
A,
B) );
480 template<
class A,
class B >
481 typename operator_trait< A , Less, TExpr<B> >::ReturnType
482 operator<( const A& A, const Expr<B>&
B ){
486 return ReturnType( ReturnBaseType(LToExpr(
A),
B) );
489 template<
class A,
class B >
490 typename operator_trait< Expr<A>, Less,
B >::ReturnType
491 operator<( const Expr<A>&
A,
const B&
B ){
493 typedef typename operator_trait< TLt, TExpr<A>,
B >::ReturnBaseType ReturnBaseType;
494 typedef typename operator_trait< TLt, TExpr<A>,
B >::ReturnType ReturnType;
495 return ReturnType( ReturnBaseType(
A, RToExpr(
B)) );
500 template<
class A,
class B >
501 typename operator_trait< Expr<A>, LessEqual, Expr<B> >::ReturnType
504 typedef typename operator_trait< Expr<A>, LessEqual,
Expr<B> >::ReturnType ReturnType;
505 return ReturnType( ReturnBaseType(
A,
B) );
508 template<
class A,
class B >
509 typename operator_trait< A, LessEqual, Expr<B> >::ReturnType
510 operator<=( const A& A, const Expr<B>&
B ) {
515 return ReturnType( ReturnBaseType(LToExpr(
A),
B) );
518 template<
class A,
class B >
519 typename operator_trait< Expr<A>, LessEqual,
B >::ReturnType
520 operator<=( const Expr<A>&
A,
const B&
B ) {
522 typedef typename operator_trait< Expr<A>, LessEqual,
B >::ReturnBaseType ReturnBaseType;
523 typedef typename operator_trait< Expr<A>, LessEqual,
B >::ReturnType ReturnType;
524 return ReturnType( ReturnBaseType(
A, RToExpr(
B)) );
529 template<
class A,
class B >
530 typename operator_trait< Expr<A>, More, Expr<B> >::ReturnType
533 typedef typename operator_trait< Expr<A>, More,
Expr<B> >::ReturnType ReturnType;
534 return ReturnType( ReturnBaseType(A, B) );
537 template<
class A,
class B >
538 typename operator_trait< A, More, Expr<B> >::ReturnType
543 return ReturnType( ReturnBaseType(LToExpr(A), B) );
546 template<
class A,
class B >
547 typename operator_trait< Expr<A>, More,
B >::ReturnType
550 typedef typename operator_trait< Expr<A>, More, B >::ReturnBaseType ReturnBaseType;
551 typedef typename operator_trait< Expr<A>, More, B >::ReturnType ReturnType;
552 return ReturnType( ReturnBaseType(A, RToExpr(B)) );
557 template<
class A,
class B >
558 typename operator_trait< Expr<A>, MoreEqual, TExpr<B> >::ReturnType
561 typedef typename operator_trait< Expr<A>, MoreEqual,
Expr<B> >::ReturnType ReturnType;
562 return ReturnType( ReturnBaseType(A, B) );
565 template<
class A,
class B >
566 typename operator_trait< A , MoreEqual, TExpr<B> >::ReturnType
571 return ReturnType( ReturnBaseType(LToExpr(A), B) );
574 template<
class A,
class B >
575 typename operator_trait< Expr<A>, MoreEqual,
B >::ReturnType
578 typedef typename operator_trait< Expr<A>, MoreEqual, B >::ReturnBaseType ReturnBaseType;
579 typedef typename operator_trait< Expr<A>, MoreEqual, B >::ReturnType ReturnType;
580 return ReturnType( ReturnBaseType(A, RToExpr(B)) );
586 template<
class A,
class B >
587 typename operator_trait< Expr<A>, Equal, Expr<B> >::ReturnType
590 typedef typename operator_trait< Expr<A>, Equal,
Expr<B> >::ReturnType ReturnType;
591 return ReturnType( ReturnBaseType(A, B) );
594 template<
class A,
class B >
595 typename operator_trait< A , Equal, Expr<B> >::ReturnType
600 return ReturnType( ReturnBaseType(LToExpr(A), B) );
603 template<
class A,
class B >
604 typename operator_trait< Expr<A>, Equal,
B >::ReturnType
607 typedef typename operator_trait< Expr<A>, Equal, B >::ReturnBaseType ReturnBaseType;
608 typedef typename operator_trait< Expr<A>, Equal, B >::ReturnType ReturnType;
609 return ReturnType( ReturnBaseType(A, RToExpr(B)) );
RetType operator()(const ArgType &) const
static RetType apply(const RetType &a, const RetType &b)
ConvTraits< Expr< A >, Expr< B > >::ResultType ResultType
RetType operator()(const ArgType &x) const
virtual ExprBase * clone()
static RetType apply(const RetType &a, const RetType &b)
BasicConvTrait< LReturn, RReturn >::ResultType ResultType
ToExprTrait< A, ArgType >::ToExprType ToExprType
virtual bool operator()(const T &x) const
Expr< A >::ArgType ArgType
static RetType apply(const T &a, const T &b)
void operator()(Type *aClass)
RetType operator()(const ArgType &x) const
static RetType apply(const T &a, const T &b)
BinOp(const A &A, const B &B)
Expr< ReturnBaseType > ReturnType
RetType operator()(const ArgType &x) const
ConvTraits Expr< B >::ResultType ResultType
Expr< B >::ArgType ArgType
operator_trait< Expr< A >, Div, Expr< B > >::ReturnType operator/(const Expr< A > &A, const Expr< B > &B)
operator_trait< Expr< A >, Mul, Expr< B > >::ReturnType operator*(const Expr< A > &A, const Expr< B > &B)
Expr< ExprLiteral< int, ArgType > > ToExprType
Expr(const AnExpr &expr=AnExpr())
reco::JetExtendedAssociation::JetExtendedData Value
operator_trait< Expr< A >, Add, Expr< B > >::ReturnType operator+(const TExpr< A > &A, const TExpr< B > &B)
Operation::RetType RetType
ToExprTrait< B, ArgType >::ToExprType ToExprType
operator_trait< Expr< A >, Or, Expr< B > >::ReturnType operator||(const Expr< A > &A, const Expr< B > &B)
ExprUserFun(Value(ActON::*aFun)() const )
BinOp< Expr< A >, Op< ResultType >, Expr< B > > ReturnBaseType
RetType operator()(const ArgType &x) const
Expr< ExprLiteral< double, ArgType > > ToExprType
static RetType apply(const RetType &a, const RetType &b)
operator_trait< Expr< A >, MoreEqual, TExpr< B > >::ReturnType operator>=(const Expr< A > &A, const Expr< B > &B)
static RetType apply(const RetType &a, const RetType &b)
static RetType apply(const T &a, const T &b)
BinOp< ToExprType, Op< ResultType >, Expr< B > > ReturnBaseType
Expr< ReturnBaseType > ReturnType
operator_trait< Expr< A >, And, Expr< B > >::ReturnType operator&&(const Expr< A > &A, const Expr< B > &B)
Expr< B >::RetType RReturn
static RetType apply(const T &a, const T &b)
static RetType apply(bool a, bool b)
Expr< A >::RetType LReturn
RetType(ActON::* mFun)() const
operator_trait< Expr< A >, More, Expr< B > >::ReturnType operator>(const Expr< A > &A, const Expr< B > &B)
ExprLiteral(const RetType &val)
BinOp< Expr< A >, Op< ResultType >, ToExprType > ReturnBaseType
Expr< ReturnBaseType > ReturnType
ConvTraits< Expr< A >, ToExprType >::ResultType ResultType
static RetType apply(const T &a, const T &b)
static RetType apply(bool a, bool b)
::boost::mpl::if_< D1, D1, typename::boost::mpl::if_< D2, D2, D0 >::type >::type Div
operator_trait< Expr< A >, Equal, Expr< B > >::ReturnType operator==(const Expr< A > &A, const Expr< B > &B)