1 #ifndef DataFormats_Common_RefToBaseProd_h
2 #define DataFormats_Common_RefToBaseProd_h
18 template<
typename T>
class View;
19 template<
typename C>
class Handle;
34 template<
class HandleC>
38 template<
typename C,
typename F>
116 namespace refhelper {
124 template<
typename C,
typename T,
typename F,
typename T1,
typename F1>
141 product_(view.id(), 0, view.productGetter(),
false) {
148 product_(ref.product_) {
166 return * operator->();
173 if(product_.productPtr() == 0) {
174 if(product_.isNull()) {
176 "attempting get view from a null RefToBaseProd.\n");
179 std::vector<void const*> pointers;
182 if(prod ==
nullptr) {
184 "attempting to get view from an unavailable RefToBaseProd.");
186 prod->
fillView(tId, pointers, helpers);
187 product_.setProductPtr((
new View<T>(pointers, helpers)));
202 return lhs.refCore() == rhs.refCore();
209 return !(lhs == rhs);
216 return (lhs.refCore() < rhs.refCore());
232 product_(ref.refCore()) {
233 std::vector<void const*> pointers;
244 template<
class HandleC>
247 product_(handle.id(), handle.product(), 0,
false) {
248 std::vector<void const*> pointers;
258 template<
typename C,
typename F>
262 ref.hasProductCache() ? ref.product() : 0,
265 std::vector<void const*> pointers;
278 ref.hasProductCache() ? ref.product() : 0,
281 std::vector<void const*> pointers;
283 helpers->reallyFillView(ref.
product(), ref.
id(), pointers);
View< T > const * viewPtr() const
~RefToBaseProd()
Destructor.
void setProductPtr(void const *prodPtr) const
product_type const * operator->() const
Member dereference operator.
RefVector< C, T, F > ref_vector_type
void reallyFillView(COLLECTION const &coll, ProductID const &id, std::vector< void const * > &ptrs, helper_vector &helpers)
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
RefVector< C, T, F > ref_vector_type
#define CMS_CLASS_VERSION(_version_)
void swap(Association< C > &lhs, Association< C > &rhs)
ProductID id() const
Accessor for product ID.
void const * product() const
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
RefCore const & refCore() const
reftobase::BaseHolder< value_type > * holder_
RefToBaseProd()
Default constructor needed for reading from persistent store. Not for direct use. ...
bool hasCache() const
Checks if product is in memory.
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
void const * productPtr() const
RefToBaseProd< T > & operator=(const RefToBaseProd< T > &other)
ProductID id() const
Accessor for product ID.
EDProductGetter const * productGetter() const
Accessor for product getter.
std::shared_ptr< reftobase::RefVectorHolderBase > helper_vector_ptr
void fillView(ProductID const &id, std::vector< void const * > &view, helper_vector_ptr &helpers) 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.
volatile std::atomic< bool > shutdown_flag false
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
bool isNull() const
Checks for null.
void swap(RefToBaseProd< T > &)
bool isNonnull() const
Checks for non-null.
C const * product() const
Accessor for product collection.