1 #ifndef canvas_Persistency_Common_getElementAddresses_h 2 #define canvas_Persistency_Common_getElementAddresses_h 13 template <
typename Collection>
15 std::type_info
const& iToType,
16 std::vector<unsigned long>
const&
indices,
17 std::vector<void const*>& oPtr);
21 std::type_info
const& iToType,
22 std::vector<unsigned long>
const&
indices,
23 std::vector<void const*>& oPtr);
26 class value_type_helper;
32 static std::string
const&
35 static std::string
const pair_stem_s(
"std::pair<");
42 static size_t const pair_stem_offset_s =
pair_stem().size();
43 return pair_stem_offset_s;
56 static std::string
const mapped_type =
57 cet::demangle_symbol(
typeid(T).name());
66 template <
typename Collection>
69 std::type_info
const& iToType,
70 std::vector<unsigned long>
const&
indices,
71 std::vector<void const*>& oPtr)
73 oPtr.reserve(indices.size());
74 for (
auto const index : indices) {
75 auto it = coll.cbegin();
85 std::type_info
const& iToType,
86 std::vector<unsigned long>
const&
indices,
87 std::vector<void const*>& oPtr)
90 std::string
const wanted_type =
93 oPtr.reserve(indices.size());
96 for (
auto const index : indices) {
97 auto it = obj.find(cet::map_vector_key{index});
98 auto ptr = (it == obj.cend()) ?
nullptr : &*it;
103 for (
auto const index : indices) {
104 auto ptr = obj.getOrNull(cet::map_vector_key{index});
bool starts_with_pair(std::string const &type_name, size_t const pos)
static std::string const & pair_stem()
std::string uniform_type_name(std::type_info const &tid)
static size_t pair_stem_offset()
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
void getElementAddresses(Collection const &coll, std::type_info const &iToType, std::vector< unsigned long > const &indices, std::vector< void const * > &oPtr)
void const * maybeCastObj(void const *address, std::type_info const &tiFrom, std::type_info const &tiTo)