CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
reco::parser::ExpressionVarSetter Struct Reference

#include <ExpressionVarSetter.h>

Public Member Functions

 ExpressionVarSetter (ExpressionStack &exprStack, MethodStack &methStack, LazyMethodStack &lazyMethStack, TypeStack &typeStack)
 
void operator() (const char *, const char *) const
 

Private Member Functions

void lazyPush (const char *, const char *) const
 
void push (const char *, const char *) const
 

Private Attributes

ExpressionStackexprStack_
 
LazyMethodStacklazyMethStack_
 
MethodStackmethStack_
 
TypeStacktypeStack_
 

Detailed Description

Definition at line 19 of file ExpressionVarSetter.h.

Constructor & Destructor Documentation

reco::parser::ExpressionVarSetter::ExpressionVarSetter ( ExpressionStack exprStack,
MethodStack methStack,
LazyMethodStack lazyMethStack,
TypeStack typeStack 
)
inline

Definition at line 20 of file ExpressionVarSetter.h.

23  :
24  exprStack_(exprStack),
25  methStack_(methStack),
26  lazyMethStack_(lazyMethStack),
27  typeStack_(typeStack) { }

Member Function Documentation

void ExpressionVarSetter::lazyPush ( const char *  begin,
const char *  end 
) const
private

Definition at line 35 of file ExpressionVarSetter.cc.

35  {
36  exprStack_.push_back(boost::shared_ptr<ExpressionBase>(new ExpressionLazyVar(lazyMethStack_)));
37  lazyMethStack_.clear();
38  typeStack_.resize(1);
39 }
void ExpressionVarSetter::operator() ( const char *  begin,
const char *  end 
) const

Definition at line 10 of file ExpressionVarSetter.cc.

References edm::hlt::Exception.

10  {
11  //std::cerr << "ExpressionVarSetter: Pushed [" << std::string(begin,end) << "]" << std::endl;
12  if (!methStack_.empty()) push(begin,end);
13  else if (!lazyMethStack_.empty()) lazyPush(begin,end);
14  else throw Exception(begin) << " Expression didn't parse neither hastily nor lazyly. This must not happen.\n";
15 }
void lazyPush(const char *, const char *) const
#define end
Definition: vmac.h:38
void push(const char *, const char *) const
#define begin
Definition: vmac.h:31
void ExpressionVarSetter::push ( const char *  begin,
const char *  end 
) const
private

Definition at line 17 of file ExpressionVarSetter.cc.

References edm::hlt::Exception, reco::method::invalid, reco::parser::ExpressionVar::isValidReturnType(), and reco::typeCode().

17  {
18  Type type = typeStack_.back();
19  method::TypeCode retType = reco::typeCode(type);
20  if(retType == method::invalid)
21  throw Exception(begin)
22  << "member \"" << methStack_.back().method().Name() << "\" has an invalid return type: \""
23  << methStack_.back().method().TypeOf().Name() << "\"";
25  throw Exception(begin)
26  << "member \"" << methStack_.back().method().Name()
27  << "\" return type is \"" << methStack_.back().method().TypeOf().Name()
28  << "\" which is not convertible to double.";
29 
30  exprStack_.push_back(boost::shared_ptr<ExpressionBase>(new ExpressionVar(methStack_, retType)));
31  methStack_.clear();
32  typeStack_.resize(1);
33 }
type
Definition: HCALResponse.h:22
static bool isValidReturnType(method::TypeCode)
TypeCode typeCode(const Type &t)
Definition: returnType.cc:21
#define begin
Definition: vmac.h:31
Evaluate an object&#39;s method or datamember (or chain of them) to get a number.
Definition: ExpressionVar.h:21

Member Data Documentation

ExpressionStack& reco::parser::ExpressionVarSetter::exprStack_
private

Definition at line 34 of file ExpressionVarSetter.h.

LazyMethodStack& reco::parser::ExpressionVarSetter::lazyMethStack_
private

Definition at line 36 of file ExpressionVarSetter.h.

MethodStack& reco::parser::ExpressionVarSetter::methStack_
private

Definition at line 35 of file ExpressionVarSetter.h.

TypeStack& reco::parser::ExpressionVarSetter::typeStack_
private

Definition at line 37 of file ExpressionVarSetter.h.