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 Types | Private Member Functions | Private Attributes
reco::parser::LazyInvoker Struct Reference

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 More...
 
 LazyInvoker (const std::string &name, const std::vector< AnyMethodArgument > &args)
 
 ~LazyInvoker ()
 

Private Types

typedef boost::shared_ptr
< SingleInvoker
SingleInvokerPtr
 

Private Member Functions

const SingleInvokerinvoker (const Reflex::Type &t) const
 

Private Attributes

std::vector< AnyMethodArgumentargsBeforeFixups_
 
std::map< void
*, SingleInvokerPtr
invokers_
 
std::string name_
 

Detailed Description

Keeps different SingleInvokers for each dynamic type of the objects passed to invoke()

Definition at line 65 of file MethodInvoker.h.

Member Typedef Documentation

typedef boost::shared_ptr<SingleInvoker> reco::parser::LazyInvoker::SingleInvokerPtr
private

Definition at line 79 of file MethodInvoker.h.

Constructor & Destructor Documentation

LazyInvoker::LazyInvoker ( const std::string &  name,
const std::vector< AnyMethodArgument > &  args 
)
explicit

Definition at line 86 of file MethodInvoker.cc.

86  :
87  name_(name),
89 {
90 }
dictionary args
std::vector< AnyMethodArgument > argsBeforeFixups_
Definition: MethodInvoker.h:78
LazyInvoker::~LazyInvoker ( )

Definition at line 92 of file MethodInvoker.cc.

93 {
94 }

Member Function Documentation

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 run_regression::ret.

110 {
111  pair<Object, bool> ret(o,false);
112  do {
113  Type type = ret.first.TypeOf();
114  if (type.IsClass()) type = ret.first.DynamicType();
115  ret = invoker(type).invoke(Object(type, ret.first.Address()), v);
116  } while (ret.second == false);
117  return ret.first;
118 }
type
Definition: HCALResponse.h:22
std::pair< Reflex::Object, bool > invoke(const Reflex::Object &o, std::vector< Reflex::Object > &v) const
const SingleInvoker & invoker(const Reflex::Type &t) const
mathSSE::Vec4< T > v
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(), run_regression::ret, and reco::parser::SingleInvoker::retToDouble().

122 {
123  pair<Object, bool> ret(o,false);
124  const SingleInvoker *i = 0;
125  do {
126  Type type = ret.first.TypeOf();
127  if (type.IsClass()) type = ret.first.DynamicType();
128  i = & invoker(type);
129  ret = i->invoke(Object(type, ret.first.Address()), v);
130  } while (ret.second == false);
131  return i->retToDouble(ret.first);
132 }
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
double retToDouble(const Reflex::Object &o) const
std::pair< Reflex::Object, bool > invoke(const Reflex::Object &o, std::vector< Reflex::Object > &v) const
const SingleInvoker & invoker(const Reflex::Type &t) const
mathSSE::Vec4< T > v
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().

98 {
99  //std::cout << "LazyInvoker for " << name_ << " called on type " << type.Name(QUALIFIED|SCOPED) << std::endl;
101  if (!invoker) {
102  //std::cout << " Making new invoker for " << name_ << " on type " << type.Name(QUALIFIED|SCOPED) << std::endl;
103  invoker.reset(new SingleInvoker(type, name_, argsBeforeFixups_));
104  }
105  return * invoker;
106 }
type
Definition: HCALResponse.h:22
std::map< void *, SingleInvokerPtr > invokers_
Definition: MethodInvoker.h:80
boost::shared_ptr< SingleInvoker > SingleInvokerPtr
Definition: MethodInvoker.h:79
const SingleInvoker & invoker(const Reflex::Type &t) const
std::vector< AnyMethodArgument > argsBeforeFixups_
Definition: MethodInvoker.h:78

Member Data Documentation

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_
mutableprivate

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