CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  // Save some time here with the knowledge that the isMergeable
17  // data member can only be true for run or lumi products.
18  // It defaults to false. Also if it is true that means it
19  // was already set.
20  if (desc.branchType() == InRun || desc.branchType() == InLumi) {
21  if (!desc.isMergeable()) {
22  TClass* wrapperBaseTClass = TypeWithDict::byName("edm::WrapperBase").getClass();
23  TClass* tClass = desc.wrappedType().getClass();
24  void* p = tClass->New();
25  int offset = tClass->GetBaseClassOffset(wrapperBaseTClass);
26  std::unique_ptr<WrapperBase> wrapperBase = getAnyPtr<WrapperBase>(p, offset);
27  if (wrapperBase->isMergeable()) {
28  desc.setIsMergeable(true);
29  }
30  }
31  }
32  }
33 } // namespace edm
BranchType const & branchType() const
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
TClass * getClass() const
void setIsMergeable(BranchDescription &)
TypeWithDict const & wrappedType() const