|
|
Go to the documentation of this file.
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.";
ret
prodAgent to be discontinued
std::pair< edm::ObjectWithDict, bool > invoke(const edm::ObjectWithDict &o, std::vector< edm::ObjectWithDict > &v) const
edm::TypeWithDict retTypeFinal_
std::string methodName() const
LazyInvoker(const std::string &name, const std::vector< AnyMethodArgument > &args)
void invoke(ObjectWithDict const &obj, ObjectWithDict *ret=nullptr, std::vector< void * > const &values=std::vector< void * >()) const
Call a member function.
edm::FunctionWithDict method_
edm::ObjectWithDict storage_
bool storageNeedsDestructor_
TypeWithDict & stripConstRef()
MethodInvoker & operator=(const MethodInvoker &)
std::string qualifiedName() const
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_
std::vector< MethodInvoker > invokers_
ObjectWithDict get() const
bool isRefGet_
true if this invoker just pops out a ref and returns (ref.get(), false)
TypeWithDict typeOf() const
std::string typeName() const
std::vector< void * > args_
const SingleInvoker & invoker(const edm::TypeWithDict &) const
TypeCode typeCode(const edm::TypeWithDict &t)
SingleInvoker(const edm::TypeWithDict &, const std::string &name, const std::vector< AnyMethodArgument > &args)
double retToDouble(const edm::ObjectWithDict &) const
convert the output of invoke to a double, if possible
void throwFailedConversion(const edm::ObjectWithDict &) const
edm::ObjectWithDict invoke(const edm::ObjectWithDict &obj, edm::ObjectWithDict &retstore) const
TypeWithDict toType() const
std::vector< edm::TypeWithDict > TypeStack
MethodInvoker(const edm::FunctionWithDict &method, const std::vector< AnyMethodArgument > &ints=std::vector< AnyMethodArgument >())
edm::ObjectWithDict invoke(const edm::ObjectWithDict &o, std::vector< edm::ObjectWithDict > &v) const
std::vector< AnyMethodArgument > ints_
static double objToDouble(const edm::ObjectWithDict &obj, method::TypeCode type)
static void delStorage(edm::ObjectWithDict &)
method::TypeCode retType_
static bool makeStorage(edm::ObjectWithDict &obj, const edm::TypeWithDict &retType)
std::vector< LazyInvoker > LazyMethodStack
edm::MemberWithDict member_
bool push(const std::string &, const std::vector< AnyMethodArgument > &, const char *, bool deep=true) const
std::vector< AnyMethodArgument > MethodArgumentStack
static bool isValidReturnType(method::TypeCode)
TypeWithDict finalReturnType() const