CMS 3D CMS Logo

Public Member Functions | Private Attributes

reco::parser::ExpressionLazyVar Struct Reference

#include <ExpressionVar.h>

Inheritance diagram for reco::parser::ExpressionLazyVar:
reco::parser::ExpressionBase

List of all members.

Public Member Functions

 ExpressionLazyVar (const std::vector< LazyInvoker > &methods)
virtual double value (const edm::ObjectWithDict &o) const
 ~ExpressionLazyVar ()

Private Attributes

std::vector< LazyInvokermethods_
std::vector< edm::ObjectWithDictobjects_

Detailed Description

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 52 of file ExpressionVar.h.


Constructor & Destructor Documentation

ExpressionLazyVar::ExpressionLazyVar ( const std::vector< LazyInvoker > &  methods)

Definition at line 140 of file ExpressionVar.cc.

                                                                           :
    methods_(methods)
{
}
ExpressionLazyVar::~ExpressionLazyVar ( )

Definition at line 145 of file ExpressionVar.cc.

{
}

Member Function Documentation

double ExpressionLazyVar::value ( const edm::ObjectWithDict o) const [virtual]

Implements reco::parser::ExpressionBase.

Definition at line 150 of file ExpressionVar.cc.

References edm::ObjectWithDict::invoke(), methods_, python::connectstrParser::o, objects_, cmsRelvalreport::red(), and run_regression::ret.

                                                          {
    std::vector<LazyInvoker>::const_iterator it, ed = methods_.end()-1;
    edm::ObjectWithDict ro = o;
    for (it = methods_.begin(); it < ed; ++it) {
        ro = it->invoke(ro, objects_);
    }
    double ret = it->invokeLast(ro, objects_);
    std::vector<edm::ObjectWithDict>::reverse_iterator rit, red = objects_.rend();
    for (rit = objects_.rbegin(); rit != red; ++rit) {
        rit->typeOf().destruct(rit->address(), false);
    }
    objects_.clear();
    return ret;
}

Member Data Documentation

Definition at line 59 of file ExpressionVar.h.

Referenced by value().

Definition at line 60 of file ExpressionVar.h.

Referenced by value().