4 #include "Reflex/Base.h"
5 #include "Reflex/TypeTemplate.h"
7 using namespace ROOT::Reflex;
25 const std::vector<AnyMethodArgument> &
args, std::vector<AnyMethodArgument> &fixuppedArgs) {
34 if (mem.DeclaringType().Id() != type.Id()) {
40 size_t minArgs = mem.FunctionParameterSize(
true), maxArgs = mem.FunctionParameterSize(
false);
46 Type t = mem.TypeOf();
47 std::vector<AnyMethodArgument> tmpFixups;
48 for (
size_t i = 0;
i < args.size(); ++
i) {
51 if (fixup.second >= 0) {
52 tmpFixups.push_back(fixup.first);
53 casts += fixup.second;
58 fixuppedArgs.swap(tmpFixups);
68 const std::vector<AnyMethodArgument> &
args,
69 std::vector<AnyMethodArgument> &fixuppedArgs,
70 const char* iIterator,
76 <<
"No dictionary for class \"" << type.Name() <<
"\".";
77 while(type.IsPointer() || type.IsTypedef()) type = type.ToType();
80 pair<Member, bool>
mem; mem.second =
false;
83 vector<pair<int,Member> > oks;
86 for(Member_Iterator
m = type.FunctionMember_Begin();
m != type.FunctionMember_End(); ++
m ) {
90 oks.push_back( make_pair(casts,*
m) );
103 if (oks.size() > 1) {
105 sort(oks.begin(), oks.end());
109 <<
"Can't resolve method \"" << name <<
"\" for class \"" << type.Name() <<
"\", the two candidates "
110 << oks[0].second.Name() <<
" and " << oks[1].second.Name()
111 <<
" require the same number of integer->real conversions (" << oks[0].first <<
").";
115 fixuppedArgs.clear();
118 mem.first = oks.front().second;
124 for(Base_Iterator
b = type.Base_Begin();
b != type.Base_End(); ++
b) {
125 if((mem =
findMethod(
b->ToType(),
name,
args, fixuppedArgs,iIterator,baseError)).first)
break;
137 if(type.IsTemplateInstance()) {
138 TypeTemplate templ = type.TemplateFamily();
139 std::string name = templ.Name();
140 if(name.compare(
"Ref") == 0 ||
141 name.compare(
"RefToBase") == 0 ||
142 name.compare(
"Ptr") == 0) {
144 std::vector<AnyMethodArgument>
empty, empty2;
146 mem =
findMethod(type,
"get", empty, empty2,iIterator,error);
149 <<
"No member \"get\" in reference of type \"" << type.Name() <<
"\".";
int checkMethod(const ROOT::Reflex::Member &mem, const ROOT::Reflex::Type &type, const std::vector< AnyMethodArgument > &args, std::vector< AnyMethodArgument > &fixuppedArgs)
static bool fatalErrorCondition(int iError)
uint16_t mem[nChs][nEvts]
boost::mpl::if_< matches_another_integral_type< unsigned long >, boost::variant< int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, double, float, std::string >, boost::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
pair< Member, bool > findMethod(const Type &t, const string &name, const std::vector< AnyMethodArgument > &args, std::vector< AnyMethodArgument > &fixuppedArgs, const char *iIterator, int &oError)