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>
135 assert(
handle->productGetter() == 0);
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;
184 "attempting to get view from an unavailable RefToBaseProd.");
186 it.
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;
242 template<
class HandleC>
245 product_(handle.
id(), handle.product(), 0,
false) {
246 std::vector<void const*> pointers;
256 template<
typename C,
typename F>
260 ref.hasProductCache() ? ref.product() : 0,
263 std::vector<void const*> pointers;
276 ref.hasProductCache() ? ref.product() : 0,
279 std::vector<void const*> pointers;
281 helpers->reallyFillView(ref.
product(), ref.
id(), pointers);
View< T > const * viewPtr() const
~RefToBaseProd()
Destructor.
boost::shared_ptr< reftobase::RefVectorHolderBase > helper_vector_ptr
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)
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 swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
void const * productPtr() const
void const * product() const
RefToBaseProd< T > & operator=(const RefToBaseProd< T > &other)
ProductID id() const
Accessor for product ID.
EDProductGetter const * productGetter() const
Accessor for product getter.
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.
reftobase::BaseHolder< value_type > * holder_
ProductID id() const
Accessor for product ID.
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
bool isNull() const
Checks for null.
void swap(RefToBaseProd< T > &)
C const * product() const
Accessor for product collection.
bool isNonnull() const
Checks for non-null.