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" 20 #include <type_traits> 41 std::numeric_limits<typename key_traits<K>::key_type>
::max()};
45 template <
class U,
class V>
65 template <
typename T,
typename =
void>
76 template <
typename T,
typename =
void>
89 template <
typename T,
typename =
void>
91 static std::type_info
const*
101 std::enable_if_t<(has_value_type<T>::value && !has_mapped_type<T>::value)>>
104 static std::type_info
const*
111 template <
typename T>
115 static std::type_info
const*
133 template <
typename T,
typename =
void>
137 template <
typename T>
140 cet::enable_if_function_exists_t<void (T::*)(std::vector<void const*>&),
144 template <
typename T>
147 fill(T
const&, std::vector<void const*>&)
150 <<
"Product type " << cet::demangle_symbol(
typeid(T).name())
151 <<
" has no fillView() capability.\n";
155 template <
class T,
typename =
void>
159 template <
typename T>
162 fill(T
const& product, std::vector<void const*>& view)
164 product.fillView(view);
168 template <
class T,
class A>
171 fill(std::vector<T>
const& product, std::vector<void const*>& view)
174 product, std::back_inserter(view), [](
auto const& p) {
return &p; });
183 template <
class T,
class A>
186 fill(std::list<T>
const& product, std::vector<void const*>& view)
189 product, std::back_inserter(view), [](
auto const& p) {
return &p; });
193 template <
class T,
class A>
196 fill(std::deque<T>
const& product, std::vector<void const*>& view)
199 product, std::back_inserter(view), [](
auto const& p) {
return &p; });
203 template <
class T,
class A>
206 fill(std::set<T>
const& product, std::vector<void const*>& view)
209 product, std::back_inserter(view), [](
auto const& p) {
return &p; });
216 fill(cet::map_vector<T>
const& product, std::vector<void const*>& view)
218 cet::transform_all(product, std::back_inserter(view), [](
auto const& p) {
238 template <
class T,
class A>
246 template <
class T,
class A>
250 template <
class T,
class A>
254 template <
class T,
class A>
static std::type_info const * type_id()
std::pair< U, V > key_type
typename T::mapped_type element_type
static const key_type value
static void fill(cet::map_vector< T > const &product, std::vector< void const * > &view)
static std::type_info const * type_id()
static std::type_info const * type_id()
typename T::value_type element_type
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
static void fill(std::deque< T > const &product, std::vector< void const * > &view)
static void fill(std::vector< T > const &product, std::vector< void const * > &view)
typename enable_if_type_exists< T, R >::type enable_if_type_exists_t
static const key_type value
typename has_mapped_type< T >::element_type element_type
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
static void fill(T const &, std::vector< void const * > &)
static void fill(std::set< T > const &product, std::vector< void const * > &view)
static constexpr key_type value
static void fill(T const &product, std::vector< void const * > &view)
static void fill(std::list< T > const &product, std::vector< void const * > &view)
typename has_value_type< T >::element_type element_type