1 #ifndef canvas_Persistency_Common_detail_aggregate_h 2 #define canvas_Persistency_Common_detail_aggregate_h 5 #include "cetlib/container_algorithms.h" 6 #include "cetlib/map_vector.h" 7 #include "cetlib/metaprogramming.h" 8 #include "cetlib_except/demangle.h" 24 class HepLorentzVector;
34 using cet::enable_if_function_exists_t;
36 template <
typename T,
typename =
void>
43 enable_if_function_exists_t<void (T::*)(T const&), &T::aggregate>>
50 enable_if_function_exists_t<void (T::*)(T), &T::aggregate>>
54 template <
typename T,
typename Enable =
void>
60 <<
"Products of type \"" << cet::demangle_symbol(
typeid(T).name())
61 <<
"\" cannot be aggregated.\n" 62 <<
"Please contact artists@fnal.gov.\n";
93 p.insert(p.cend(), other.cbegin(), other.cend());
102 p.insert(p.cend(), other.cbegin(), other.cend());
106 template <
typename T>
111 p.insert(p.cend(), other.cbegin(), other.cend());
116 template <
typename T,
size_t N>
121 cet::transform_all(p, other,
std::begin(p), [](T
t1, T
const&
t2) {
129 template <std::
size_t>
134 template <
typename Tuple>
140 template <std::
size_t I>
142 template <
typename Tuple>
146 using elem_type = std::tuple_element_t<I, Tuple>;
154 template <
typename... ARGS>
163 template <
typename K,
typename V>
169 p.insert(other.cbegin(), other.cend());
173 template <
typename K,
typename V>
183 template <
typename K,
typename V>
188 p.insert(other.cbegin(), other.cend());
192 template <
typename T>
198 p.insert(other.cbegin(), other.cend());
202 template <
typename T>
208 p.insert(other.cbegin(), other.cend());
220 <<
"Products of type \"" 221 << cet::demangle_symbol(
typeid(std::string).name())
222 <<
"\" cannot be aggregated unless their values are the same.\n" 223 <<
"Values presented were: \"" << p <<
"\" and \"" << other
233 static void aggregate(CLHEP::HepVector& p, CLHEP::HepVector
const&
other);
238 static void aggregate(CLHEP::Hep2Vector& p,
239 CLHEP::Hep2Vector
const&
other);
244 static void aggregate(CLHEP::Hep3Vector& p,
245 CLHEP::Hep3Vector
const&
other);
250 static void aggregate(CLHEP::HepLorentzVector& p,
251 CLHEP::HepLorentzVector
const&
other);
256 static void aggregate(CLHEP::HepMatrix& p, CLHEP::HepMatrix
const&
other);
261 static void aggregate(CLHEP::HepSymMatrix& p,
262 CLHEP::HepSymMatrix
const&
other);
279 template <
typename T>
static void aggregate(std::set< T > &p, std::set< T > const &other)
static void aggregate(T &p, T const &other)
static void aggregate(T &p, T const other)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
auto array(Array const &a)
Returns a manipulator which will print the specified array.
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
static void aggregate(std::string &p, std::string const &other)
static void combine(Tuple &, Tuple const &)
static void aggregate(std::array< T, N > &p, std::array< T, N > const &other)
static void aggregate(std::tuple< ARGS... > &p, std::tuple< ARGS... > const &other)
static void aggregate(std::deque< T > &p, std::deque< T > const &other)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
static void aggregate(std::list< T > &p, std::list< T > const &other)
static void combine(Tuple &p, Tuple const &other)
static void aggregate(cet::map_vector< T > &p, cet::map_vector< T > const &other)
static void aggregate(std::multimap< K, V > &p, std::multimap< K, V > const &other)
static void aggregate(std::map< K, V > &p, std::map< K, V > const &other)
static void aggregate(T &, T const &)
static void aggregate(T &p, T const &other)
static void aggregate(std::vector< T > &p, std::vector< T > const &other)
static void aggregate(std::pair< K, V > &p, std::pair< K, V > const &other)