15 const vector<AnyMethodArgument>& ints)
92 for (
size_t i = 0;
i <
ints_.size(); ++
i) {
150 <<
" arguments returned a null pointer ";
156 retType = retType.
toType();
170 <<
"\" returned void invoked on object of type \"" 178 const std::vector<AnyMethodArgument>&
args)
180 , argsBeforeFixups_(args)
197 return *(found->second);
200 auto emplace_result =
invokers_.insert(std::make_pair(thetype,to_add) );
201 return *(emplace_result.first->second);
208 pair<edm::ObjectWithDict, bool> ret(o,
false);
212 type = ret.first.dynamicType();
216 while (ret.second ==
false);
223 std::vector<edm::ObjectWithDict>&
v)
const 225 pair<edm::ObjectWithDict, bool> ret(o,
false);
230 type = ret.first.dynamicType();
235 while (ret.second ==
false);
241 const std::vector<AnyMethodArgument>&
args)
247 isRefGet_ = !setter.
push(name, args,
"LazyInvoker dynamic resolution",
false);
257 storageNeedsDestructor_ =
false;
270 pair<edm::ObjectWithDict, bool>
280 pair<edm::ObjectWithDict, bool>
281 ret(
invokers_.front().invoke(o, storage_), !isRefGet_);
282 if (storageNeedsDestructor_) {
285 v.push_back(storage_);
295 throwFailedConversion(o);
305 <<
"member \"" <<
invokers_.back().methodName()
306 <<
"\" return type is \"" <<
invokers_.back().returnTypeName()
308 <<
"\" which is not convertible to double.";
edm::ObjectWithDict invoke(const edm::ObjectWithDict &obj, edm::ObjectWithDict &retstore) const
static bool makeStorage(edm::ObjectWithDict &obj, const edm::TypeWithDict &retType)
SingleInvoker(const edm::TypeWithDict &, const std::string &name, const std::vector< AnyMethodArgument > &args)
std::pair< edm::ObjectWithDict, bool > invoke(const edm::ObjectWithDict &o, std::vector< edm::ObjectWithDict > &v) const
MethodInvoker(const edm::FunctionWithDict &method, const std::vector< AnyMethodArgument > &ints=std::vector< AnyMethodArgument >())
std::string returnTypeName() const
std::vector< edm::TypeWithDict > TypeStack
static double objToDouble(const edm::ObjectWithDict &obj, method::TypeCode type)
std::string qualifiedName() const
double invokeLast(const edm::ObjectWithDict &o, std::vector< edm::ObjectWithDict > &v) const
invoke and coerce result to double
edm::MemberWithDict member_
TypeWithDict toType() const
TypeWithDict typeOf() const
std::vector< AnyMethodArgument > ints_
std::vector< AnyMethodArgument > MethodArgumentStack
static bool isValidReturnType(method::TypeCode)
std::string typeName() const
edm::MemberWithDict const member() const
edm::FunctionWithDict method_
TypeCode typeCode(const edm::TypeWithDict &t)
ObjectWithDict get() const
bool push(const std::string &, const std::vector< AnyMethodArgument > &, const char *, bool deep=true) const
TypeWithDict typeOf() const
std::type_info const & typeInfo() const
edm::TypeWithDict retTypeFinal_
void invoke(ObjectWithDict const &obj, ObjectWithDict *ret=nullptr, std::vector< void * > const &values=std::vector< void * >()) const
Call a member function.
edm::ObjectWithDict invoke(const edm::ObjectWithDict &o, std::vector< edm::ObjectWithDict > &v) const
TypeWithDict finalReturnType() const
std::vector< LazyInvoker > LazyMethodStack
MethodInvoker & operator=(const MethodInvoker &)
void throwFailedConversion(const edm::ObjectWithDict &) const
static void delStorage(edm::ObjectWithDict &)
const SingleInvoker & invoker(const edm::TypeWithDict &) const
TypeWithDict & stripConstRef()
std::string methodName() const
std::vector< void * > args_
std::vector< AnyMethodArgument > argsBeforeFixups_
double retToDouble(const edm::ObjectWithDict &) const
convert the output of invoke to a double, if possible
LazyInvoker(const std::string &name, const std::vector< AnyMethodArgument > &args)