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__)
129 data_.shrink_to_fit();
137 template <
typename D>
void push_back(std::auto_ptr<D>
d);
147 iterator
erase(iterator pos);
157 std::vector<void const*>& pointers,
160 void setPtr(std::type_info
const& toType,
162 void const*& ptr)
const;
165 std::vector<unsigned long>
const& indices,
166 std::vector<void const*>& ptrs)
const;
178 return comp(*t1, *t2);
185 return Ordering<O>(
comp);
190 template<
typename T,
typename P>
194 template<
typename T,
typename P>
198 template<
typename T,
typename P>
205 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
206 template<
typename T,
typename P>
212 template<
typename T,
typename P>
217 template<
typename T,
typename P>
224 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
225 template<
typename T,
typename P>
233 template<
typename T,
typename P>
238 template<
typename T,
typename P>
243 template<
typename T,
typename P>
248 template<
typename T,
typename P>
253 template<
typename T,
typename P>
258 template<
typename T,
typename P>
260 return data_.empty();
263 template<
typename T,
typename P>
268 template<
typename T,
typename P>
273 template<
typename T,
typename P>
278 template<
typename T,
typename P>
288 template<
typename T,
typename P>
300 template<
typename T,
typename P>
303 data_.push_back(d.release());
307 template<
typename T,
typename P>
313 template<
typename T,
typename P>
321 template <
typename T,
typename P>
323 return data_.back() != 0;
326 template<
typename T,
typename P>
331 "In OwnVector::back() we have intercepted an attempt to dereference a null pointer\n"
332 "Since OwnVector is allowed to contain null pointers, you much assure that the\n"
333 "pointer at the end of the collection is not null before calling back()\n"
334 "if you wish to avoid this exception.\n"
335 "Consider using OwnVector::is_back_safe()\n");
337 return *data_.back();
340 template<
typename T,
typename P>
345 "In OwnVector::back() we have intercepted an attempt to dereference a null pointer\n"
346 "Since OwnVector is allowed to contain null pointers, you much assure that the\n"
347 "pointer at the end of the collection is not null before calling back()\n"
348 "if you wish to avoid this exception.\n"
349 "Consider using OwnVector::is_back_safe()\n");
351 return *data_.back();
354 template<
typename T,
typename P>
356 return *data_.front();
359 template<
typename T,
typename P>
361 return *data_.front();
364 template<
typename T,
typename P>
366 typename base::const_iterator
b = data_.begin(),
e = data_.end();
367 for(
typename base::const_iterator
i = b;
i !=
e; ++
i)
371 template<
typename T,
typename P>
376 template<
typename T,
typename P>
382 template<
typename T,
typename P>
388 template<
typename T,
typename P>
390 typename base::iterator
b = first.
i,
e = last.
i;
391 for(
typename base::iterator
i = b;
i !=
e; ++
i)
396 template<
typename T,
typename P>
template<
typename S>
401 template<
typename T,
typename P>
406 template<
typename T,
typename P>
408 data_.swap(other.data_);
411 template<
typename T,
typename P>
413 std::vector<void const*>& pointers,
418 size_type numElements = this->
size();
419 pointers.reserve(numElements);
422 for(
typename base::const_iterator
i=data_.begin(),
e=data_.end();
i!=
e; ++
i, ++
key) {
426 "In OwnVector::fillView() we have intercepted an attempt to put a null pointer\n"
427 "into a View and that is not allowed. It is probably an error that the null\n"
428 "pointer was in the OwnVector in the first place.\n");
431 pointers.push_back(*
i);
432 holder_type
h(ref_type(
id, *
i, key,
this));
438 template<
typename T,
typename P>
447 template <
typename T,
typename P>
452 std::vector<void const*>& pointers,
454 obj.
fillView(
id, pointers, helpers);
458 template <
typename T,
typename P>
466 template <
typename T,
typename P>
471 void const*& ptr)
const {
472 detail::reallySetPtr<OwnVector<T,P> >(*
this, toType,
index, ptr);
475 template <
typename T,
typename P>
479 std::type_info
const& toType,
482 obj.
setPtr(toType, index, ptr);
485 template <
typename T,
typename P>
489 std::vector<unsigned long>
const& indices,
490 std::vector<void const*>& ptrs)
const {
495 template <
typename T,
typename P>
499 std::type_info
const& toType,
500 std::vector<unsigned long>
const& indices,
501 std::vector<void const*>& ptrs) {
506 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
#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
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
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)
DecomposeProduct< arg, typename Div::arg > D
T const & const_reference
base::size_type size_type
virtual void reserve(size_type n)=0
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
double S(const TLorentzVector &, const TLorentzVector &)
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)
void swap(OwnVector< T, P > &other)
const_iterator operator+(difference_type n) const
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