From a52b578a271e7c0d907879d04e0acc5922ea8aef Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 30 Jan 2025 12:50:06 -0600 Subject: [PATCH] Sources now have independent ProductRegistry Sources can now update their ProductRegistry without affecting the rest of the system. The system will pick up the changes when they are needed. --- FWCore/Framework/interface/InputSource.h | 21 ++++++++----------- .../interface/InputSourceDescription.h | 11 +--------- .../interface/maker/InputSourceFactory.h | 4 +--- FWCore/Framework/src/EventProcessor.cc | 19 +++++++---------- FWCore/Framework/src/InputSource.cc | 7 +++---- FWCore/Framework/src/InputSourceFactory.cc | 3 +-- .../plugins/PutOrMergeTestSource.cc | 4 ++-- FWCore/Integration/plugins/ThrowingSource.cc | 4 ++-- .../Sources/interface/IDGeneratorSourceBase.h | 2 +- FWCore/Sources/interface/PuttableSourceBase.h | 4 ++-- FWCore/Sources/src/IDGeneratorSourceBase.cc | 4 ++-- FWCore/Sources/src/PuttableSourceBase.cc | 16 +++++++------- .../TestProcessor/src/TestSourceProcessor.cc | 18 +++++++--------- IOPool/Input/src/RepeatingCachedRootSource.cc | 10 ++++++--- IOPool/Streamer/src/StreamerInputSource.cc | 2 +- 15 files changed, 56 insertions(+), 73 deletions(-) diff --git a/FWCore/Framework/interface/InputSource.h b/FWCore/Framework/interface/InputSource.h index 3c07780edd0a5..466e335828f3b 100644 --- a/FWCore/Framework/interface/InputSource.h +++ b/FWCore/Framework/interface/InputSource.h @@ -20,6 +20,7 @@ Some examples of InputSource subclasses are: #include "DataFormats/Provenance/interface/RunAuxiliary.h" #include "DataFormats/Provenance/interface/RunID.h" #include "DataFormats/Provenance/interface/Timestamp.h" +#include "DataFormats/Provenance/interface/ProductRegistry.h" #include "FWCore/Common/interface/FWCoreCommonFwd.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/ProcessingController.h" @@ -43,7 +44,6 @@ namespace edm { class ParameterSetDescription; class ProcessContext; class ProcessHistoryRegistry; - class ProductRegistry; class SignallingProductRegistry; class StreamContext; class ModuleCallingContext; @@ -159,11 +159,11 @@ namespace edm { /// issue an event report void issueReports(EventID const& eventID, StreamID streamID); - /// Register any produced products - virtual void registerProducts(SignallingProductRegistry&); + /// Register any produced products into source's registry + virtual void registerProducts(); /// Accessors for product registry - std::shared_ptr productRegistry() const { return get_underlying_safe(productRegistry_); } + ProductRegistry const& productRegistry() const { return productRegistry_; } /// Accessors for process history registry. ProcessHistoryRegistry const& processHistoryRegistry() const { return *processHistoryRegistry_; } @@ -198,9 +198,6 @@ namespace edm { /// Returns nullptr if no resource shared between the Source and a DelayedReader std::pair resourceSharedWithDelayedReader(); - /// switch to a different ProductRegistry. - void switchTo(std::shared_ptr iOther) { productRegistry_ = iOther; } - /// Accessor for maximum number of events to be read. /// -1 is used for unlimited. int maxEvents() const { return maxEvents_; } @@ -226,8 +223,8 @@ namespace edm { /// Accessor for global process identifier std::string const& processGUID() const { return processGUID_; } - /// Called by framework at beginning of job - void doBeginJob(); + /// Called by framework at beginning of job. The argument is the full product registry + void doBeginJob(edm::ProductRegistry const&); /// Called by framework at end of job void doEndJob(); @@ -357,7 +354,7 @@ namespace edm { /// To set the current time, as seen by the input source void setTimestamp(Timestamp const& theTime) { time_ = theTime; } - ProductRegistry& productRegistryUpdate() { return *productRegistry_; } + ProductRegistry& productRegistryUpdate() { return productRegistry_; } ProcessHistoryRegistry& processHistoryRegistryForUpdate() { return *processHistoryRegistry_; } ItemTypeInfo state() const { return state_; } void setRunAuxiliary(RunAuxiliary* rp) { @@ -397,7 +394,7 @@ namespace edm { void decreaseRemainingEventsBy(int iSkipped); ///Begin protected makes it easier to do template programming - virtual void beginJob(); + virtual void beginJob(edm::ProductRegistry const&); private: bool eventLimitReached() const { return remainingEvents_ == 0; } @@ -451,7 +448,7 @@ namespace edm { std::chrono::time_point processingStart_; ProcessingMode processingMode_; ModuleDescription const moduleDescription_; - edm::propagate_const> productRegistry_; + ProductRegistry productRegistry_; edm::propagate_const> processHistoryRegistry_; edm::propagate_const> branchIDListHelper_; edm::propagate_const> processBlockHelper_; diff --git a/FWCore/Framework/interface/InputSourceDescription.h b/FWCore/Framework/interface/InputSourceDescription.h index f865fdc8cb65c..2a0c0933429bb 100644 --- a/FWCore/Framework/interface/InputSourceDescription.h +++ b/FWCore/Framework/interface/InputSourceDescription.h @@ -19,16 +19,9 @@ namespace edm { class ThinnedAssociationsHelper; struct InputSourceDescription { - InputSourceDescription() - : moduleDescription_(), - productRegistry_(nullptr), - actReg_(), - maxEvents_(-1), - maxLumis_(-1), - allocations_(nullptr) {} + InputSourceDescription() : moduleDescription_(), actReg_(), maxEvents_(-1), maxLumis_(-1), allocations_(nullptr) {} InputSourceDescription(ModuleDescription const& md, - std::shared_ptr preg, std::shared_ptr branchIDListHelper, std::shared_ptr const& processBlockHelper, std::shared_ptr thinnedAssociationsHelper, @@ -38,7 +31,6 @@ namespace edm { int maxSecondsUntilRampdown, PreallocationConfiguration const& allocations) : moduleDescription_(md), - productRegistry_(preg), branchIDListHelper_(branchIDListHelper), processBlockHelper_(processBlockHelper), thinnedAssociationsHelper_(thinnedAssociationsHelper), @@ -49,7 +41,6 @@ namespace edm { allocations_(&allocations) {} ModuleDescription moduleDescription_; - std::shared_ptr productRegistry_; std::shared_ptr branchIDListHelper_; std::shared_ptr processBlockHelper_; std::shared_ptr thinnedAssociationsHelper_; diff --git a/FWCore/Framework/interface/maker/InputSourceFactory.h b/FWCore/Framework/interface/maker/InputSourceFactory.h index 54c41b6f0500b..bb87e2135527e 100644 --- a/FWCore/Framework/interface/maker/InputSourceFactory.h +++ b/FWCore/Framework/interface/maker/InputSourceFactory.h @@ -21,9 +21,7 @@ namespace edm { static InputSourceFactory const* get(); - std::unique_ptr makeInputSource(ParameterSet const&, - SignallingProductRegistry&, - InputSourceDescription const&) const; + std::unique_ptr makeInputSource(ParameterSet const&, InputSourceDescription const&) const; private: InputSourceFactory(); diff --git a/FWCore/Framework/src/EventProcessor.cc b/FWCore/Framework/src/EventProcessor.cc index 337040f6a2b5a..91088a390c430 100644 --- a/FWCore/Framework/src/EventProcessor.cc +++ b/FWCore/Framework/src/EventProcessor.cc @@ -121,7 +121,6 @@ namespace edm { std::unique_ptr makeInput(unsigned int moduleIndex, ParameterSet& params, CommonParams const& common, - std::shared_ptr preg, std::shared_ptr branchIDListHelper, std::shared_ptr const& processBlockHelper, std::shared_ptr thinnedAssociationsHelper, @@ -166,7 +165,6 @@ namespace edm { moduleIndex); InputSourceDescription isdesc(md, - preg, branchIDListHelper, processBlockHelper, thinnedAssociationsHelper, @@ -182,8 +180,7 @@ namespace edm { //even if we have an exception, send the signal std::shared_ptr sentry(nullptr, [areg, &md](void*) { areg->postSourceConstructionSignal_(md); }); convertException::wrap([&]() { - input = std::unique_ptr( - InputSourceFactory::get()->makeInputSource(*main_input, *preg, isdesc).release()); + input = InputSourceFactory::get()->makeInputSource(*main_input, isdesc); input->preEventReadFromSourceSignal_.connect(std::cref(areg->preEventReadFromSourceSignal_)); input->postEventReadFromSourceSignal_.connect(std::cref(areg->postEventReadFromSourceSignal_)); }); @@ -489,7 +486,6 @@ namespace edm { tbb::task_group group; // initialize the input source - auto tempReg = std::make_shared(); auto sourceID = ModuleDescription::getUniqueID(); group.run([&, this]() { @@ -500,12 +496,11 @@ namespace edm { items.initModules(*parameterSet, tns, preallocations_, &processContext_, moduleTypeResolverMaker_.get()); }); - group.run([&, this, tempReg]() { + group.run([&, this]() { ServiceRegistry::Operate operate(serviceToken_); input_ = makeInput(sourceID, *parameterSet, *common, - /*items.preg(),*/ tempReg, items.branchIDListHelper(), get_underlying_safe(processBlockHelper_), items.thinnedAssociationsHelper(), @@ -515,9 +510,7 @@ namespace edm { }); group.wait(); - items.preg()->addFromInput(*tempReg); - input_->switchTo(items.preg()); - + items.preg()->addFromInput(input_->productRegistry()); { auto const& tns = ServiceRegistry::instance().get(); schedule_ = items.finishSchedule(std::move(*madeModules), @@ -726,7 +719,7 @@ namespace edm { espController_->finishConfiguration(); actReg_->eventSetupConfigurationSignal_(esp_->recordsToResolverIndices(), processContext_); try { - convertException::wrap([&]() { input_->doBeginJob(); }); + convertException::wrap([&]() { input_->doBeginJob(*preg_); }); } catch (cms::Exception& ex) { ex.addContext("Calling beginJob for the source"); throw; @@ -1014,7 +1007,6 @@ namespace edm { void EventProcessor::readFile() { FDEBUG(1) << " \treadFile\n"; - size_t size = preg_->size(); SendSourceTerminationSignalIfException sentry(actReg_.get()); if (streamRunActive_ > 0) { @@ -1027,6 +1019,9 @@ namespace edm { } fb_ = input_->readFile(); + //incase the input's registry changed + const size_t size = preg_->size(); + preg_->merge(input_->productRegistry(), fb_ ? fb_->fileName() : std::string()); if (size < preg_->size()) { principalCache_.adjustIndexesAfterProductRegistryAddition(); } diff --git a/FWCore/Framework/src/InputSource.cc b/FWCore/Framework/src/InputSource.cc index 6c7d5da97a6ab..11c22dd2b8647 100644 --- a/FWCore/Framework/src/InputSource.cc +++ b/FWCore/Framework/src/InputSource.cc @@ -54,7 +54,6 @@ namespace edm { maxSecondsUntilRampdown_(desc.maxSecondsUntilRampdown_), processingMode_(RunsLumisAndEvents), moduleDescription_(desc.moduleDescription_), - productRegistry_(desc.productRegistry_), processHistoryRegistry_(new ProcessHistoryRegistry), branchIDListHelper_(desc.branchIDListHelper_), processBlockHelper_(desc.processBlockHelper_), @@ -205,7 +204,7 @@ namespace edm { "Calling InputSource::readRunAuxiliary_"); } - void InputSource::doBeginJob() { this->beginJob(); } + void InputSource::doBeginJob(edm::ProductRegistry const& iReg) { this->beginJob(iReg); } void InputSource::doEndJob() { endJob(); } @@ -217,7 +216,7 @@ namespace edm { return std::pair(nullptr, nullptr); } - void InputSource::registerProducts(SignallingProductRegistry&) {} + void InputSource::registerProducts() {} // Return a dummy file block. std::shared_ptr InputSource::readFile() { @@ -436,7 +435,7 @@ namespace edm { "Calling InputSource::reverseState__"); } - void InputSource::beginJob() {} + void InputSource::beginJob(ProductRegistry const&) {} void InputSource::endJob() {} diff --git a/FWCore/Framework/src/InputSourceFactory.cc b/FWCore/Framework/src/InputSourceFactory.cc index e107ca90283f9..5628035036fd1 100644 --- a/FWCore/Framework/src/InputSourceFactory.cc +++ b/FWCore/Framework/src/InputSourceFactory.cc @@ -24,7 +24,6 @@ namespace edm { } std::unique_ptr InputSourceFactory::makeInputSource(ParameterSet const& conf, - SignallingProductRegistry& reg, InputSourceDescription const& desc) const { @@ -40,7 +39,7 @@ namespace edm { << "Try running EdmPluginDump to obtain a list of available Plugins."; } - wm->registerProducts(reg); + wm->registerProducts(); FDEBUG(1) << "InputSourceFactory: created input source " << modtype << std::endl; diff --git a/FWCore/Integration/plugins/PutOrMergeTestSource.cc b/FWCore/Integration/plugins/PutOrMergeTestSource.cc index 4182db949c83d..f7ec773ca29f6 100644 --- a/FWCore/Integration/plugins/PutOrMergeTestSource.cc +++ b/FWCore/Integration/plugins/PutOrMergeTestSource.cc @@ -27,7 +27,7 @@ namespace edmtest { PutOrMergeTestSource(ParameterSet const&, InputSourceDescription const&); /// Register any produced products - void registerProducts(SignallingProductRegistry&) final; + void registerProducts() final; private: ItemTypeInfo getNextItemType() final; @@ -86,7 +86,7 @@ PutOrMergeTestSource::PutOrMergeTestSource(ParameterSet const& iPS, InputSourceD historyID_ = history.id(); } -void PutOrMergeTestSource::registerProducts(SignallingProductRegistry&) { +void PutOrMergeTestSource::registerProducts() { edm::ParameterSet dummyPset; dummyPset.registerIt(); diff --git a/FWCore/Integration/plugins/ThrowingSource.cc b/FWCore/Integration/plugins/ThrowingSource.cc index 007043495afbd..05c4b82bebd84 100644 --- a/FWCore/Integration/plugins/ThrowingSource.cc +++ b/FWCore/Integration/plugins/ThrowingSource.cc @@ -12,7 +12,7 @@ namespace edm { explicit ThrowingSource(ParameterSet const&, InputSourceDescription const&); ~ThrowingSource() noexcept(false) override; - void beginJob() override; + void beginJob(ProductRegistry const&) override; void endJob() override; void beginLuminosityBlock(edm::LuminosityBlock&) override; void beginRun(edm::Run&) override; @@ -63,7 +63,7 @@ namespace edm { void ThrowingSource::produce(edm::Event&) {} - void ThrowingSource::beginJob() { + void ThrowingSource::beginJob(edm::ProductRegistry const&) { if (whenToThrow_ == kBeginJob) throw cms::Exception("TestThrow") << "ThrowingSource::beginJob"; } diff --git a/FWCore/Sources/interface/IDGeneratorSourceBase.h b/FWCore/Sources/interface/IDGeneratorSourceBase.h index 947327b8efa1b..3d8fdf7c9f090 100644 --- a/FWCore/Sources/interface/IDGeneratorSourceBase.h +++ b/FWCore/Sources/interface/IDGeneratorSourceBase.h @@ -71,7 +71,7 @@ namespace edm { virtual bool setRunAndEventInfo(EventID& id, TimeValue_t& time, EventAuxiliary::ExperimentType& etype) = 0; virtual bool noFiles() const; virtual size_t fileIndex() const; - void beginJob() override; + void beginJob(ProductRegistry const&) override; std::shared_ptr readLuminosityBlockAuxiliary_() override; std::shared_ptr readRunAuxiliary_() override; diff --git a/FWCore/Sources/interface/PuttableSourceBase.h b/FWCore/Sources/interface/PuttableSourceBase.h index f4f184e0957b7..def0c839a0f9a 100644 --- a/FWCore/Sources/interface/PuttableSourceBase.h +++ b/FWCore/Sources/interface/PuttableSourceBase.h @@ -40,7 +40,7 @@ namespace edm { // ---------- member functions --------------------------- using ProducerBase::registerProducts; using ProducerBase::resolvePutIndicies; - void registerProducts(SignallingProductRegistry&) final; + void registerProducts() final; bool hasAbilityToProduceInBeginRuns() const final { return true; } @@ -48,7 +48,7 @@ namespace edm { protected: //If inheriting class overrides, they need to call this function as well - void beginJob() override; + void beginJob(edm::ProductRegistry const&) override; private: void doBeginLumi(LuminosityBlockPrincipal& lbp, ProcessContext const*) override; diff --git a/FWCore/Sources/src/IDGeneratorSourceBase.cc b/FWCore/Sources/src/IDGeneratorSourceBase.cc index 76a2c659360cf..5ed0ef6be231b 100644 --- a/FWCore/Sources/src/IDGeneratorSourceBase.cc +++ b/FWCore/Sources/src/IDGeneratorSourceBase.cc @@ -113,8 +113,8 @@ namespace edm { } template - void IDGeneratorSourceBase::beginJob() { - BASE::beginJob(); + void IDGeneratorSourceBase::beginJob(ProductRegistry const& iReg) { + BASE::beginJob(iReg); // Initialize cannot be called from the constructor, because it is a virtual function // that needs to be invoked from a derived class if the derived class overrides it. initialize(eventID_, presentTime_, timeBetweenEvents_); diff --git a/FWCore/Sources/src/PuttableSourceBase.cc b/FWCore/Sources/src/PuttableSourceBase.cc index 1918ffe0cb56a..64e829e7e8dd8 100644 --- a/FWCore/Sources/src/PuttableSourceBase.cc +++ b/FWCore/Sources/src/PuttableSourceBase.cc @@ -22,6 +22,7 @@ #include "FWCore/Framework/interface/Run.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/ExceptionHelpers.h" +#include "FWCore/Framework/interface/SignallingProductRegistry.h" using namespace edm; // @@ -38,15 +39,16 @@ using namespace edm; PuttableSourceBase::PuttableSourceBase(ParameterSet const& iPSet, InputSourceDescription const& iISD) : InputSource(iPSet, iISD) {} -void PuttableSourceBase::registerProducts(SignallingProductRegistry& iReg) { - registerProducts(this, &iReg, moduleDescription()); +void PuttableSourceBase::registerProducts() { + SignallingProductRegistry reg; + registerProducts(this, ®, moduleDescription()); + productRegistryUpdate().addFromInput(reg); } -void PuttableSourceBase::beginJob() { - auto r = productRegistry(); - auto const runLookup = r->productLookup(InRun); - auto const lumiLookup = r->productLookup(InLumi); - auto const eventLookup = r->productLookup(InEvent); +void PuttableSourceBase::beginJob(edm::ProductRegistry const& r) { + auto const runLookup = r.productLookup(InRun); + auto const lumiLookup = r.productLookup(InLumi); + auto const eventLookup = r.productLookup(InEvent); auto const& processName = moduleDescription().processName(); auto const& moduleLabel = moduleDescription().moduleLabel(); diff --git a/FWCore/TestProcessor/src/TestSourceProcessor.cc b/FWCore/TestProcessor/src/TestSourceProcessor.cc index ffa9900f8e7ce..0294e76ec7495 100644 --- a/FWCore/TestProcessor/src/TestSourceProcessor.cc +++ b/FWCore/TestProcessor/src/TestSourceProcessor.cc @@ -6,6 +6,7 @@ #include "FWCore/Framework/interface/ProcessBlockPrincipal.h" #include "FWCore/Framework/interface/RunPrincipal.h" #include "FWCore/Framework/interface/DelayedReader.h" +#include "FWCore/Framework/interface/FileBlock.h" #include "FWCore/Framework/interface/InputSourceDescription.h" #include "FWCore/Framework/interface/maker/InputSourceFactory.h" #include "FWCore/Framework/interface/ProductResolversFactory.h" @@ -58,7 +59,6 @@ namespace { // --------------------------------------------------------------- std::unique_ptr makeInput(unsigned int moduleIndex, ParameterSet& params, - std::shared_ptr preg, std::shared_ptr branchIDListHelper, std::shared_ptr const& processBlockHelper, std::shared_ptr thinnedAssociationsHelper, @@ -96,10 +96,9 @@ namespace { moduleIndex); InputSourceDescription isdesc( - md, preg, branchIDListHelper, processBlockHelper, thinnedAssociationsHelper, areg, -1, -1, 0, allocations); + md, branchIDListHelper, processBlockHelper, thinnedAssociationsHelper, areg, -1, -1, 0, allocations); - return std::unique_ptr( - InputSourceFactory::get()->makeInputSource(*main_input, *preg, isdesc).release()); + return std::unique_ptr(InputSourceFactory::get()->makeInputSource(*main_input, isdesc).release()); } } // namespace @@ -143,21 +142,18 @@ namespace edm::test { { // initialize the input source - auto tempReg = std::make_shared(); auto sourceID = ModuleDescription::getUniqueID(); ServiceRegistry::Operate operate(serviceToken_); source_ = makeInput(sourceID, *psetPtr, - /*items.preg(),*/ tempReg, items.branchIDListHelper(), processBlockHelper_, items.thinnedAssociationsHelper(), items.actReg_, items.processConfiguration(), preallocations_); - items.preg()->addFromInput(*tempReg); - source_->switchTo(items.preg()); + items.preg()->addFromInput(source_->productRegistry()); } actReg_ = items.actReg_; @@ -203,7 +199,7 @@ namespace edm::test { principalCache_.insert(std::move(pb)); } - source_->doBeginJob(); + source_->doBeginJob(*preg_); } TestSourceProcessor::~TestSourceProcessor() { @@ -228,8 +224,10 @@ namespace edm::test { //make the services available ServiceRegistry::Operate operate(serviceToken_); - size_t size = preg_->size(); fb_ = source_->readFile(); + //incase the input's registry changed + const size_t size = preg_->size(); + preg_->merge(source_->productRegistry(), fb_ ? fb_->fileName() : std::string()); if (size < preg_->size()) { principalCache_.adjustIndexesAfterProductRegistryAddition(); } diff --git a/IOPool/Input/src/RepeatingCachedRootSource.cc b/IOPool/Input/src/RepeatingCachedRootSource.cc index 25d38d415ac1d..d3157a25039d3 100644 --- a/IOPool/Input/src/RepeatingCachedRootSource.cc +++ b/IOPool/Input/src/RepeatingCachedRootSource.cc @@ -36,6 +36,7 @@ #include "FWCore/Catalog/interface/InputFileCatalog.h" #include "FWCore/Utilities/interface/propagate_const.h" #include "FWCore/Utilities/interface/Exception.h" +#include "FWCore/Utilities/interface/do_nothing_deleter.h" #include "FWCore/Sources/interface/EventSkipperByID.h" #include "FWCore/Framework/interface/InputSourceMacros.h" @@ -125,7 +126,7 @@ namespace edm { bool readIt(EventID const& id, EventPrincipal& eventPrincipal, StreamContext& streamContext) override; void skip(int offset) override; bool goToEvent_(EventID const& eventID) override; - void beginJob() override; + void beginJob(ProductRegistry const&) override; void fillProcessBlockHelper_() override; bool nextProcessBlock_(ProcessBlockPrincipal&) override; @@ -228,13 +229,16 @@ RepeatingCachedRootSource::RepeatingCachedRootSource(ParameterSet const& pset, I } } -void RepeatingCachedRootSource::beginJob() { +void RepeatingCachedRootSource::beginJob(ProductRegistry const&) { ProcessConfiguration processConfiguration; processConfiguration.setParameterSetID(ParameterSet::emptyParameterSetID()); processConfiguration.setProcessConfigurationID(); + //in order to use the source's internal ProductRegistry for looking up date + // it needs to be frozen (which setups the other structures) + productRegistryUpdate().setFrozen(); //Thinned collection associations are not supported at this time - EventPrincipal eventPrincipal(productRegistry(), + EventPrincipal eventPrincipal(std::shared_ptr(&productRegistry(), do_nothing_deleter()), edm::productResolversFactory::makePrimary, branchIDListHelper(), std::make_shared(), diff --git a/IOPool/Streamer/src/StreamerInputSource.cc b/IOPool/Streamer/src/StreamerInputSource.cc index 0382a3ae513c2..99d1551671e4d 100644 --- a/IOPool/Streamer/src/StreamerInputSource.cc +++ b/IOPool/Streamer/src/StreamerInputSource.cc @@ -299,7 +299,7 @@ namespace edm::streamer { void StreamerInputSource::read(EventPrincipal& eventPrincipal) { if (adjustEventToNewProductRegistry_) { eventPrincipal.adjustIndexesAfterProductRegistryAddition(); - bool eventOK = eventPrincipal.adjustToNewProductRegistry(*productRegistry()); + bool eventOK = eventPrincipal.adjustToNewProductRegistry(productRegistry()); assert(eventOK); adjustEventToNewProductRegistry_ = false; }