1 #ifndef DataFormats_Common_RefToBaseProd_h
2 #define DataFormats_Common_RefToBaseProd_h
102 template <
typename T>
109 template <
typename T>
117 template <
typename T>
119 return *operator->();
123 template <
typename T>
126 auto getter = product_.productGetter();
127 if (getter !=
nullptr) {
128 if (product_.isNull()) {
132 std::vector<void const*> pointers;
135 if (prod ==
nullptr) {
138 prod->
fillView(tId, pointers, helpers);
139 std::unique_ptr<View<T>>
tmp{
new View<T>(pointers, helpers, getter)};
140 if (product_.tryToSetProductPtrForFirstTime(
tmp.get())) {
147 template <
typename T>
152 template <
typename T>
154 return lhs.refCore() == rhs.refCore();
157 template <
typename T>
159 return !(lhs == rhs);
162 template <
typename T>
164 return (lhs.refCore() < rhs.refCore());
167 template <
typename T>
176 template <
typename T>
177 template <
typename C>
179 std::vector<void const*> pointers;
185 template <
typename T>
186 template <
typename C>
188 : product_(handle.
id(), handle.product(), nullptr,
false) {
189 std::vector<void const*> pointers;
191 fillView(*handle, handle.
id(), pointers, helpers);
195 template <
typename T>
196 template <
typename C>
198 : product_(handle.
id(), handle.product(), nullptr,
false) {
199 std::vector<void const*> pointers;
201 fillView(*handle, handle.
id(), pointers, helpers);
205 template <
typename T>
207 : product_(id, nullptr, getter,
false) {}
constexpr bool operator==(ELseverityLevel const &e1, ELseverityLevel const &e2) noexcept
View< T > const * viewPtr() const
~RefToBaseProd()
Destructor.
void setProductPtr(void const *prodPtr) const
product_type const * operator->() const
Member dereference operator.
uint16_t *__restrict__ id
#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.
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.
constexpr bool operator!=(ELseverityLevel const &e1, ELseverityLevel const &e2) noexcept
RefCore const & refCore() const
EDProductGetter const * productGetter() const
product_type const * product() const
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.
bool isNull() const
Checks for null.
void swap(RefToBaseProd< T > &)
bool isNonnull() const
Checks for non-null.
std::vector< std::pair< edm::ProductID, unsigned long > > FillViewHelperVector