1 #ifndef art_Persistency_Common_CollectionUtilities_h 2 #define art_Persistency_Common_CollectionUtilities_h 78 #include <type_traits> 83 class EDProductGetter;
90 template <
typename T,
typename InIter,
void (T::*)(InIter, InIter)>
92 template <
typename T,
typename I>
94 template <
typename T,
typename I>
100 sizeof(has_two_arg_insert_helper<T, typename T::const_iterator>(0)) ==
104 template <
typename T,
108 RET (
T::*)(OutIter, InIter, InIter)>
110 template <
typename T,
typename R,
typename O,
typename I>
112 template <
typename T,
typename R,
typename O,
typename I>
115 template <
typename T>
124 typename T::iterator,
130 template <
typename C>
139 template <
typename P>
151 template <
typename CONTAINER>
155 template <
typename CONTAINER>
160 template <
typename COLLECTION>
165 template <
typename COLLECTION,
typename OFFSETS>
171 template <
typename T>
176 template <
typename T,
typename OFFSETS>
188 template <
typename T>
192 template <
typename iterator>
200 template <
typename T>
209 template <
typename iterator>
222 getter = (*beg).productGetter();
225 if ((*i) !=
nullptr &&
226 !((*i)->productGetter() && (*i)->productGetter() == getter &&
227 (*i)->id().isValid() && (*i)->id() == id)) {
236 template <
typename CONTAINER>
241 out.insert(in.begin(), in.end());
245 template <
typename T>
254 for (
auto& pr : in) {
262 out.
append(in.begin(), in.end());
269 template <
typename CONTAINER>
276 template <
typename CONTAINER>
280 out.insert(out.end(), in.begin(), in.end());
284 template <
typename COLLECTION>
289 typename COLLECTION::size_type total_size = 0;
290 for (
auto collptr : in) {
291 if (collptr !=
nullptr) {
292 total_size += collptr->size();
295 out.reserve(total_size);
296 for (
auto collptr : in) {
297 if (collptr !=
nullptr) {
304 template <
typename COLLECTION,
typename OFFSETS>
311 offsets.reserve(in.size());
312 typename COLLECTION::size_type current_offset{};
313 for (
auto collptr : in) {
314 if (collptr ==
nullptr)
318 offsets.push_back(current_offset);
319 current_offset += delta;
321 flattenCollections<COLLECTION>(in, out);
325 template <
typename T>
334 <<
"Attempt to flatten incompatible PtrVectors " 335 <<
"referring to different ProductIDs.\n";
337 flattenCollections<PtrVector<T>>(in, out);
341 template <
typename T,
typename OFFSETS>
351 <<
"Attempt to flatten incompatible PtrVectors " 352 <<
"referring to different ProductIDs.\n";
354 flattenCollections<PtrVector<T>>(in, out, offsets);
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
static size_t offset(cet::map_vector< P > const &mv)
static size_t offset(C const &c)
void flattenCollections(std::vector< COLLECTION const * > const &in, COLLECTION &out)
no_tag has_three_arg_insert_helper(...)
static bool constexpr value
void append(InIter b, InIter e)
bool verifyPtrCollection(std::vector< art::PtrVector< T > const * > const &in)
static void concatenate(mv_t &out, mv_t in)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
static void concatenate(CONTAINER &out, CONTAINER const &in)
cet::LibraryManager dummy("noplugin")
constexpr unsigned long asInt() const noexcept
no_tag has_two_arg_insert_helper(...)
std::enable_if_t< detail::has_two_arg_insert< CONTAINER >::value > concatContainers(CONTAINER &out, CONTAINER const &in)