1 #ifndef DataFormats_Common_RefToBaseVector_h 2 #define DataFormats_Common_RefToBaseVector_h 18 template<
typename T>
class View;
19 template<
typename C>
class Handle;
22 template<
typename T>
class BaseVectorHolder;
23 class RefVectorHolderBase;
50 value_type at(size_type
idx)
const;
52 bool isValid()
const {
return holder_ !=
nullptr; }
53 bool isInvalid()
const {
return holder_ ==
nullptr; }
55 size_type
size()
const;
59 const_iterator
begin()
const;
60 const_iterator
end()
const;
65 std::unique_ptr<reftobase::RefVectorHolderBase> vectorHolder()
const;
79 #include "DataFormats/Common/interface/RefToBase.h" 116 template <
class REFV>
119 holder_(new reftobase::VectorHolder<
T,REFV>(iRef))
125 holder_(iOther.holder_ ? iOther.holder_->
clone() :
nullptr)
131 holder_(new reftobase::IndirectVectorHolder<
T>(p)) {
162 if ( holder_ ==
nullptr )
164 "Trying to dereference null RefToBaseVector<T> in method: at(",
167 return holder_->
at( idx );
183 return holder_ ? holder_->
empty() :
true;
191 return holder_ ? holder_->
size() : 0;
199 if ( holder_ !=
nullptr )
235 template <
typename T>
239 pointers.reserve(this->
size());
240 helpers.reserve(this->
size());
243 member_type
const * address = ref.
isNull() ?
nullptr : & * ref;
244 pointers.push_back(address);
250 template <
typename T>
253 std::vector<void const*>& pointers,
258 template <
typename T>
263 template <
typename T>
265 if ( holder_ ==
nullptr ) {
266 std::unique_ptr<reftobase::BaseVectorHolder<T> >
p = r.
holder_->makeVectorHolder();
267 holder_ = p.release();
272 template <
typename T>
274 return holder_ ? holder_->
vectorHolder() : std::unique_ptr<reftobase::RefVectorHolderBase>();
286 holder_(new reftobase::VectorHolder<
T,
RefVector<
C, typename refhelper::ValueTrait<
C>::
value,
287 typename refhelper::FindTrait<
C,
T>::
value> >(h.id())) {
virtual void push_back(BaseHolder< T > const *)=0
holder_type::const_iterator const_iterator
value_type operator[](size_type idx) const
std::unique_ptr< reftobase::RefVectorHolderBase > vectorHolder() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const_iterator end() const
#define CMS_CLASS_VERSION(_version_)
EDProductGetter const * productGetter(std::atomic< void const * > const &iCache)
value_type at(size_type idx) const
RefToBase< T > value_type
reftobase::BaseVectorHolder< T > holder_type
bool equal(const T &first, const T &second)
EDProductGetter const * productGetter() const
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Container::value_type value_type
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
reftobase::BaseHolder< value_type > * holder_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
void fillView(AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper > const &obj, ProductID const &id, std::vector< void const * > &pointers, FillViewHelperVector &helpers)
T operator[](int i) const
virtual base_ref_type const at(size_type idx) const =0
void fillView(std::vector< void const * > &pointers, FillViewHelperVector &helpers) const
virtual EDProductGetter const * productGetter() const =0
void swap(RefToBaseVector &other)
virtual size_type size() const =0
bool isNull() const
Checks for null.
virtual std::unique_ptr< RefVectorHolderBase > vectorHolder() const =0
RefToBaseVector & operator=(RefToBaseVector const &iRHS)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
const_iterator begin() const
virtual const_iterator end() const =0
virtual const_iterator begin() const =0
void push_back(const RefToBase< T > &)
virtual ProductID id() const =0
std::vector< std::pair< edm::ProductID, unsigned long > > FillViewHelperVector
virtual bool empty() const =0
holder_type::size_type size_type
void swap(BaseHolder< T > &lhs, BaseHolder< T > &rhs)