26 const std::vector<AnyMethodArgument>&
args,
27 std::vector<AnyMethodArgument>& fixuppedArgs) {
48 if (mem.
name().substr(0, 2) ==
"__") {
66 if ((args.size() < minArgs) || (args.size() > maxArgs)) {
82 std::vector<AnyMethodArgument> tmpFixups;
84 for (
auto const& param : mem) {
95 if (fixup.second >= 0) {
96 tmpFixups.push_back(fixup.first);
97 casts += fixup.second;
101 if (++i == args.size()) {
105 fixuppedArgs.swap(tmpFixups);
126 typedef std::pair<int, edm::FunctionWithDict>
OK;
132 const std::vector<AnyMethodArgument>&
args,
133 std::vector<AnyMethodArgument>& fixuppedArgs,
134 const char* iIterator,
147 if (theType == type) {
155 std::pair<edm::FunctionWithDict, bool>
mem;
159 std::vector<std::pair<int, edm::FunctionWithDict> > oks;
161 for (
auto const&
item : args) {
162 if (!theArgs.empty()) {
165 theArgs +=
edm::TypeID(std::visit([](
auto& variant) ->
const std::type_info& {
return typeid(variant); },
item))
170 int casts =
checkMethod(f, type, args, fixuppedArgs);
172 oks.push_back(std::make_pair(casts, f));
182 for (
auto const&
F : functions) {
187 int casts =
checkMethod(f, type, args, fixuppedArgs);
189 oks.push_back(std::make_pair(casts, f));
203 if (oks.size() > 1) {
205 sort(oks.begin(), oks.end(),
nCasts);
208 <<
"Can't resolve method \"" << name <<
"\" for class \"" << type.
name() <<
"\", the two candidates "
209 << oks[0].second.name() <<
" and " << oks[1].second.name()
210 <<
" require the same number of integer->real conversions (" << oks[0].first <<
").";
214 fixuppedArgs.clear();
217 mem.first = oks.front().second;
223 if (!
bool(mem.first)) {
225 for (
auto const&
B : bases) {
227 if (
bool(mem.first)) {
237 if (!
bool(mem.first)) {
241 if (!name.compare(
"edm::Ref") || !name.compare(
"edm::RefToBase") || !name.compare(
"edm::Ptr")) {
243 std::vector<AnyMethodArgument>
empty;
244 std::vector<AnyMethodArgument> empty2;
246 mem =
findMethod(type,
"get", empty, empty2, iIterator, error);
247 if (!
bool(mem.first)) {
248 throw parser::Exception(iIterator) <<
"No member \"get\" in reference of type \"" << type.
name() <<
"\".";
258 if (
bool(mem.first)) {
TypeWithDict finalType() const
bool isConstructor() const
reco::parser::AnyMethodArgument AnyMethodArgument
TypeWithDict toType() const
std::string templateName() const
bool isTemplateInstance() const
static bool fatalErrorCondition(const int err)
std::pair< edm::FunctionWithDict, bool > findMethod(const edm::TypeWithDict &t, const std::string &name, const std::vector< AnyMethodArgument > &args, std::vector< AnyMethodArgument > &fixuppedArgs, const char *iIterator, int &oError)
uint16_t mem[nChs][nEvts]
static const std::string B
FunctionWithDict functionMemberByName(std::string const &) const
std::pair< int, edm::FunctionWithDict > OK
int checkMethod(const edm::FunctionWithDict &mem, const edm::TypeWithDict &type, const std::vector< AnyMethodArgument > &args, std::vector< AnyMethodArgument > &fixuppedArgs)
TypeWithDict & stripConstRef()
std::conditional< matches_another_integral_type< unsigned long >::value, std::variant< int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, double, float, std::string >, std::variant< int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, unsigned long, double, float, std::string > >::type AnyMethodArgument
size_t functionParameterSize(bool required=false) const
std::string const & className() const
bool isDestructor() const
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
bool nCasts(const OK &a, const OK &b)