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  // 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  // Set it only for branches that are present
21  if (desc.present() and (desc.branchType() == InRun or 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 } // namespace edm
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
TClass * getClass() const
HLT enums.
void setIsMergeable(BranchDescription &)