1 #ifndef Framework_ESProducer_h 2 #define Framework_ESProducer_h 88 namespace eventsetup {
94 template <
typename T,
typename TRecord,
typename TDecorator>
111 if (itemsToGetFromRecords_.empty()) {
114 return (itemsToGetFromRecords_[iIndex].
empty()) ? static_cast<ESProxyIndex const*>(
nullptr)
115 : &(itemsToGetFromRecords_[iIndex].front());
123 template <
typename T>
125 return setWhatProduced(iThis, &T::produce, iLabel);
128 template <
typename T>
130 return setWhatProduced(iThis,
es::Label(iLabel));
132 template <
typename T>
134 return setWhatProduced(iThis,
es::Label(iLabel));
137 template <
typename T,
typename TDecorator>
139 return setWhatProduced(iThis, &T::produce, iDec, iLabel);
146 template <
typename T,
typename TReturn,
typename TRecord>
156 template <
typename T,
typename TReturn,
typename TRecord,
typename TArg>
158 TReturn (
T ::*iMethod)(
const TRecord&),
161 const auto id = consumesInfos_.size();
167 static_cast<const TRecord*>(
nullptr),
169 consumesInfos_.push_back(std::make_unique<ESConsumesInfo>());
177 template <
typename CallbackT,
typename TList,
typename TRecord>
180 const TRecord* iRecord,
182 registerProduct(iCallback, static_cast<const typename TList::tail_type*>(
nullptr), iRecord, iLabel);
183 registerProducts(iCallback, static_cast<const typename TList::head_type*>(
nullptr), iRecord, iLabel);
186 template <
typename T,
typename TRecord>
191 template <
typename T,
typename TProduct,
typename TRecord>
195 registerFactory(std::make_unique<FactoryType>(iCallback), iLabel.
default_);
198 template <
typename T,
typename TProduct,
typename TRecord,
int IIndex>
205 "Unnamed Label\nthe index ",
207 " was never assigned a name in the 'setWhatProduced' method");
211 registerFactory(std::make_unique<FactoryType>(iCallback), iLabel.
labels_[IIndex]);
auto setWhatProduced(T *iThis, const std::string &iLabel)
void registerProduct(std::shared_ptr< T > iCallback, const es::L< TProduct, IIndex > *, const TRecord *, const es::Label &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="")
void registerProduct(std::shared_ptr< T > iCallback, const TProduct *, const TRecord *, const es::Label &iLabel)
const TDecorator & createDecoratorFrom(T *, const TRecord *, const TDecorator &iDec)
ESConsumesCollectorT< TRecord > setWhatProduced(T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
void registerProducts(std::shared_ptr< T >, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
ESProxyIndex const * getTokenIndices(unsigned int iIndex) const
auto setWhatProduced(T *iThis, const char *iLabel)
void registerProducts(std::shared_ptr< CallbackT > iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
auto setWhatProduced(T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
std::vector< std::string > labels_
std::vector< std::vector< ESProxyIndex > > itemsToGetFromRecords_