1 #ifndef DataFormats_Common_Ptr_h
2 #define DataFormats_Common_Ptr_h
33 #include "boost/type_traits/is_base_of.hpp"
34 #include "boost/utility/enable_if.hpp"
143 T const*
get()
const {
213 assert (iProduct != 0);
214 typename C::const_iterator it = iProduct->begin();
215 std::advance(it,iKey);
226 return *
reinterpret_cast<T const*
>(core_.productPtr());
235 return reinterpret_cast<T const*
>(core_.productPtr());
242 return lhs.refCore() == rhs.refCore() && lhs.key() == rhs.key();
249 return !(lhs == rhs);
255 operator<(Ptr<T>
const& lhs,
Ptr<T> const& rhs) {
258 return (lhs.refCore() == rhs.refCore() ? lhs.key() < rhs.key() : lhs.refCore() < rhs.refCore());
T const * operator->() const
Member dereference operator.
EDProductGetter const * mustBeNonZero(EDProductGetter const *prodGetter, std::string refType, ProductID const &productID)
void setProductPtr(void const *prodPtr) const
static const element_type * address(const iter &i)
Ptr(Ptr< U > const &iOther, typename boost::enable_if_c< boost::is_base_of< U, T >::value >::type *=0)
bool operator!() const
Checks for null.
Ptr(TestHandle< C > const &handle, key_type itemKey, bool=true)
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
#define CMS_CLASS_VERSION(_version_)
T const & operator*() const
Dereference operator.
Ptr(ProductID const &iId)
Ptr(Handle< C > const &handle, key_type itemKey, bool=true)
bool isNonnull() const
Checks for non-null.
T const * get() const
Returns C++ pointer to the item.
virtual WrapperHolder getIt(ProductID const &) const =0
ProductID id() const
Accessor for product ID.
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
void const * productPtr() const
RefCore const & refCore() const
Ptr(Ptr< U > const &iOther, typename boost::enable_if_c< boost::is_base_of< T, U >::value >::type *=0)
void productNotFoundException(std::type_info const &type) const
Ptr(ProductID const &productID, T const *item, key_type item_key)
void const * product() const
void setPtr(std::type_info const &iToType, unsigned long iIndex, void const *&oPtr) const
EDProductGetter const * productGetter() const
Ptr(C const *iProduct, key_type iItemKey, bool=true)
bool isTransient() const
Checks if this Ptr is transient (i.e. not persistable).
Ptr(ProductID const &productID, key_type itemKey, EDProductGetter const *prodGetter)
bool isNull() const
Checks for null.
bool hasProductCache() const
Ptr(OrphanHandle< C > const &handle, key_type itemKey, bool=true)
T const * getItem_(C const *product, key_type iKey)
EDProductGetter const * productGetter() const
Accessor for product getter.