1 #ifndef art_Framework_Core_PtrRemapper_h 2 #define art_Framework_Core_PtrRemapper_h 183 class ProdToProdMapBuilder;
185 namespace PtrRemapperDetail {
187 template <
typename PROD>
195 template <
typename CONT,
typename PROD,
typename CALLBACK>
209 template <
typename CONT,
typename PROD>
224 template <
typename CONT,
typename PROD>
247 template <
typename PROD,
typename SIZE_TYPE>
251 template <
typename PROD,
typename SIZE_TYPE>
253 SIZE_TYPE offset)
const;
256 template <
typename InIter,
typename OutIter,
typename SIZE_TYPE>
257 void operator()(InIter beg, InIter
end, OutIter out, SIZE_TYPE offset)
const;
260 template <
typename OutIter,
typename PROD,
typename OFFSETS>
261 void operator()(std::vector<PROD const*>
const& in,
263 OFFSETS
const& offsets)
const;
266 template <
typename CONT,
typename OutIter,
typename PROD,
typename OFFSETS>
267 void operator()(std::vector<PROD const*>
const& in,
269 OFFSETS
const& offsets,
270 CONT
const& (*extractor)(PROD
const*))
const;
273 template <
typename CONT,
typename OutIter,
typename PROD,
typename OFFSETS>
274 void operator()(std::vector<PROD const*>
const& in,
276 OFFSETS
const& offsets,
277 CONT
const& (PROD::*extractor)()
const)
const;
280 template <
typename CONT,
typename OutIter,
typename PROD,
typename OFFSETS>
281 void operator()(std::vector<PROD const*>
const& in,
283 OFFSETS
const& offsets,
284 CONT PROD::*
const data)
const;
287 template <
typename PROD,
292 void operator()(std::vector<PROD const*>
const& in,
294 OFFSETS
const& offsets,
295 CONT
const& (X::*extractor)(PROD
const*),
299 template <
typename PROD,
304 void operator()(std::vector<PROD const*>
const& in,
306 OFFSETS
const& offsets,
307 CONT
const& (X::*extractor)(PROD
const*)
const,
311 template <
typename CONT,
316 void operator()(std::vector<PROD const*>
const& in,
318 OFFSETS
const& offsets,
319 CALLBACK extractor)
const;
332 template <
typename PROD,
typename SIZE_TYPE>
335 SIZE_TYPE
const offset)
const 337 if (oldPtr.
id().isValid()) {
338 auto iter = prodTransMap_.find(oldPtr.
id());
339 if (iter ==
cend(prodTransMap_)) {
341 <<
"PtrRemapper: could not find old ProductID " << oldPtr.
id()
342 <<
" in translation table: already translated?\n";
344 auto productGetter = event_->productGetter(iter->second);
345 if (productGetter ==
nullptr) {
347 <<
"PtrRemapper: cannot create output " 349 <<
" with ProductID: " << iter->second
350 <<
"\nbecause the product is not known. Perhaps the output product " 351 "was misspecified for product mixing.\n";
355 Ptr<PROD>{iter->second, oldPtr.
key() + offset, productGetter} :
364 template <
typename PROD,
typename SIZE_TYPE>
367 SIZE_TYPE
const offset)
const 373 std::back_inserter(result),
379 template <
typename InIter,
typename OutIter,
typename SIZE_TYPE>
384 SIZE_TYPE
const offset)
const 391 for (
auto i = beg; i !=
end; ++i) {
402 template <
typename OutIter,
typename PROD,
typename OFFSETS>
406 OFFSETS
const& offsets)
const 411 PtrRemapperDetail::simpleProdReturner<PROD>);
415 template <
typename CONT,
typename OutIter,
typename PROD,
typename OFFSETS>
419 OFFSETS
const& offsets,
420 CONT
const& (*extractor)(PROD
const*))
const 422 this->operator()<CONT, CONT
const& (*)(PROD
const*)>(in,
429 template <
typename CONT,
typename OutIter,
typename PROD,
typename OFFSETS>
433 OFFSETS
const& offsets,
434 CONT
const& (PROD::*extractor)()
const)
const 436 this->operator()<CONT, CONT
const& (PROD::*)()
const>(in,
443 template <
typename CONT,
typename OutIter,
typename PROD,
typename OFFSETS>
447 OFFSETS
const& offsets,
448 CONT PROD::*
const data)
const 450 this->operator()<CONT, CONT PROD::*
const>(in, out, offsets,
data);
454 template <
typename PROD,
462 OFFSETS
const& offsets,
463 CONT
const& (X::*)(PROD
const*),
466 this->operator()<CONT>(
467 in, out, offsets, [&
x](
auto& elem) { elem.extractor(x); });
471 template <
typename PROD,
479 OFFSETS
const& offsets,
480 CONT
const& (X::*)(PROD
const*)
const,
483 this->operator()<CONT>(
484 in, out, offsets, [&
x](
auto& elem) { elem.extractor(x); });
488 template <
typename CONT,
496 OFFSETS
const& offsets,
497 CALLBACK extractor)
const 499 if (in.size() != offsets.size()) {
501 <<
"Collection size of " << in.size()
502 <<
" disagrees with offset container size of " << offsets.size() <<
".\n";
505 auto const e = in.end();
506 auto off_iter = offsets.begin();
509 for (; i !=
e; ++i, ++off_iter) {
510 CONT
const& cont{returner.operator()(*i)};
511 this->
operator()(cont.begin(), cont.end(), out, *off_iter);
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
void reserve(size_type n)
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
CONT const & operator()(PROD const *prod) const
ContReturner(CALLBACK callback)
static QCString className
CONT const & operator()(PROD const *prod) const
ContReturner(CALLBACK callback)
CONT const & operator()(PROD const *prod) const
key_type key() const noexcept
std::map< ProductID, ProductID > ProdTransMap_t
PROD const & simpleProdReturner(PROD const *prod)
ProductID id() const noexcept
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
bool isNonnull() const noexcept
CONT PROD::*const CALLBACK
CONT const &(PROD::* CALLBACK)() const
Ptr< PROD > operator()(Ptr< PROD > const &oldPtr, SIZE_TYPE offset) const
ContReturner(CALLBACK callback)