Keeps different SingleInvokers for each dynamic type of the objects passed to invoke() More...
#include <MethodInvoker.h>
Public Member Functions | |
Reflex::Object | invoke (const Reflex::Object &o, std::vector< Reflex::Object > &v) const |
double | invokeLast (const Reflex::Object &o, std::vector< Reflex::Object > &v) const |
invoke and coerce result to double | |
LazyInvoker (const std::string &name, const std::vector< AnyMethodArgument > &args) | |
~LazyInvoker () | |
Private Types | |
typedef boost::shared_ptr < SingleInvoker > | SingleInvokerPtr |
Private Member Functions | |
const SingleInvoker & | invoker (const Reflex::Type &t) const |
Private Attributes | |
std::vector< AnyMethodArgument > | argsBeforeFixups_ |
std::map< void *, SingleInvokerPtr > | invokers_ |
std::string | name_ |
Keeps different SingleInvokers for each dynamic type of the objects passed to invoke()
Definition at line 65 of file MethodInvoker.h.
typedef boost::shared_ptr<SingleInvoker> reco::parser::LazyInvoker::SingleInvokerPtr [private] |
Definition at line 79 of file MethodInvoker.h.
LazyInvoker::LazyInvoker | ( | const std::string & | name, |
const std::vector< AnyMethodArgument > & | args | ||
) | [explicit] |
Definition at line 86 of file MethodInvoker.cc.
: name_(name), argsBeforeFixups_(args) { }
LazyInvoker::~LazyInvoker | ( | ) |
Definition at line 92 of file MethodInvoker.cc.
{ }
Object LazyInvoker::invoke | ( | const Reflex::Object & | o, |
std::vector< Reflex::Object > & | v | ||
) | const |
invoke method, returns object that points to result (after stripping '*' and '&') the object is still owned by the LazyInvoker the actual Reflex::Object where the result is stored will be pushed in vector so that, if needed, its destructor can be called
Definition at line 109 of file MethodInvoker.cc.
References reco::parser::SingleInvoker::invoke(), invoker(), and runTheMatrix::ret.
double LazyInvoker::invokeLast | ( | const Reflex::Object & | o, |
std::vector< Reflex::Object > & | v | ||
) | const |
invoke and coerce result to double
Definition at line 121 of file MethodInvoker.cc.
References i, reco::parser::SingleInvoker::invoke(), invoker(), runTheMatrix::ret, and reco::parser::SingleInvoker::retToDouble().
const SingleInvoker & LazyInvoker::invoker | ( | const Reflex::Type & | t | ) | const [private] |
Definition at line 97 of file MethodInvoker.cc.
References argsBeforeFixups_, invokers_, and name_.
Referenced by invoke(), and invokeLast().
{ //std::cout << "LazyInvoker for " << name_ << " called on type " << type.Name(QUALIFIED|SCOPED) << std::endl; SingleInvokerPtr & invoker = invokers_[type.Id()]; if (!invoker) { //std::cout << " Making new invoker for " << name_ << " on type " << type.Name(QUALIFIED|SCOPED) << std::endl; invoker.reset(new SingleInvoker(type, name_, argsBeforeFixups_)); } return * invoker; }
std::vector<AnyMethodArgument> reco::parser::LazyInvoker::argsBeforeFixups_ [private] |
Definition at line 78 of file MethodInvoker.h.
Referenced by invoker().
std::map<void *, SingleInvokerPtr> reco::parser::LazyInvoker::invokers_ [mutable, private] |
Definition at line 80 of file MethodInvoker.h.
Referenced by invoker().
std::string reco::parser::LazyInvoker::name_ [private] |
Definition at line 77 of file MethodInvoker.h.
Referenced by invoker().