1 #ifndef canvas_Persistency_Common_FindMany_h 2 #define canvas_Persistency_Common_FindMany_h 129 #include "cetlib/maybe_ref.h" 131 #include <initializer_list> 138 template <
typename ProdB,
typename DATA =
void>
142 template <
typename ProdB>
148 template <
typename ProdB>
151 #ifdef ART_IPR_BY_PTR 152 using bColl_t = std::vector<std::vector<Ptr<ProdB> > >;
154 using bColl_t = std::vector<std::vector<ProdB const*> >;
164 template <
typename Handle,
typename DataContainer,
typename Tag>
166 DataContainer
const& dc,
170 template <
typename ProdAColl,
typename DataContainer,
typename Tag>
172 DataContainer
const& dc,
176 template <
typename PtrProdAColl,
typename DataContainer,
typename Tag>
177 FindMany(PtrProdAColl
const& aPtrColl,
178 DataContainer
const& dc,
180 std::enable_if_t<std::is_same<
typename PtrProdAColl::value_type,
183 template <
typename ProdA,
typename DataContainer,
typename Tag>
185 DataContainer
const& dc,
189 bool isValid()
const;
205 void setStoredException(std::shared_ptr<art::Exception const>&&
e);
206 void throwIfInvalid()
const;
210 std::shared_ptr<art::Exception const> storedException_{
nullptr};
213 template <
typename ProdB,
typename Data>
232 template <
typename Handle,
typename DataContainer,
typename Tag>
234 DataContainer
const& dc,
238 template <
typename ProdAColl,
typename DataContainer,
typename Tag>
240 DataContainer
const& dc,
244 template <
typename PtrProdAColl,
typename DataContainer,
typename Tag>
245 FindMany(PtrProdAColl
const& aPtrColl,
246 DataContainer
const& dc,
248 std::enable_if_t<std::is_same<
typename PtrProdAColl::value_type,
251 template <
typename ProdA,
typename DataContainer,
typename Tag>
253 DataContainer
const& dc,
275 template <
typename ProdB>
276 template <
typename Handle,
typename DataContainer,
typename Tag>
279 DataContainer
const& dc,
283 using ProdA =
typename Handle::element_type::value_type;
285 storedException_ = finder(*aCollection, bCollection_);
288 template <
typename ProdB>
289 template <
typename ProdAColl,
typename DataContainer,
typename Tag>
292 DataContainer
const& dc,
296 using ProdA = std::remove_const_t<std::remove_pointer_t<typename ProdAColl::value_type>>;
298 storedException_ = finder(view, bCollection_);
301 template <
typename ProdB>
302 template <
typename PtrProdAColl,
typename DataContainer,
typename Tag>
305 DataContainer
const& dc,
307 std::enable_if_t<std::is_same<
typename PtrProdAColl::value_type,
310 using ProdA =
typename PtrProdAColl::value_type::value_type;
312 storedException_ = finder(aPtrColl, bCollection_);
315 template <
typename ProdB>
316 template <
typename ProdA,
typename DataContainer,
typename Tag>
319 DataContainer
const& dc,
323 storedException_ = finder(ptrs, bCollection_);
326 template <
typename ProdB>
334 return bCollection_.size();
337 template <
typename ProdB>
343 return (storedException_.get() ==
nullptr);
346 template <
typename ProdB>
354 return bCollection_.at(i);
357 template <
typename ProdB>
366 item.insert(item.end(), ref.begin(), ref.end());
370 template <
typename ProdB>
380 template <
typename ProdB>
386 storedException_ = std::move(
e);
389 template <
typename ProdB>
397 <<
"Attempt to use a FindMany where the underlying art::Assns product was not found.";
403 template <
typename ProdB,
typename Data>
404 template <
typename Handle,
typename DataContainer,
typename Tag>
407 DataContainer
const& dc,
411 using ProdA =
typename Handle::element_type::value_type;
416 template <
typename ProdB,
typename Data>
417 template <
typename ProdAColl,
typename DataContainer,
typename Tag>
420 DataContainer
const& dc,
424 using ProdA = std::remove_const_t<std::remove_pointer_t<typename ProdAColl::value_type>>;
429 template <
typename ProdB,
typename Data>
430 template <
typename PtrProdAColl,
typename DataContainer,
typename Tag>
433 DataContainer
const& dc,
435 std::enable_if_t<std::is_same<
typename PtrProdAColl::value_type,
438 using ProdA =
typename PtrProdAColl::value_type::value_type;
443 template <
typename ProdB,
typename Data>
444 template <
typename ProdA,
typename DataContainer,
typename Tag>
447 DataContainer
const& dc,
454 template <
typename ProdB,
typename Data>
465 template <
typename ProdB,
typename Data>
474 data.insert(
data.end(), ref.begin(), ref.end());;
478 template <
typename ProdB,
typename Data>
488 #undef ART_IPR_BY_PTR
typename base::const_reference const_reference
InputTag input_tag(InputTag const &tag)
size_type get(size_type i, reference item) const
typename base::assoc_t assoc_t
typename dataColl_t::const_pointer data_const_pointer
size_type get(size_type i, reference item, data_reference data) const
typename base::reference reference
typename bColl_t::size_type size_type
typename bColl_t::difference_type difference_type
bool operator==(FindMany< ProdB, Data > const &other) const
typename dataColl_t::reference data_reference
dataColl_t dataCollection_
typename base::size_type size_type
typename bColl_t::reference reference
std::vector< std::vector< Data const * > > dataColl_t
bool operator==(FindMany< ProdB, void > const &other) const
typename bColl_t::const_reference const_reference
typename base::difference_type difference_type
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
void setStoredException(std::shared_ptr< art::Exception const > &&e)
typename base::value_type value_type
std::string value(boost::any const &)
std::vector< std::vector< ProdB const * > > bColl_t
typename bColl_t::value_type value_type
void throwIfInvalid() const
const_reference at(size_type i) const
FindMany(Handle const &aCollection, DataContainer const &dc, Tag const &tag, std::enable_if_t< detail::is_handle< Handle >::value > *=nullptr)
data_const_reference data(size_type i) const
typename dataColl_t::const_reference data_const_reference