14 : method_(
method), member_(), ints_(ints), isFunction_(
true) {
34 : method_(), member_(member), ints_(), isFunction_(
false) {
51 : method_(rhs.method_),
54 isFunction_(rhs.isFunction_),
55 retTypeFinal_(rhs.retTypeFinal_) {
73 for (
size_t i = 0;
i <
ints_.size(); ++
i) {
118 if (
addr ==
nullptr) {
120 <<
"method \"" <<
methodName() <<
"\" called with " <<
args_.size() <<
" arguments returned a null pointer ";
126 retType = retType.
toType();
138 <<
"method \"" <<
methodName() <<
"\" returned void invoked on object of type \"" <<
o.typeOf().qualifiedName()
145 : name_(
name), argsBeforeFixups_(
args) {}
155 return *(
found->second);
158 auto emplace_result =
invokers_.insert(std::make_pair(thetype, to_add));
159 return *(emplace_result.first->second);
163 pair<edm::ObjectWithDict, bool>
ret(
o,
false);
166 if (
type.isClass()) {
167 type =
ret.first.dynamicType();
170 }
while (
ret.second ==
false);
175 pair<edm::ObjectWithDict, bool>
ret(
o,
false);
179 if (
type.isClass()) {
180 type =
ret.first.dynamicType();
184 }
while (
ret.second ==
false);
185 return i->retToDouble(
ret.first);
190 const std::vector<AnyMethodArgument>&
args) {
214 std::vector<edm::ObjectWithDict>&
v)
const {
239 <<
"member \"" <<
invokers_.back().methodName() <<
"\" return type is \"" <<
invokers_.back().returnTypeName()
240 <<
"\" retured a \"" <<
o.typeOf().qualifiedName() <<
"\" which is not convertible to double.";
const SingleInvoker & invoker(const edm::TypeWithDict &) const
SingleInvoker(const SingleInvoker &)=delete
method::TypeCode retType_
static bool makeStorage(edm::ObjectWithDict &obj, const edm::TypeWithDict &retType)
TypeWithDict typeOf() const
edm::ObjectWithDict invoke(const edm::ObjectWithDict &obj, edm::ObjectWithDict &retstore) const
TypeWithDict finalReturnType() const
bool isRefGet_
true if this invoker just pops out a ref and returns (ref.get(), false)
bool storageNeedsDestructor_
ret
prodAgent to be discontinued
double retToDouble(const edm::ObjectWithDict &) const
convert the output of invoke to a double, if possible
std::string methodName() const
MethodInvoker(const edm::FunctionWithDict &method, const std::vector< AnyMethodArgument > &ints=std::vector< AnyMethodArgument >())
std::string qualifiedName() const
edm::ObjectWithDict invoke(const edm::ObjectWithDict &o, std::vector< edm::ObjectWithDict > &v) const
std::vector< edm::TypeWithDict > TypeStack
static double objToDouble(const edm::ObjectWithDict &obj, method::TypeCode type)
edm::MemberWithDict member_
std::vector< AnyMethodArgument > ints_
ObjectWithDict get() const
std::vector< AnyMethodArgument > MethodArgumentStack
static bool isValidReturnType(method::TypeCode)
std::pair< edm::ObjectWithDict, bool > invoke(const edm::ObjectWithDict &o, std::vector< edm::ObjectWithDict > &v) const
method::TypeCode typeCode(const edm::TypeWithDict &)
edm::FunctionWithDict method_
edm::ObjectWithDict storage_
edm::TypeWithDict retTypeFinal_
std::vector< LazyInvoker > LazyMethodStack
MethodInvoker & operator=(const MethodInvoker &)
std::string typeName() const
void invoke(ObjectWithDict const &obj, ObjectWithDict *ret=nullptr, std::vector< void *> const &values=std::vector< void *>()) const
Call a member function.
static void delStorage(edm::ObjectWithDict &)
TypeWithDict & stripConstRef()
std::vector< void * > args_
double invokeLast(const edm::ObjectWithDict &o, std::vector< edm::ObjectWithDict > &v) const
invoke and coerce result to double
std::string returnTypeName() const
std::vector< AnyMethodArgument > argsBeforeFixups_
TypeWithDict toType() const
std::vector< MethodInvoker > invokers_
bool push(const std::string &, const std::vector< AnyMethodArgument > &, const char *, bool deep=true) const
void throwFailedConversion(const edm::ObjectWithDict &) const
LazyInvoker(const std::string &name, const std::vector< AnyMethodArgument > &args)