#include <ExpressionVar.h>
Public Member Functions | |
ExpressionLazyVar (const std::vector< LazyInvoker > &methods) | |
virtual double | value (const Reflex::Object &o) const |
~ExpressionLazyVar () | |
Private Attributes | |
std::vector< LazyInvoker > | methods_ |
std::vector< Reflex::Object > | objects_ |
Same as ExpressionVar but with lazy resolution of object methods using the final type of the object, and not the one fixed at compile time
Definition at line 53 of file ExpressionVar.h.
ExpressionLazyVar::ExpressionLazyVar | ( | const std::vector< LazyInvoker > & | methods | ) |
Definition at line 152 of file ExpressionVar.cc.
: methods_(methods) { }
ExpressionLazyVar::~ExpressionLazyVar | ( | ) |
Definition at line 157 of file ExpressionVar.cc.
{ }
double ExpressionLazyVar::value | ( | const Reflex::Object & | o | ) | const [virtual] |
Implements reco::parser::ExpressionBase.
Definition at line 162 of file ExpressionVar.cc.
References methods_, python::connectstrParser::o, objects_, cmsRelvalreport::red(), and runTheMatrix::ret.
{ std::vector<LazyInvoker>::const_iterator it, ed = methods_.end()-1; Reflex::Object ro = o; for (it = methods_.begin(); it < ed; ++it) { ro = it->invoke(ro, objects_); } double ret = it->invokeLast(ro, objects_); std::vector<Reflex::Object>::reverse_iterator rit, red = objects_.rend(); for (rit = objects_.rbegin(); rit != red; ++rit) { rit->TypeOf().Destruct(rit->Address(), false); } objects_.clear(); return ret; }
std::vector<LazyInvoker> reco::parser::ExpressionLazyVar::methods_ [private] |
Definition at line 60 of file ExpressionVar.h.
Referenced by value().
std::vector<Reflex::Object> reco::parser::ExpressionLazyVar::objects_ [mutable, private] |
Definition at line 61 of file ExpressionVar.h.
Referenced by value().