1 #ifndef FWCore_Framework_ESProducer_h 2 #define FWCore_Framework_ESProducer_h 89 namespace eventsetup {
95 template <
typename T,
typename TRecord,
typename TDecorator>
110 if (itemsToGetFromRecords_.empty()) {
113 return (itemsToGetFromRecords_[iIndex].
empty()) ? static_cast<ESProxyIndex const*>(
nullptr)
114 : &(itemsToGetFromRecords_[iIndex].front());
117 template <
typename Record>
119 if (itemsToGetFromRecords_.empty()
or itemsToGetFromRecords_[iIndex].empty()) {
122 auto const info = consumesInfos_[iIndex].get();
123 for (
size_t i = 0;
i <
info->size(); ++
i) {
124 auto chooserBase = (*info)[
i].chooser_.get();
127 itemsToGetFromRecords_[iIndex][
i] = chooser->
makeChoice(iRecord);
137 template <
typename T>
139 return setWhatProduced(iThis, &T::produce, iLabel);
142 template <
typename T>
144 return setWhatProduced(iThis,
es::Label(iLabel));
146 template <
typename T>
148 return setWhatProduced(iThis,
es::Label(iLabel));
151 template <
typename T,
typename TDecorator>
153 return setWhatProduced(iThis, &T::produce, iDec, iLabel);
160 template <
typename T,
typename TReturn,
typename TRecord>
170 template <
typename T,
typename TReturn,
typename TRecord,
typename TArg>
172 TReturn (
T ::*iMethod)(
const TRecord&),
175 const auto id = consumesInfos_.size();
178 unsigned int iovIndex = 0;
179 auto temp = std::make_shared<CallbackType>(
182 std::make_shared<std::pair<unsigned int, std::shared_ptr<CallbackType>>>(iovIndex,
std::move(
temp));
185 static_cast<const TRecord*>(
nullptr),
187 consumesInfos_.push_back(std::make_unique<ESConsumesInfo>());
192 template <
typename CallbackT,
typename TList,
typename TRecord>
193 void registerProducts(std::shared_ptr<std::pair<
unsigned int, std::shared_ptr<CallbackT>>> iCallback,
195 const TRecord* iRecord,
197 registerProduct(iCallback, static_cast<const typename TList::tail_type*>(
nullptr), iRecord, iLabel);
198 registerProducts(
std::move(iCallback), static_cast<const typename TList::head_type*>(
nullptr), iRecord, iLabel);
201 template <
typename CallbackT,
typename TRecord>
202 void registerProducts(std::shared_ptr<std::pair<
unsigned int, std::shared_ptr<CallbackT>>>,
209 template <
typename CallbackT,
typename TProduct,
typename TRecord>
210 void registerProduct(std::shared_ptr<std::pair<
unsigned int, std::shared_ptr<CallbackT>>> iCallback,
216 registerFactory(std::make_unique<FactoryType>(
std::move(iCallback)), iLabel.
default_);
219 template <
typename CallbackT,
typename TProduct,
typename TRecord,
int IIndex>
220 void registerProduct(std::shared_ptr<std::pair<
unsigned int, std::shared_ptr<CallbackT>>> iCallback,
226 "Unnamed Label\nthe index ",
228 " was never assigned a name in the 'setWhatProduced' method");
232 registerFactory(std::make_unique<FactoryType>(
std::move(iCallback)), iLabel.
labels_[IIndex]);
auto setWhatProduced(T *iThis, const std::string &iLabel)
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
static const std::string & def()
std::vector< std::vector< ESRecordIndex > > recordsUsedDuringGet_
std::vector< std::unique_ptr< ESConsumesInfo > > consumesInfos_
auto setWhatProduced(T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
const TDecorator & createDecoratorFrom(T *, const TRecord *, const TDecorator &iDec)
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
void updateFromMayConsumes(unsigned int iIndex, const Record &iRecord)
void registerProduct(std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TProduct *, const TRecord *, const es::Label &iLabel)
void registerProducts(std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
ESConsumesCollectorT< TRecord > setWhatProduced(T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
ESProxyIndex const * getTokenIndices(unsigned int iIndex) const
void registerProducts(std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
auto setWhatProduced(T *iThis, const char *iLabel)
auto setWhatProduced(T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
void registerProduct(std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const es::L< TProduct, IIndex > *, const TRecord *, const es::Label &iLabel)
std::vector< std::string > labels_
std::vector< std::vector< ESProxyIndex > > itemsToGetFromRecords_
virtual ESProxyIndex makeChoice(RCD const &iRecord) const =0