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);
151 std::vector<void const*>& pointers,
154 void setPtr(std::type_info
const& toType,
156 void const*& ptr)
const;
159 std::vector<unsigned long>
const& indices,
160 std::vector<void const*>& ptrs)
const;
172 return comp(*t1, *t2);
179 return Ordering<O>(
comp);
184 template<
typename T,
typename P>
188 template<
typename T,
typename P>
192 template<
typename T,
typename P>
199 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
200 template<
typename T,
typename P>
206 template<
typename T,
typename P>
211 template<
typename T,
typename P>
218 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
219 template<
typename T,
typename P>
227 template<
typename T,
typename P>
232 template<
typename T,
typename P>
237 template<
typename T,
typename P>
242 template<
typename T,
typename P>
247 template<
typename T,
typename P>
252 template<
typename T,
typename P>
254 return data_.empty();
257 template<
typename T,
typename P>
262 template<
typename T,
typename P>
267 template<
typename T,
typename P>
272 template<
typename T,
typename P>
282 template<
typename T,
typename P>
294 template<
typename T,
typename P>
297 data_.push_back(d.release());
301 template<
typename T,
typename P>
307 template<
typename T,
typename P>
315 template <
typename T,
typename P>
317 return data_.back() != 0;
320 template<
typename T,
typename P>
325 "In OwnVector::back() we have intercepted an attempt to dereference a null pointer\n"
326 "Since OwnVector is allowed to contain null pointers, you much assure that the\n"
327 "pointer at the end of the collection is not null before calling back()\n"
328 "if you wish to avoid this exception.\n"
329 "Consider using OwnVector::is_back_safe()\n");
331 return *data_.back();
334 template<
typename T,
typename P>
339 "In OwnVector::back() we have intercepted an attempt to dereference a null pointer\n"
340 "Since OwnVector is allowed to contain null pointers, you much assure that the\n"
341 "pointer at the end of the collection is not null before calling back()\n"
342 "if you wish to avoid this exception.\n"
343 "Consider using OwnVector::is_back_safe()\n");
345 return *data_.back();
348 template<
typename T,
typename P>
350 return *data_.front();
353 template<
typename T,
typename P>
355 return *data_.front();
358 template<
typename T,
typename P>
360 typename base::const_iterator
b = data_.begin(),
e = data_.end();
361 for(
typename base::const_iterator
i = b;
i !=
e; ++
i)
365 template<
typename T,
typename P>
370 template<
typename T,
typename P>
376 template<
typename T,
typename P>
382 template<
typename T,
typename P>
384 typename base::iterator
b = first.
i,
e = last.
i;
385 for(
typename base::iterator
i = b;
i !=
e; ++
i)
390 template<
typename T,
typename P>
template<
typename S>
395 template<
typename T,
typename P>
400 template<
typename T,
typename P>
402 data_.swap(other.data_);
405 template<
typename T,
typename P>
407 std::vector<void const*>& pointers,
412 size_type numElements = this->
size();
413 pointers.reserve(numElements);
416 for(
typename base::const_iterator
i=data_.begin(),
e=data_.end();
i!=
e; ++
i, ++
key) {
420 "In OwnVector::fillView() we have intercepted an attempt to put a null pointer\n"
421 "into a View and that is not allowed. It is probably an error that the null\n"
422 "pointer was in the OwnVector in the first place.\n");
425 pointers.push_back(*
i);
426 holder_type
h(ref_type(
id, *
i, key,
this));
432 template<
typename T,
typename P>
441 template <
typename T,
typename P>
446 std::vector<void const*>& pointers,
448 obj.
fillView(
id, pointers, helpers);
452 template <
typename T,
typename P>
460 template <
typename T,
typename P>
465 void const*& ptr)
const {
466 detail::reallySetPtr<OwnVector<T,P> >(*
this, toType,
index, ptr);
469 template <
typename T,
typename P>
473 std::type_info
const& toType,
476 obj.
setPtr(toType, index, ptr);
479 template <
typename T,
typename P>
483 std::vector<unsigned long>
const& indices,
484 std::vector<void const*>& ptrs)
const {
489 template <
typename T,
typename P>
493 std::type_info
const& toType,
494 std::vector<unsigned long>
const& indices,
495 std::vector<void const*>& ptrs) {
500 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