1 #ifndef DataFormats_Common_setPtr_h 2 #define DataFormats_Common_setPtr_h 35 template <
typename COLLECTION>
36 void reallySetPtr(COLLECTION
const& coll, std::type_info
const& iToType,
unsigned long iIndex,
void const*& oPtr) {
37 typedef COLLECTION product_type;
39 typedef typename product_type::const_iterator iter;
41 if (iToType ==
typeid(element_type)) {
42 iter it = coll.begin();
43 std::advance(it, iIndex);
47 iter it = coll.begin();
48 std::advance(it, iIndex);
53 if (
nullptr == oPtr) {
56 "edm::Ptr<> : unable to convert type ",
57 typeid(element_type).
name(),
66 template <
typename T,
typename A>
67 void setPtr(std::vector<T, A>
const&
obj, std::type_info
const& iToType,
unsigned long iIndex,
void const*& oPtr) {
71 template <
typename T,
typename A>
72 void setPtr(std::list<T, A>
const&
obj, std::type_info
const& iToType,
unsigned long iIndex,
void const*& oPtr) {
76 template <
typename T,
typename A>
77 void setPtr(std::deque<T, A>
const&
obj, std::type_info
const& iToType,
unsigned long iIndex,
void const*& oPtr) {
81 template <
typename T,
typename A,
typename Comp>
82 void setPtr(std::set<T, A, Comp>
const&
obj, std::type_info
const& iToType,
unsigned long iIndex,
void const*& oPtr) {
static const element_type * address(const iter &i)
void setPtr(std::vector< T, A > const &obj, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr)
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
COLLECTION::value_type element_type
void reallySetPtr(COLLECTION const &coll, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr)
void const * pointerToBase(std::type_info const &baseTypeInfo, T const *address)