|
|
Go to the documentation of this file. 1 #ifndef DataFormats_Common_OwnArray_h
2 #define DataFormats_Common_OwnArray_h
11 #if defined CMS_USE_DEBUGGING_ALLOCATOR
23 template <
typename T,
unsigned int MAX_SIZE,
typename P = ClonePolicy<T> >
27 typedef std::vector<T*>
base;
102 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
118 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
127 template <
typename D>
void push_back(std::unique_ptr<D>
d);
146 std::vector<void const*>& pointers,
149 void setPtr(std::type_info
const& toType,
151 void const*& ptr)
const;
154 std::vector<unsigned long>
const&
indices,
155 std::vector<void const*>& ptrs)
const;
180 template<
typename T,
unsigned int M,
typename P>
184 template<
typename T,
unsigned int M,
typename P>
188 template<
typename T,
unsigned int M,
typename P>
191 for (const_iterator
i =
o.begin(),
e =
o.end();
i !=
e; ++
i,++current)
195 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
196 template<
typename T,
unsigned int M,
typename P>
198 std::swap_ranges(data_,data_+M,
o.data_);
202 template<
typename T,
unsigned int M,
typename P>
207 template<
typename T,
unsigned int M,
typename P>
214 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
215 template<
typename T,
unsigned int M,
typename P>
217 std::swap_ranges(data_,data_+M,
o.data_);
223 template<
typename T,
unsigned int M,
typename P>
228 template<
typename T,
unsigned int M,
typename P>
233 template<
typename T,
unsigned int M,
typename P>
238 template<
typename T,
unsigned int M,
typename P>
243 template<
typename T,
unsigned int M,
typename P>
248 template<
typename T,
unsigned int M,
typename P>
253 template<
typename T,
unsigned int M,
typename P>
258 template<
typename T,
unsigned int M,
typename P>
263 template<
typename T,
unsigned int M,
typename P>
273 template<
typename T,
unsigned int M,
typename P>
285 template<
typename T,
unsigned int M,
typename P>
288 data_[size_++]=
d.release();
292 template<
typename T,
unsigned int M,
typename P>
298 template<
typename T,
unsigned int M,
typename P>
302 delete data_[--size_];
305 template <
typename T,
unsigned int M,
typename P>
307 return data_[size_-1] != 0;
310 template<
typename T,
unsigned int M,
typename P>
315 "In OwnArray::back() we have intercepted an attempt to dereference a null pointer\n"
316 "Since OwnArray is allowed to contain null pointers, you much assure that the\n"
317 "pointer at the end of the collection is not null before calling back()\n"
318 "if you wish to avoid this exception.\n"
319 "Consider using OwnArray::is_back_safe()\n");
324 template<
typename T,
unsigned int M,
typename P>
329 "In OwnArray::back() we have intercepted an attempt to dereference a null pointer\n"
330 "Since OwnArray is allowed to contain null pointers, you much assure that the\n"
331 "pointer at the end of the collection is not null before calling back()\n"
332 "if you wish to avoid this exception.\n"
333 "Consider using OwnArray::is_back_safe()\n");
338 template<
typename T,
unsigned int M,
typename P>
343 template<
typename T,
unsigned int M,
typename P>
348 template<
typename T,
unsigned int M,
typename P>
355 template<
typename T,
unsigned int M,
typename P>
360 template<
typename T,
unsigned int M,
typename P>
366 template<
typename T,
unsigned int M,
typename P>
376 template<
typename T,
unsigned int M,
typename P>
387 template<
typename T,
unsigned int M,
typename P>
template<
typename S>
392 template<
typename T,
unsigned int M,
typename P>
397 template<
typename T,
unsigned int M,
typename P>
399 std::swap_ranges(data_,data_+M,
other.data_);
402 template<
typename T,
unsigned int M,
typename P>
404 std::vector<void const*>& pointers,
413 for(
typename base::const_iterator
i=data_.begin(),
e=data_.end();
i!=
e; ++
i, ++
key) {
417 "In OwnArray::fillView() we have intercepted an attempt to put a null pointer\n"
418 "into a View and that is not allowed. It is probably an error that the null\n"
419 "pointer was in the OwnArray in the first place.\n");
422 pointers.push_back(*
i);
423 holder_type
h(ref_type(
id, *
i,
key,
this));
429 template<
typename T,
unsigned int M,
typename P>
438 template <
typename T,
unsigned int M,
typename P>
443 std::vector<void const*>& pointers,
449 template <
typename T,
unsigned int M,
typename P>
457 template <
typename T,
unsigned int M,
typename P>
462 void const*& ptr)
const {
463 detail::reallySetPtr<OwnArray<T,M,P> >(*
this, toType,
index, ptr);
466 template <
typename T,
unsigned int M,
typename P>
470 std::type_info
const& toType,
476 template <
typename T,
unsigned int M,
typename P>
480 std::vector<unsigned long>
const&
indices,
481 std::vector<void const*>& ptrs)
const {
486 template <
typename T,
unsigned int M,
typename P>
490 std::type_info
const& toType,
491 std::vector<unsigned long>
const&
indices,
492 std::vector<void const*>& ptrs) {
497 template <
typename T,
unsigned int M,
typename P>
std::vector< std::pair< edm::ProductID, unsigned long > > FillViewHelperVector
reference operator[](difference_type d) const
const pointer * data() const
difference_type operator-(iterator const &o) const
iterator operator+(difference_type n) const
const_iterator operator-(difference_type n) const
const_iterator operator+(difference_type n) const
iterator operator-(difference_type n) const
reference operator[](difference_type d) const
const_iterator & operator--()
void fillPtrVector(std::vector< T, A > const &obj, std::type_info const &iToType, std::vector< unsigned long > const &iIndicies, std::vector< void const * > &oPtr)
ptrdiff_t difference_type
bool operator!=(iterator const &ci) const
bool operator!=(const_iterator const &ci) const
void swap(Association< C > &lhs, Association< C > &rhs)
void fillPtrVector(std::type_info const &toType, std::vector< unsigned long > const &indices, std::vector< void const * > &ptrs) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
static Ordering< O > ordering(O const &comp)
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ int32_t *__restrict__ uint32_t numElements
const_iterator & operator+=(difference_type d)
iterator erase(iterator pos)
bool is_back_safe() const
T first(std::pair< T, U > const &p)
bool operator<(iterator const &o) const
const_iterator & operator++()
void setPtr(std::vector< T, A > const &obj, std::type_info const &iToType, unsigned long iIndex, void const *&oPtr)
const_iterator & operator-=(difference_type d)
const_iterator(pointer const *it)
T const * operator->() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
difference_type operator-(const_iterator const &o) const
size_type capacity() const
constexpr unsigned int MAX_SIZE
void reallyfillPtrVector(COLLECTION const &coll, std::type_info const &iToType, std::vector< unsigned long > const &iIndicies, std::vector< void const * > &oPtr)
ptrdiff_t difference_type
T const & operator*() const
#define CMS_CLASS_VERSION(_version_)
bool operator()(T const *t1, T const *t2) const
void fillView(ProductID const &id, std::vector< void const * > &pointers, FillViewHelperVector &helpers) const
bool operator<(const_iterator const &o) const
void setPtr(std::type_info const &toType, unsigned long index, void const *&ptr) const
reference operator[](size_type)
iterator & operator+=(difference_type d)
iterator & operator-=(difference_type d)
def template(fileName, svg, replaceme="REPLACEME")
DecomposeProduct< arg, typename Div::arg > D
const_iterator operator++(int)
const_iterator(iterator const &it)
base::iterator::iterator_category iterator_category
const_iterator operator--(int)
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
bool operator==(iterator const &ci) const
self & operator=(self const &)
std::pair< OmniClusterRef, TrackingParticleRef > P
void fillView(AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper > const &obj, ProductID const &id, std::vector< void const * > &pointers, FillViewHelperVector &helpers)
bool operator==(const_iterator const &ci) const
T const & const_reference
base::const_iterator::iterator_category iterator_category