CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
returnType.cc
Go to the documentation of this file.
2 #include <map>
3 #include <string>
4 using namespace Reflex;
5 using namespace std;
6 using namespace reco::method;
7 
8 namespace reco {
9  Type returnType(const Member & mem) {
10  Type t = mem.TypeOf().ReturnType();
11  if(t) {
12  while(t.IsTypedef()) t = t.ToType();
13  }
14  return t;
15  }
16 
17  TypeCode returnTypeCode(const Member & mem) {
18  return typeCode(returnType(mem));
19  }
20 
21  TypeCode typeCode(const Type & t) {
22  static map<string, method::TypeCode> retTypeMap;
23  if (retTypeMap.size() == 0) {
24  retTypeMap["double"] = doubleType;
25  retTypeMap["float"] = floatType;
26  retTypeMap["int"] = intType;
27  retTypeMap["unsigned int"] = uIntType;
28  retTypeMap["short"] = shortType;
29  retTypeMap["unsigned short"] = uShortType;
30  retTypeMap["long"] = longType;
31  retTypeMap["unsigned long"] = uLongType;
32  retTypeMap["size_t"] = uLongType;
33  retTypeMap["char"] = charType;
34  retTypeMap["unsigned char"] = uCharType;
35  retTypeMap["bool"] = boolType;
36  }
37  map<string, TypeCode>::const_iterator f = retTypeMap.find(t.Name());
38  if (f == retTypeMap.end()) return (t.IsEnum() ? enumType : invalid);
39  else return f->second;
40  }
41 }
Type returnType(const Member &mem)
Definition: returnType.cc:9
double f[11][100]
uint16_t mem[nChs][nEvts]
TypeCode typeCode(const Type &t)
Definition: returnType.cc:21
TypeCode returnTypeCode(const Member &mem)
Definition: returnType.cc:17