17 ProducerBase::~ProducerBase() noexcept(
false) {}
19 std::function<void(BranchDescription const&)> ProducerBase::registrationCallback()
const {
20 return callWhenNewProductsRegistered_;
24 class CallbackWrapper {
30 : prod_(iProd), callback_(iCallback), reg_(iReg), mdesc_(iDesc), lastSize_(iProd->typeLabelList().
size()) {}
32 void operator()(BranchDescription
const& iDesc) {
37 void addToRegistry() {
38 ProducerBase::TypeLabelList
const& plist = prod_->typeLabelList();
40 if (lastSize_ != plist.size()) {
41 ProducerBase::TypeLabelList::const_iterator pStart = plist.begin();
42 advance(pStart, lastSize_);
43 ProductRegistryHelper::addToRegistry(pStart, plist.end(), mdesc_, *reg_, prod_);
44 lastSize_ = plist.size();
49 ProductRegistryHelper* prod_;
50 std::function<void(BranchDescription const&)> callback_;
51 ProductRegistry* reg_;
52 ModuleDescription mdesc_;
53 unsigned int lastSize_;
58 if (typeLabelList().
empty() && !registrationCallback()) {
65 bool isListener =
false;
66 if (registrationCallback()) {
72 ProductRegistryHelper::addToRegistry(plist.begin(), plist.end(), md, *(iReg),
this, isListener);
73 if (registrationCallback()) {
75 regService->watchProductAdditions(CallbackWrapper(
producer, registrationCallback(), iReg, md));
79 void ProducerBase::resolvePutIndicies(
BranchType iBranchType,
82 auto const& plist = typeLabelList();
83 if (putTokenToResolverIndex_.size() != plist.size()) {
87 putIndicies_[iBranchType].reserve(iIndicies.count(
moduleLabel));
89 putIndicies_[iBranchType].push_back(std::get<2>(
it->second));
91 for (
auto const& tl : plist) {
92 if (
convertToBranchType(tl.transition_) == iBranchType and (tl.typeID_ == *std::get<0>(
it->second)) and
93 (tl.productInstanceName_ == std::get<1>(
it->second))) {
94 putTokenToResolverIndex_[
i] = std::get<2>(
it->second);
ProductRegistryHelper::TypeLabelList TypeLabelList
void callForEachBranch(T const &iFunc)
std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > > ModuleToResolverIndicies
constexpr BranchType convertToBranchType(Transition iValue)