CMS 3D CMS Logo

setIsMergeable.cc
Go to the documentation of this file.
1 
3 
8 
9 #include "TClass.h"
10 
11 #include <memory>
12 
13 namespace edm {
14 
16 
17  // Save some time here with the knowledge that the isMergeable
18  // data member can only be true for run or lumi products.
19  // It defaults to false. Also if it is true that means it
20  // was already set.
21  if (desc.branchType() == InRun || desc.branchType() == InLumi) {
22  if (!desc.isMergeable()) {
23  TClass* wrapperBaseTClass = TypeWithDict::byName("edm::WrapperBase").getClass();
24  TClass* tClass = desc.wrappedType().getClass();
25  void* p = tClass->New();
26  int offset = tClass->GetBaseClassOffset(wrapperBaseTClass);
27  std::unique_ptr<WrapperBase> wrapperBase = getAnyPtr<WrapperBase>(p, offset);
28  if (wrapperBase->isMergeable()) {
29  desc.setIsMergeable(true);
30  }
31  }
32  }
33  }
34 }
BranchType const & branchType() const
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:82
TClass * getClass() const
HLT enums.
void setIsMergeable(BranchDescription &)
TypeWithDict const & wrappedType() const