1 #ifndef canvas_Persistency_Common_setPtr_h 2 #define canvas_Persistency_Common_setPtr_h 7 #include "cetlib_except/demangle.h" 13 template <
class COLLECTION>
14 void setPtr(COLLECTION
const& coll,
15 std::type_info
const& iToType,
21 std::type_info
const& iToType,
26 template <
class Collection>
29 std::type_info
const& iToType,
33 using product_type = Collection;
34 auto it = coll.begin();
35 if (iIndex >= coll.size()) {
38 "An out-of-bounds error was encountered while setting an art::Ptr.\n"}
39 <<
"An attempt was made to access an element with index " << iIndex
40 <<
" for a container with a size of " << coll.size() <<
".\n" 41 <<
"The container is of type " +
42 cet::demangle_symbol(
typeid(Collection).
name())
53 std::type_info
const& iToType,
62 assert(it != obj.
end());
bool starts_with_pair(std::string const &type_name, size_t const pos)
std::string uniform_type_name(std::type_info const &tid)
void setPtr(COLLECTION const &coll, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr)
static auto const * address(const_iterator const &i)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
const_iterator findOrThrow(key_type key) const
void const * maybeCastObj(void const *address, std::type_info const &tiFrom, std::type_info const &tiTo)