6 #include "TClassTable.h"
8 #include "TDictionary.h"
9 #include "TDictAttributeMap.h"
10 #include "TProtoClass.h"
12 #include "TParameter.h"
13 #include "TFunction.h"
14 #include "TClassEdit.h"
18 auto search =
classes.find(classname);
21 return &search->second;
24 DictFuncPtr_t classdict = gClassTable->GetDict(classname);
27 if (!classdict)
return NULL;
29 std::map<const char *, uscript::TField> fields;
31 TClass *tclass = classdict();
34 if (tclass->GetCollectionType() == ROOT::kSTLvector) {
37 tclassinfo.
name = classname;
38 tclassinfo.
size =
sizeof(std::vector<void*>);
40 TClassEdit::TSplitType split(classname);
42 classdict = gClassTable->GetDict(split.fElements[1].c_str());
49 if (classdict == NULL) {
51 if (split.fElements[1] ==
"bool" || split.fElements[1] ==
"Bool_t") {
54 else if (split.fElements[1] ==
"float" || split.fElements[1] ==
"Float_t") {
57 else if (split.fElements[1] ==
"double" || split.fElements[1] ==
"Double_t") {
60 else if (split.fElements[1] ==
"int" || split.fElements[1] ==
"Int_t") {
63 else if (split.fElements[1] ==
"unsigned" || split.fElements[1] ==
"UInt_t") {
76 return &
classes.insert({classname, tclassinfo}).
first->second;
79 TList *members = tclass->GetListOfDataMembers();
80 TIterator *m_iterator = members->MakeIterator();
82 while ((obj = m_iterator->Next()) != NULL) {
83 TDataMember *member = (TDataMember *)obj;
86 this_field.
offset = member->GetOffset();
88 TDataType *basic_type = member->GetDataType();
92 if (member->GetArrayDim() > 0) {
94 for (
unsigned i = 0; i < member->GetArrayDim(); i++) {
95 this_field.
data.
len = this_field.
data.
len * member->GetMaxIndex(i);
100 if (member->IsEnum()) {
103 assert(member->GetUnitSize() == 4);
106 else if (basic_type != NULL) {
108 switch (basic_type->GetType()) {
133 if (field_info != NULL) {
146 tclassinfo.
fields = std::move(fields);
147 tclassinfo.
name = classname;
148 tclassinfo.
size = tclass->GetClassSize();
149 tclassinfo.
is_vec =
false;
150 return &
classes.insert({classname, tclassinfo}).
first->second;
170 uint8_t **vec = (uint8_t**)loc;
171 uint8_t *start = vec[0];
172 uint8_t *
end = vec[1];
173 return (end - start) / Size();
std::unordered_map< const char *, TClassInfo > classes
std::map< const char *, TField > fields
int Length(uint8_t *loc) const
auto end(FixedBins< T, C > const &) noexcept
static const char * Intern(const std::string &str)
TClassInfo * Add(const char *classname)