1 #ifndef canvas_Persistency_Common_traits_h 2 #define canvas_Persistency_Common_traits_h 9 #include "cetlib/container_algorithms.h" 10 #include "cetlib/map_vector.h" 11 #include "cetlib/metaprogramming.h" 12 #include "cetlib_except/demangle.h" 19 #include <type_traits> 39 std::numeric_limits<typename key_traits<K>::key_type>::max()};
43 template <
typename U,
typename V>
60 template <
typename T,
typename =
void>
69 template <
typename T,
typename =
void>
80 template <
typename T,
typename =
void>
82 static std::type_info
const*
92 std::enable_if_t<(has_value_type<T>::value && !has_mapped_type<T>::value)>>
95 static std::type_info
const*
102 template <
typename T>
106 static std::type_info
const*
121 template <
typename T>
128 template <
typename T>
135 template <
typename T,
typename =
void>
138 template <
typename T>
141 cet::enable_if_function_exists_t<void (T::*)(std::vector<void const*>&),
144 template <
typename T>
146 [[noreturn]]
static std::vector<void const*>
150 <<
"Product type " << cet::demangle_symbol(
typeid(T).name())
151 <<
" has no getView() capability.\n";
155 template <
typename T,
typename =
void>
158 template <
typename T>
161 get(T
const& product)
163 return product.getView();
167 template <
typename T,
typename A>
170 get(std::vector<T>
const& product)
172 std::vector<void const*> view;
173 cet::transform_all(product, back_inserter(view), address_of<T>);
178 template <
typename A>
182 template <
typename T,
typename A>
185 get(std::list<T>
const& product)
187 std::vector<void const*> view;
188 cet::transform_all(product, back_inserter(view), address_of<T>);
193 template <
typename T,
typename A>
196 get(std::deque<T>
const& product)
198 std::vector<void const*> view;
199 cet::transform_all(product, back_inserter(view), address_of<T>);
204 template <
typename T,
typename A>
207 get(std::set<T>
const& product)
209 std::vector<void const*> view;
210 cet::transform_all(product, back_inserter(view), address_of<T>);
215 template <
typename T>
218 get(cet::map_vector<T>
const& product)
220 std::vector<void const*> view;
221 cet::transform_all(product, back_inserter(view), address_of_second<T>);
236 template <
typename T>
238 template <
typename T,
typename A>
240 template <
typename A>
242 template <
typename T,
typename A>
244 template <
typename T,
typename A>
246 template <
typename T,
typename A>
248 template <
typename T>
static std::type_info const * type_id()
std::pair< U, V > key_type
static const key_type value
typename T::value_type element_type
void const * address_of(T const &t) noexcept
static std::type_info const * type_id()
static std::type_info const * type_id()
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
static const key_type value
typename T::mapped_type element_type
typename has_mapped_type< T >::element_type element_type
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
static constexpr key_type value
void const * address_of_second(typename cet::map_vector< T >::value_type const &t) noexcept
typename has_value_type< T >::element_type element_type