1 #ifndef DataFormats_Common_OwnVector_h
2 #define DataFormats_Common_OwnVector_h
11 #if defined CMS_USE_DEBUGGING_ALLOCATOR
24 template <
typename T,
typename P = ClonePolicy<T> >
27 #if defined(CMS_USE_DEBUGGING_ALLOCATOR)
28 typedef std::vector<T*, debugging_allocator<T> >
base;
30 typedef std::vector<T*>
base;
69 typename base::const_iterator
i;
78 iterator(
typename base::iterator
const& it) :
i(it) { }
98 typename base::iterator
i;
107 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
123 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
130 template <
typename D>
void push_back(
D*
const& d);
131 template <
typename D>
void push_back(std::auto_ptr<D> d);
150 std::vector<void const*>& pointers,
153 void setPtr(std::type_info
const& toType,
155 void const*& ptr)
const;
158 std::vector<unsigned long>
const& indices,
159 std::vector<void const*>& ptrs)
const;
171 return comp(*t1, *t2);
178 return Ordering<O>(
comp);
183 template<
typename T,
typename P>
187 template<
typename T,
typename P>
191 template<
typename T,
typename P>
198 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
199 template<
typename T,
typename P>
205 template<
typename T,
typename P>
210 template<
typename T,
typename P>
217 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
218 template<
typename T,
typename P>
226 template<
typename T,
typename P>
231 template<
typename T,
typename P>
236 template<
typename T,
typename P>
241 template<
typename T,
typename P>
246 template<
typename T,
typename P>
251 template<
typename T,
typename P>
253 return data_.empty();
256 template<
typename T,
typename P>
261 template<
typename T,
typename P>
266 template<
typename T,
typename P>
271 template<
typename T,
typename P>
281 template<
typename T,
typename P>
293 template<
typename T,
typename P>
296 data_.push_back(d.release());
300 template<
typename T,
typename P>
306 template<
typename T,
typename P>
314 template <
typename T,
typename P>
316 return data_.back() != 0;
319 template<
typename T,
typename P>
324 "In OwnVector::back() we have intercepted an attempt to dereference a null pointer\n"
325 "Since OwnVector is allowed to contain null pointers, you much assure that the\n"
326 "pointer at the end of the collection is not null before calling back()\n"
327 "if you wish to avoid this exception.\n"
328 "Consider using OwnVector::is_back_safe()\n");
330 return *data_.back();
333 template<
typename T,
typename P>
338 "In OwnVector::back() we have intercepted an attempt to dereference a null pointer\n"
339 "Since OwnVector is allowed to contain null pointers, you much assure that the\n"
340 "pointer at the end of the collection is not null before calling back()\n"
341 "if you wish to avoid this exception.\n"
342 "Consider using OwnVector::is_back_safe()\n");
344 return *data_.back();
347 template<
typename T,
typename P>
349 return *data_.front();
352 template<
typename T,
typename P>
354 return *data_.front();
357 template<
typename T,
typename P>
359 typename base::const_iterator
b = data_.begin(),
e = data_.end();
360 for(
typename base::const_iterator
i = b;
i !=
e; ++
i)
364 template<
typename T,
typename P>
369 template<
typename T,
typename P>
375 template<
typename T,
typename P>
381 template<
typename T,
typename P>
383 typename base::iterator
b = first.
i,
e = last.
i;
384 for(
typename base::iterator
i = b;
i !=
e; ++
i)
389 template<
typename T,
typename P>
template<
typename S>
394 template<
typename T,
typename P>
399 template<
typename T,
typename P>
401 data_.swap(other.data_);
404 template<
typename T,
typename P>
406 std::vector<void const*>& pointers,
411 size_type numElements = this->
size();
412 pointers.reserve(numElements);
415 for(
typename base::const_iterator
i=data_.begin(),
e=data_.end();
i!=
e; ++
i, ++
key) {
419 "In OwnVector::fillView() we have intercepted an attempt to put a null pointer\n"
420 "into a View and that is not allowed. It is probably an error that the null\n"
421 "pointer was in the OwnVector in the first place.\n");
424 pointers.push_back(*
i);
425 holder_type
h(ref_type(
id, *
i, key,
this));
431 template<
typename T,
typename P>
440 template <
typename T,
typename P>
445 std::vector<void const*>& pointers,
447 obj.
fillView(
id, pointers, helpers);
451 template <
typename T,
typename P>
459 template <
typename T,
typename P>
464 void const*& ptr)
const {
465 detail::reallySetPtr<OwnVector<T,P> >(*
this, toType,
index, ptr);
468 template <
typename T,
typename P>
472 std::type_info
const& toType,
475 obj.
setPtr(toType, index, ptr);
478 template <
typename T,
typename P>
482 std::vector<unsigned long>
const& indices,
483 std::vector<void const*>& ptrs)
const {
488 template <
typename T,
typename P>
492 std::type_info
const& toType,
493 std::vector<unsigned long>
const& indices,
494 std::vector<void const*>& ptrs) {
499 template <
typename T,
typename P>
difference_type operator-(iterator const &o) const
T const * operator->() const
iterator operator-(difference_type n) const
base::const_iterator::iterator_category iterator_category
void fillView(AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper > const &obj, ProductID const &id, std::vector< void const * > &pointers, helper_vector &helpers)
const_iterator & operator++()
reference operator[](size_type)
bool operator()(T const *t1, T const *t2) const
void fillPtrVector(std::vector< T, A > const &obj, std::type_info const &iToType, std::vector< unsigned long > const &iIndicies, std::vector< void const * > &oPtr)
iterator & operator+=(difference_type d)
T const & operator*() const
iterator & operator-=(difference_type d)
bool operator!=(iterator const &ci) const
bool operator==(const_iterator const &ci) const
void swap(OwnVector< T, P > &other) noexcept
#define CMS_CLASS_VERSION(_version_)
OwnVector< T, P > & operator=(OwnVector< T, P > const &)
void swap(Association< C > &lhs, Association< C > &rhs)
void setPtr(std::vector< T, A > const &obj, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr)
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
void reallyfillPtrVector(COLLECTION const &coll, std::type_info const &iToType, std::vector< unsigned long > const &iIndicies, std::vector< void const * > &oPtr)
const_iterator operator--(int)
bool operator<(const_iterator const &o) const
reference operator[](difference_type d) const
bool operator<(iterator const &o) const
bool operator==(iterator const &ci) const
reference operator[](difference_type d) const
ptrdiff_t difference_type
auto const T2 &decltype(t1.eta()) t2
const_iterator(typename base::const_iterator const &it)
iterator erase(iterator pos)
void setPtr(std::type_info const &toType, unsigned long index, void const *&ptr) const
ptrdiff_t difference_type
void fillPtrVector(std::type_info const &toType, std::vector< unsigned long > const &indices, std::vector< void const * > &ptrs) const
const_iterator operator++(int)
bool is_back_safe() const
const_iterator(iterator const &it)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
T const & const_reference
base::size_type size_type
virtual void reserve(size_type n)=0
base const & data() const
iterator(typename base::iterator const &it)
difference_type operator-(const_iterator const &o) const
const_iterator & operator--()
static Ordering< O > ordering(O const &comp)
virtual void push_back(RefHolderBase const *r)=0
iterator operator+(difference_type n) const
const_iterator & operator-=(difference_type d)
T first(std::pair< T, U > const &p)
const_iterator operator+(difference_type n) const
DecomposeProduct< arg, typename Div::arg > D
tuple size
Write out results.
bool operator!=(const_iterator const &ci) const
const_iterator & operator+=(difference_type d)
void fillView(ProductID const &id, std::vector< void const * > &pointers, helper_vector &helpers) const
base::iterator::iterator_category iterator_category
const_iterator operator-(difference_type n) const