1 #ifndef DataFormats_Common_RefToBaseProd_h
2 #define DataFormats_Common_RefToBaseProd_h
114 product_(ref.product_) {
132 return * operator->();
135 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
141 auto getter = product_.productGetter();
142 if(getter !=
nullptr) {
143 if(product_.isNull()) {
145 "attempting get view from a null RefToBaseProd.\n");
148 std::vector<void const*> pointers;
151 if(prod ==
nullptr) {
153 "attempting to get view from an unavailable RefToBaseProd.");
155 prod->
fillView(tId, pointers, helpers);
156 std::unique_ptr<View<T>>
tmp{
new View<T>(pointers, helpers, getter) };
157 if( product_.tryToSetProductPtrForFirstTime(
tmp.get())) {
175 return lhs.refCore() == rhs.refCore();
182 return !(lhs == rhs);
189 return (lhs.refCore() < rhs.refCore());
206 product_(ref.refCore()) {
207 std::vector<void const*> pointers;
218 product_(handle.id(), handle.product(), 0,
false) {
219 std::vector<void const*> pointers;
221 fillView(* handle, handle.
id(), pointers, helpers);
229 product_(handle.id(), handle.product(), 0,
false) {
230 std::vector<void const*> pointers;
232 fillView(* handle, handle.
id(), pointers, helpers);
View< T > const * viewPtr() const
~RefToBaseProd()
Destructor.
void setProductPtr(void const *prodPtr) const
product_type const * operator->() const
Member dereference operator.
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
#define CMS_CLASS_VERSION(_version_)
void fillView(ProductID const &id, std::vector< void const * > &view, FillViewHelperVector &helpers) const
void swap(Association< C > &lhs, Association< C > &rhs)
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
RefCore const & refCore() const
RefToBaseProd()
Default constructor needed for reading from persistent store. Not for direct use. ...
bool hasCache() const
Checks if product is in memory.
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
void const * productPtr() const
void fillView(AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper > const &obj, ProductID const &id, std::vector< void const * > &pointers, FillViewHelperVector &helpers)
RefToBaseProd< T > & operator=(const RefToBaseProd< T > &other)
ProductID id() const
Accessor for product ID.
EDProductGetter const * productGetter() const
Accessor for product getter.
RefCore const & refCore() const
EDProductGetter const * productGetter() const
product_type const * product() const
std::vector< std::vector< double > > tmp
product_type const * product() const
ProductID id() const
Accessor for product ID.
bool operator!() const
Checks for null.
product_type const & operator*() const
Dereference operator.
volatile std::atomic< bool > shutdown_flag false
bool isNull() const
Checks for null.
void swap(RefToBaseProd< T > &)
std::vector< std::pair< edm::ProductID, unsigned long > > FillViewHelperVector
bool isNonnull() const
Checks for non-null.