Jpp  master_rocky-43-ge265d140c
the software that should make you happy
Static Public Member Functions | List of all members
JROOT::JRootPrimitiveTypes Struct Reference

#include <JRootPrimitiveTypes.hh>

Static Public Member Functions

static std::string getTypeCode (const std::string &type_name)
 Return the type code (used to create primitive leaves in basic Root tree branches) corresponding to the type name. More...
 

Detailed Description

Definition at line 13 of file JRootPrimitiveTypes.hh.

Member Function Documentation

◆ getTypeCode()

static std::string JROOT::JRootPrimitiveTypes::getTypeCode ( const std::string &  type_name)
inlinestatic

Return the type code (used to create primitive leaves in basic Root tree branches) corresponding to the type name.

If the type_name does not correspond to a primitive type (known to Root), then an empty string is returned.

Definition at line 21 of file JRootPrimitiveTypes.hh.

22  {
24  {"char[]", "C"},
25  {"char", "B"},
26  {"unsigned char", "b"},
27  {"short", "S"},
28  {"unsigned short", "s"},
29  {"unsigned int", "i"},
30  {"int", "I"},
31  {"float", "F"},
32  {"Float16_t", "f"},
33  {"double", "D"},
34  {"Double32_t", "d"},
35  {"Long64_t", "L"},
36  {"ULong64_t", "l"},
37  {"long", "G"},
38  {"unsigned long", "g"},
39  {"bool", "O"}};
40  std::string type_code;
41  for (const auto& type2code : type_codes) {
42  if (type2code.first == type_name) {
43  type_code = type2code.second;
44  }
45  }
46  return type_code;
47  }

The documentation for this struct was generated from the following file: