1 #ifndef DataFormats_Common_RefVectorHolder_h
2 #define DataFormats_Common_RefVectorHolder_h
12 template <
typename REF>
class RefHolder;
14 template<
typename REFV>
26 virtual bool empty()
const;
56 bool equal_to(const_iterator_imp
const*
o)
const {
return i == dc(o); }
57 bool less_than(const_iterator_imp
const*
o)
const {
return i < dc(o); }
58 void assign(const_iterator_imp
const*
o) {
i = dc(o); }
59 std::shared_ptr<RefHolderBase> deref()
const;
60 difference_type
difference(const_iterator_imp
const*
o)
const {
return i - dc(o); }
62 typename REFV::const_iterator
const&
dc(const_iterator_imp
const*
o)
const {
65 "In RefVectorHolder trying to dereference a null pointer\n");
70 "In RefVectorHolder trying to cast iterator to wrong type\n");
74 typename REFV::const_iterator
i;
86 return refs_.product();
94 virtual std::shared_ptr<reftobase::RefHolderBase>
refBase(
size_t idx)
const;
102 template <
typename REFV>
106 refs_.swap(other.
refs_);
109 template <
typename REFV>
117 template<
typename REFV>
120 return refs_.empty();
123 template<
typename REFV>
129 template<
typename REFV>
132 return refs_.clear();
135 template<
typename REFV>
142 template<
typename REFV>
148 template<
typename REFV>
151 return refs_.productGetter();
154 template<
typename REFV>
160 template<
typename REFV>
166 template<
typename REFV>
172 template <
typename REFV>
175 return refs_[
idx].key();
179 template <
typename REFV>
191 namespace reftobase {
193 template<
typename REFV>
199 "RefVectorHolder: attempting to cast a RefHolderBase "
200 "to an invalid type.\nExpected: ",
204 refs_.push_back(rh->
getRef());
207 template <
typename REFV>
208 std::shared_ptr<RefHolderBase>
213 return std::shared_ptr<RefHolderBase>(std::make_shared<RefHolder<typename REFV::value_type> >(refs_[
idx]));
217 template<
typename REFV>
218 std::shared_ptr<RefHolderBase>
223 return std::shared_ptr<RefHolderBase>(std::make_shared<RefHolder<typename REFV::value_type> >(*i));
231 #include "boost/mpl/if.hpp"
234 namespace reftobase {
235 template<
typename REFV>
240 typeid(
typename REFV::collection_type).
name(),
241 "\ndoes not support Views\n");
245 template<
typename REFV>
248 typedef typename REFV::collection_type
collection;
249 collection
const* product =
static_cast<collection
const*
>(
prod);
254 template<
typename REFV>
RefVectorHolderBase::const_iterator const_iterator
virtual RefVectorHolder< REFV > * cloneEmpty() const
virtual ~RefVectorHolder()
void swap(RefVectorHolderBase &)
difference_type difference(const_iterator_imp const *o) const
virtual EDProductGetter const * productGetter() const
REF const & getRef() const
void reallyFillView(COLLECTION const &coll, ProductID const &id, std::vector< void const * > &ptrs, helper_vector &helpers)
bool less_than(const_iterator_imp const *o) const
~const_iterator_imp_specific()
RefVectorHolder & operator=(RefVectorHolder const &rhs)
virtual ProductID id() const
#define CMS_CLASS_VERSION(_version_)
bool equal_to(const_iterator_imp const *o) const
virtual size_type size() const
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
void assign(const_iterator_imp const *o)
void setRefs(REFV const &refs)
const_iterator_imp_specific * clone() const
static void reallyFillView(RefVectorHolder< REFV > &, void const *, ProductID const &, std::vector< void const * > &)
ptrdiff_t difference_type
const_iterator_imp_specific()
virtual RefVectorHolder< REFV > * clone() const
virtual void reallyFillView(void const *, ProductID const &, std::vector< void const * > &)
virtual void push_back(RefHolderBase const *r)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
virtual void reserve(size_type n)
Container::value_type value_type
RefVectorHolder(ProductID const &iId)
const_iterator end() const
const_iterator begin() const
RefVectorHolder(REFV const &refs)
const_iterator_imp_specific(typename REFV::const_iterator const &it)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
void swap(RefVectorHolder &other)
std::shared_ptr< RefHolderBase > deref() const
virtual bool isAvailable() const
virtual bool empty() const
static void reallyFillView(RefVectorHolder< REFV > &rvh, void const *prod, ProductID const &id, std::vector< void const * > &pointers)
virtual size_t keyForIndex(size_t idx) const
REFV::const_iterator const & dc(const_iterator_imp const *o) const
virtual std::shared_ptr< reftobase::RefHolderBase > refBase(size_t idx) const
void increase(difference_type d)
virtual void const * product() const
void swap(BaseHolder< T > &lhs, BaseHolder< T > &rhs)
void decrease(difference_type d)