当前位置: 首页>>代码示例>>C++>>正文


C++ TClass::GetCollectionProxy方法代码示例

本文整理汇总了C++中TClass::GetCollectionProxy方法的典型用法代码示例。如果您正苦于以下问题:C++ TClass::GetCollectionProxy方法的具体用法?C++ TClass::GetCollectionProxy怎么用?C++ TClass::GetCollectionProxy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TClass的用法示例。


在下文中一共展示了TClass::GetCollectionProxy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ensure_dictionary

// Generate dictionaries required to read `tree`.
void ensure_dictionary(const char *class_name) {
    TClass* claim = TClass::GetClass(class_name);
    if (claim && claim->GetCollectionProxy() &&
        dynamic_cast<TEmulatedCollectionProxy*>(claim->GetCollectionProxy())) {
        // Only executed if the dictionary isn't currently present
        init();
        char *orig_dir = get_current_dir_name();
        chdir(dictionary_tmpdir);
        std::cerr << "Generating dictionary for " << class_name << std::endl;
        gInterpreter->GenerateDictionary(class_name);
        chdir(orig_dir);
        free(static_cast<void*>(orig_dir));
    }
}
开发者ID:ndawe,项目名称:drillbit,代码行数:15,代码来源:root_dictionaries.cpp

示例2: classesFromBranch


//.........这里部分代码省略.........
          case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kUChar:
            pointer = true;
          case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kUChar:
          case TVirtualStreamerInfo::kUChar:
            type = "UChar_t";
            break;

          case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kUShort:
            pointer = true;
          case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kUShort:
          case TVirtualStreamerInfo::kUShort:
            type = "UShort_t";
            break;

          case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kUInt:
            pointer = true;
          case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kUInt:
          case TVirtualStreamerInfo::kUInt:
            type = "UInt_t";
            break;

          case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kULong:
            pointer = true;
          case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kULong:
          case TVirtualStreamerInfo::kULong:
            type = "ULong_t";
            break;

          case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kULong64:
            pointer = true;
          case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kULong64:
          case TVirtualStreamerInfo::kULong64:
            type = "ULong64_t";
            break;

          case TVirtualStreamerInfo::kOffsetP + TVirtualStreamerInfo::kBits:
            pointer = true;
          case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kBits:
          case TVirtualStreamerInfo::kBits:
            type = "UInt_t";
            break;

          case TVirtualStreamerInfo::kCharStar:
            type = "Char_t*";
            break;

          case TVirtualStreamerInfo::kCounter:
            type = "Int_t";
            break;

          case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kObjectp:
          case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kObjectP:
          case TVirtualStreamerInfo::kObjectp:
          case TVirtualStreamerInfo::kObjectP:
          case TVirtualStreamerInfo::kAnyp:
          case TVirtualStreamerInfo::kAnyP:
          case TVirtualStreamerInfo::kSTL + TVirtualStreamerInfo::kObjectp:
          case TVirtualStreamerInfo::kSTL + TVirtualStreamerInfo::kObjectP:
            pointer = true;

          case TVirtualStreamerInfo::kOffsetL + TVirtualStreamerInfo::kObject:
          case TVirtualStreamerInfo::kObject:
          case TVirtualStreamerInfo::kTString:
          case TVirtualStreamerInfo::kTNamed:
          case TVirtualStreamerInfo::kTObject:
          case TVirtualStreamerInfo::kAny:
          case TVirtualStreamerInfo::kBase:
          case TVirtualStreamerInfo::kSTL:
            TClass *elementClass = tStreamerElement->GetClassPointer();
            type = elementClass->GetName();

            if (elementClass == TClonesArray::Class()) {
              ROOT::Internal::TTreeGeneratorBase ttreeGenerator(tbranch->GetTree(), "");
              TString className = ttreeGenerator.GetContainedClassName((TBranchElement*)subbranch, tStreamerElement, pointer);
              if (className != nullptr) {
                TClass *otherClass = TClass::GetClass(className);
                classesFromBranch(subbranch, otherClass, classes, variableWithArray.size() + 1, includes);
                includes.insert("#include \"TClonesArray.h\"");
              }
            }

            else if (elementClass->GetCollectionProxy() != nullptr  &&  elementClass->GetCollectionProxy()->GetValueClass() != nullptr) {
              TClass *otherClass = elementClass->GetCollectionProxy()->GetValueClass();
              classesFromBranch(subbranch, otherClass, classes, variableWithArray.size() + 1, includes);
              includes.insert(std::string("#include <") + type.substr(0, type.find('<')) + std::string(">"));
            }

            else
              classesFromBranch(subbranch, elementClass, classes, variableWithArray.size() + 1, includes);

          }
          classStructure.members.push_back(MemberStructure(type, pointer, variable, variableWithArray, comment));
        }
      }

      if (!classStructure.members.empty())
        classes.push_back(classStructure);
    }
  }
}
开发者ID:ASvyatkovskiy,项目名称:rootconverter,代码行数:101,代码来源:streamerToCode.cpp


注:本文中的TClass::GetCollectionProxy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。