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 Reflex::Object &o) const
 ~ExpressionLazyVar ()

Private Attributes

std::vector< LazyInvokermethods_
std::vector< Reflex::Object > objects_

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


Constructor & Destructor Documentation

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.

{
}

Member Function Documentation

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;
}

Member Data Documentation

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().