OpenMS  2.5.0
ConstRefVector.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2020.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg $
32 // $Authors: $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <OpenMS/CONCEPT/Types.h>
39 
40 #include <algorithm>
41 #include <typeinfo>
42 #include <vector>
43 
44 namespace OpenMS
45 {
46 
69  template <typename ContainerT>
71  {
72 public:
73 
75  template <class ValueT>
77  {
78  friend class ConstRefVector;
79 
80 public:
81  typedef ValueT ValueType;
83  typedef typename std::vector<ValueType*>::difference_type difference_type;
84  typedef const value_type& reference;
85  typedef const value_type* pointer;
86  typedef std::random_access_iterator_tag iterator_category;
87 
89  {
90  }
91 
92  ConstRefVectorConstIterator(const typename std::vector<ValueType*>* vec, unsigned int position)
93  {
94  vector_ = (typename std::vector<ValueType*>*)vec;
96  }
97 
98  ConstRefVectorConstIterator(typename std::vector<ValueType*>* vec, unsigned int position)
99  {
100  vector_ = vec;
102  }
103 
105  {
106  vector_ = it.vector_;
107  position_ = it.position_;
108  }
109 
111  {}
112 
114  {
115  if (this == &rhs) return *this;
116 
117  vector_ = rhs.vector_;
118  position_ = rhs.position_;
119 
120  return *this;
121  }
122 
124  {
125  return position_ < it.position_;
126  }
127 
129  {
130  return position_ > it.position_;
131  }
132 
134  {
135  return position_ < it.position_ || position_ == it.position_;
136  }
137 
139  {
140  return position_ > it.position_ || position_ == it.position_;
141  }
142 
144  {
145  return position_ == it.position_ && vector_ == it.vector_;
146  }
147 
149  {
150  return position_ != it.position_ || vector_ != it.vector_;
151  }
152 
154  {
155  position_ += 1;
156  return *this;
157  }
158 
160  {
161  ConstRefVectorConstIterator tmp(*this);
162  ++(*this);
163  return tmp;
164  }
165 
167  {
168  position_ -= 1;
169  return *this;
170  }
171 
173  {
174  ConstRefVectorConstIterator tmp(*this);
175  --(*this);
176  return tmp;
177  }
178 
180  {
181  ConstRefVectorConstIterator tmp(*this);
182  tmp.position_ -= n;
183  return tmp;
184  }
185 
187  {
188  ConstRefVectorConstIterator tmp(*this);
189  tmp.position_ += n;
190  return tmp;
191  }
192 
194  {
195  position_ += n;
196  return *this;
197  }
198 
200  {
201  position_ -= n;
202  return *this;
203  }
204 
206  {
207  return i1.position_ - i2.position_;
208  }
209 
211  {
213  tmp.position_ += n;
214  return tmp;
215  }
216 
218  {
219  return *((*vector_)[position_]);
220  }
221 
223  {
224  return (*vector_)[position_];
225  }
226 
227 protected:
228 
229  typename std::vector<ValueType*>* vector_;
230  unsigned int position_;
231  };
232 
233 
235  template <class ValueT>
237  public ConstRefVectorConstIterator<ValueT>
238  {
239  friend class ConstRefVector;
240 
241 public:
242 
243  typedef ValueT ValueType;
246 
249 
250 
252  {
253  }
254 
255  ConstRefVectorIterator(typename std::vector<ValueType*>* vec, unsigned int position) :
257  {
258  }
259 
262  {
263  }
264 
266  {
267  }
268 
270  {
271  return *((*vector_)[position_]);
272  }
273 
275  {
276  return (*vector_)[position_];
277  }
278 
280  {
282  return *this;
283  }
284 
286  {
287  ConstRefVectorIterator tmp(*this);
288  ++(*this);
289  return tmp;
290  }
291 
293  {
295  return *this;
296  }
297 
299  {
300  ConstRefVectorIterator tmp(*this);
301  --(*this);
302  return tmp;
303  }
304 
306  {
307  ConstRefVectorIterator tmp(*this);
308  tmp.position_ -= n;
309  return tmp;
310  }
311 
313  {
314  ConstRefVectorIterator tmp(*this);
315  tmp.position_ += n;
316  return tmp;
317  }
318 
320  {
321  ConstRefVectorIterator tmp(i);
322  tmp.position_ += n;
323  return tmp;
324  }
325 
327  {
329  return *this;
330  }
331 
333  {
335  return *this;
336  }
337 
339  {
340  unsigned int tmp = i1.position_;
341  i1.position_ = i2.position_;
342  i2.position_ = tmp;
343  }
344 
345  };
346 
347 
349 
350  typedef ContainerT ContainerType;
353  typedef typename ContainerType::value_type ValueType;
356  typedef std::reverse_iterator<Iterator> ReverseIterator;
357  typedef std::reverse_iterator<ConstIterator> ConstReverseIterator;
359 
361 
363  typedef typename ContainerType::size_type size_type;
364  typedef typename ContainerType::difference_type difference_type;
365  typedef typename ContainerType::reference reference;
366  typedef typename ContainerType::const_reference const_reference;
367  typedef typename ContainerType::pointer pointer;
373 
374 
376  void push_back(const ValueType& x)
377  {
378  const ValueType* element = &x;
379  vector_.push_back(element);
380  }
381 
383  void pop_back()
384  {
385  vector_.pop_back();
386  }
387 
389  size_type size() const
390  {
391  return vector_.size();
392  }
393 
396  {
397  return std::max(vector_.size(), capacity_);
398  }
399 
402  {
403  size_type cap = capacity();
404 
405  if (n > cap)
406  {
407  vector_.reserve(n);
408  capacity_ = n;
409  }
410  }
411 
414  {
415  return vector_.max_size();
416  }
417 
420  {
421  return Iterator((std::vector<const ValueType*>*) & vector_, (unsigned int)0);
422  }
423 
426  {
427  return Iterator((std::vector<const ValueType*>*) & vector_, (unsigned int)(vector_.size()));
428  }
429 
432  {
433  return ConstIterator((const std::vector<const ValueType*>*) & vector_, (unsigned int)0);
434  }
435 
438  {
439  return ConstIterator((const std::vector<const ValueType*>*) & vector_, (unsigned int)(vector_.size()));
440  }
441 
444  {
445  return ReverseIterator(end());
446  }
447 
450  {
451  return ReverseIterator(begin());
452  }
453 
456  {
457  return ConstReverseIterator(end());
458  }
459 
462  {
463  return ConstReverseIterator(begin());
464  }
465 
467  void resize(size_type new_size)
468  {
469  vector_.resize(new_size);
470  capacity_ = vector_.capacity();
471  }
472 
474  void resize(size_type new_size, const ValueType& t)
475  {
476  vector_.resize(new_size, &t);
477  capacity_ = vector_.capacity();
478  }
479 
482  {
483  return *(begin());
484  }
485 
488  {
489  return *(end() - 1);
490  }
491 
493  void clear()
494  {
495  vector_.clear();
496  }
497 
499  bool empty() const
500  {
501  return vector_.empty();
502  }
503 
506  {
507  return *(vector_[n]);
508  }
509 
511  bool operator==(const ConstRefVector& array) const
512  {
514  {
515  return false;
516  }
517  if (size() != array.size())
518  {
519  return false;
520  }
521  for (Size i = 0; i < size(); i++)
522  {
523  if (typeid(*(vector_[i])) != typeid(*(array.vector_[i])))
524  {
525  return false;
526  }
527  if (vector_[i]->operator!=(* array.vector_[i]))
528  {
529  return false;
530  }
531  }
532  return true;
533  }
534 
536  bool operator!=(const ConstRefVector& array) const
537  {
538  return !(operator==(array));
539  }
540 
542  bool operator<(const ConstRefVector& array) const
543  {
544  return size() < array.size();
545  }
546 
548  bool operator>(const ConstRefVector& array) const
549  {
550  return size() > array.size();
551  }
552 
554  bool operator<=(const ConstRefVector& array) const
555  {
556  return operator<(array) || operator==(array);
557  }
558 
560  bool operator>=(const ConstRefVector& array) const
561  {
562  return operator>(array) || operator==(array);
563  }
564 
566  void swap(ConstRefVector& array)
567  {
568  vector_.swap(array.vector_);
569  }
570 
572  friend void swap(ConstRefVector& a1, ConstRefVector& a2)
573  {
574  a1.vector_.swap(a2.vector_);
575  }
576 
578  Iterator insert(Iterator pos, const ValueType& element)
579  {
580  const ValueType* pointer = &element;
581  vector_.insert(vector_.begin() + pos.position_, pointer);
582  return pos;
583  }
584 
586  void insert(Iterator pos, size_type n, const ValueType& element)
587  {
588  const ValueType* pointer;
589  std::vector<const ValueType*> tmp;
590  for (size_type i = 0; i < n; i++)
591  {
592  pointer = &element;
593  tmp.push_back(pointer);
594  }
595  vector_.insert(vector_.begin() + pos.position_, tmp.begin(), tmp.end());
596  }
597 
599  template <class InputIterator>
600  void insert(Iterator pos, InputIterator f, InputIterator l)
601  {
602  const ValueType* pointer;
603  std::vector<const ValueType*> tmp;
604  for (InputIterator it = f; it != l; ++it)
605  {
606  pointer = &(*it);
607  tmp.push_back(pointer);
608  }
609  vector_.insert(vector_.begin() + pos.position_, tmp.begin(), tmp.end());
610  }
611 
614  {
615  vector_.erase(vector_.begin() + pos.position_);
616  return pos;
617  }
618 
621  {
622  vector_.erase(vector_.begin() + first.position_, vector_.begin() + last.position_);
623  return first;
624  }
625 
627 
628  ConstRefVector() :
630  capacity_(0),
631  base_container_ptr_(nullptr)
632  {
633  }
634 
637  capacity_(0),
639  {
640  vector_ = std::vector<const ValueType*>(n);
641  }
642 
644  ConstRefVector(size_type n, const ValueType& element) :
645  capacity_(0),
647  {
648  vector_ = std::vector<const ValueType*>(n, &element);
649  }
650 
653  capacity_(0),
655  {
656  const ValueType* element;
657  for (ConstIterator it = p.begin(); it != p.end(); ++it)
658  {
659  element = &(*it);
660  vector_.push_back(element);
661  }
662  }
663 
665  template <class InputIterator>
666  ConstRefVector(InputIterator f, InputIterator l) :
667  capacity_(0),
668  base_container_ptr_(nullptr)
669  {
670  const ValueType* pointer;
671  for (InputIterator it = f; it != l; ++it)
672  {
673  pointer = &(*it);
674  vector_.push_back(pointer);
675  }
676  }
677 
680  capacity_(0),
682  {
683  const ValueType* element;
684  for (typename ContainerType::iterator it = p.begin(); it != p.end(); ++it)
685  {
686  element = &(*it);
687  vector_.push_back(element);
688  }
689  }
690 
693  {
694  }
695 
697 
700  {
701  if (this == &rhs) return *this;
702 
704  clear();
705  reserve(rhs.size());
706  const ValueType* element;
707  for (ConstIterator it = rhs.begin(); it != rhs.end(); ++it)
708  {
709  element = &(*it);
710  vector_.push_back(element);
711  }
712 
713  return *this;
714  }
715 
717  template <class InputIterator>
718  void assign(InputIterator f, InputIterator l)
719  {
720  clear();
721  insert(end(), f, l);
722  }
723 
725  void assign(size_type n, const ValueType& x)
726  {
727  clear();
728  insert(end(), n, x);
729  }
730 
739 
741  void sortByIntensity(bool reverse = false)
742  {
743  if (reverse)
744  {
745  std::sort(vector_.begin(), vector_.end(), reverseComparator(pointerComparator(typename ValueType::IntensityLess())));
746  }
747  else
748  {
749  std::sort(vector_.begin(), vector_.end(), pointerComparator(typename ValueType::IntensityLess()));
750  }
751  }
752 
755  {
756  std::sort(vector_.begin(), vector_.end(), pointerComparator(typename ValueType::PositionLess()));
757  }
758 
760 
774  template <typename ComparatorType>
775  void sortByComparator(ComparatorType const& comparator = ComparatorType())
776  {
777  std::sort(vector_.begin(), vector_.end(), pointerComparator(comparator));
778  }
779 
781 
782  //----------------------------------------------------------------------
783 
784 protected:
785 
787  std::vector<const ValueType*> vector_;
792  };
793 
794 } // namespace OpenMS
795 
OpenMS::ConstRefVector::ConstRefVectorConstIterator::ConstRefVectorConstIterator
ConstRefVectorConstIterator(const typename std::vector< ValueType * > *vec, unsigned int position)
Definition: ConstRefVector.h:92
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator==
bool operator==(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:143
OpenMS::ConstRefVector::rbegin
ConstReverseIterator rbegin() const
See std::vector documentation.
Definition: ConstRefVector.h:455
OpenMS::ConstRefVector::size_type
ContainerType::size_type size_type
Definition: ConstRefVector.h:363
OpenMS::ConstRefVector::const_reverse_iterator
ConstReverseIterator const_reverse_iterator
Definition: ConstRefVector.h:371
OpenMS::ConstRefVector::ConstRefVectorConstIterator::ValueType
ValueT ValueType
Definition: ConstRefVector.h:81
OpenMS::ConstRefVector::end
Iterator end()
See std::vector documentation.
Definition: ConstRefVector.h:425
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator-
friend difference_type operator-(const ConstRefVectorConstIterator &i1, const ConstRefVectorConstIterator &i2)
Definition: ConstRefVector.h:205
OpenMS::ConstRefVector::ConstRefVectorIterator::ConstRefVectorIterator
ConstRefVectorIterator()
Definition: ConstRefVector.h:251
OpenMS::ConstRefVector::ConstRefVectorIterator::ConstRefVectorIterator
ConstRefVectorIterator(typename std::vector< ValueType * > *vec, unsigned int position)
Definition: ConstRefVector.h:255
OpenMS::ConstRefVector::ConstRefVectorConstIterator::position_
unsigned int position_
Definition: ConstRefVector.h:230
Types.h
OpenMS::ConstRefVector::ConstRefVectorIterator::operator+=
ConstRefVectorIterator & operator+=(typename ConstRefVectorIterator::difference_type n)
Definition: ConstRefVector.h:326
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator++
ConstRefVectorConstIterator operator++(int)
Definition: ConstRefVector.h:159
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector(const ConstRefVector &p)
See std::vector documentation.
Definition: ConstRefVector.h:652
OpenMS::ConstRefVector::sortByPosition
void sortByPosition()
Lexicographically sorts the elements by their position.
Definition: ConstRefVector.h:754
OpenMS::ConstRefVector::begin
ConstIterator begin() const
See std::vector documentation.
Definition: ConstRefVector.h:431
OpenMS::ConstRefVector::ConstRefVectorIterator::pointer
ConstRefVectorConstIterator< ValueType >::value_type * pointer
Definition: ConstRefVector.h:245
OpenMS::ConstRefVector::const_iterator
ConstIterator const_iterator
Definition: ConstRefVector.h:369
OpenMS::ConstRefVector::rbegin
ReverseIterator rbegin()
See std::vector documentation.
Definition: ConstRefVector.h:443
OpenMS::ConstRefVector::ConstReverseIterator
std::reverse_iterator< ConstIterator > ConstReverseIterator
Definition: ConstRefVector.h:357
OpenMS::ConstRefVector::rend
ConstReverseIterator rend() const
See std::vector documentation.
Definition: ConstRefVector.h:461
OpenMS::reverseComparator
ReverseComparator< Cmp > reverseComparator(Cmp const &cmp)
Make-function to create a ReverseComparator from another comparator without the need to specify the t...
Definition: ComparatorUtils.h:260
OpenMS::ConstRefVector::ConstRefVectorConstIterator::ConstRefVectorConstIterator
ConstRefVectorConstIterator()
Definition: ConstRefVector.h:88
OpenMS::ConstRefVector::ConstRefVectorIterator::ValueType
ValueT ValueType
Definition: ConstRefVector.h:243
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::ConstRefVector::ConstRefVectorIterator::operator-
ConstRefVectorIterator operator-(typename ConstRefVectorIterator::difference_type n) const
Definition: ConstRefVector.h:305
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector(size_type n, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:644
OpenMS::ConstRefVector::ConstRefVectorIterator
Mutable iterator for the ConstRefVector.
Definition: ConstRefVector.h:236
OpenMS::ConstRefVector::operator[]
const_reference operator[](size_type n) const
See std::vector documentation.
Definition: ConstRefVector.h:505
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator*
reference operator*() const
Definition: ConstRefVector.h:217
OpenMS::ConstRefVector::ConstRefVectorIterator::operator--
ConstRefVectorIterator operator--(int)
Definition: ConstRefVector.h:298
OpenMS::ConstRefVector::insert
void insert(Iterator pos, InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:600
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator--
ConstRefVectorConstIterator operator--(int)
Definition: ConstRefVector.h:172
OpenMS::ConstRefVector::operator<=
bool operator<=(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:554
OpenMS::ConstRefVector::operator=
ConstRefVector & operator=(const ConstRefVector &rhs)
See std::vector documentation.
Definition: ConstRefVector.h:699
OpenMS::ConstRefVector::back
const_reference back() const
See std::vector documentation.
Definition: ConstRefVector.h:487
OpenMS::ConstRefVector::begin
Iterator begin()
See std::vector documentation.
Definition: ConstRefVector.h:419
OpenMS::ConstRefVector::erase
Iterator erase(Iterator pos)
See std::vector documentation.
Definition: ConstRefVector.h:613
OpenMS::ConstRefVector::operator<
bool operator<(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:542
OpenMS::ConstRefVector::empty
bool empty() const
See std::vector documentation.
Definition: ConstRefVector.h:499
OpenMS::ConstRefVector::ConstRefVectorIterator::operator--
ConstRefVectorIterator & operator--()
Definition: ConstRefVector.h:292
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator<=
bool operator<=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:133
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::ConstRefVector::swap
void swap(ConstRefVector &array)
See std::vector documentation.
Definition: ConstRefVector.h:566
OpenMS::ConstRefVector::ConstRefVectorIterator::operator+
friend ConstRefVectorIterator operator+(typename ConstRefVectorIterator::difference_type n, const ConstRefVectorIterator &i)
Definition: ConstRefVector.h:319
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator-=
ConstRefVectorConstIterator & operator-=(difference_type n)
Definition: ConstRefVector.h:199
OpenMS::ConstRefVector::resize
void resize(size_type new_size, const ValueType &t)
See std::vector documentation.
Definition: ConstRefVector.h:474
OpenMS::ConstRefVector::capacity
size_type capacity() const
See std::vector documentation.
Definition: ConstRefVector.h:395
OpenMS::ConstRefVector::pop_back
void pop_back()
See std::vector documentation.
Definition: ConstRefVector.h:383
OpenMS::ConstRefVector::ConstRefVectorConstIterator::ConstRefVectorConstIterator
ConstRefVectorConstIterator(typename std::vector< ValueType * > *vec, unsigned int position)
Definition: ConstRefVector.h:98
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator++
ConstRefVectorConstIterator & operator++()
Definition: ConstRefVector.h:153
OpenMS::ConstRefVector::ConstRefVectorIterator::operator-=
ConstRefVectorIterator & operator-=(typename ConstRefVectorIterator::difference_type n)
Definition: ConstRefVector.h:332
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator<
bool operator<(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:123
OpenMS::ConstRefVector::swap
friend void swap(ConstRefVector &a1, ConstRefVector &a2)
See std::vector documentation.
Definition: ConstRefVector.h:572
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector(size_type n)
See std::vector documentation.
Definition: ConstRefVector.h:636
OpenMS::ConstRefVector::reserve
void reserve(size_type n)
See std::vector documentation.
Definition: ConstRefVector.h:401
OpenMS::ConstRefVector::reverse_iterator
ReverseIterator reverse_iterator
Definition: ConstRefVector.h:370
OpenMS::ConstRefVector::ConstRefVectorIterator::operator+
ConstRefVectorIterator operator+(typename ConstRefVectorIterator::difference_type n) const
Definition: ConstRefVector.h:312
OpenMS::ConstRefVector::base_container_ptr_
const ContainerType * base_container_ptr_
Pointer to the base container.
Definition: ConstRefVector.h:791
OpenMS::ConstRefVector::ValueType
ContainerType::value_type ValueType
Definition: ConstRefVector.h:353
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector(InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:666
OpenMS::ConstRefVector::reference
ContainerType::reference reference
Definition: ConstRefVector.h:365
OpenMS::ConstRefVector::assign
void assign(size_type n, const ValueType &x)
See std::vector documentation.
Definition: ConstRefVector.h:725
OpenMS::ConstRefVector::ConstRefVectorConstIterator::reference
const typedef value_type & reference
Definition: ConstRefVector.h:84
OpenMS::ConstRefVector::ReverseIterator
std::reverse_iterator< Iterator > ReverseIterator
Definition: ConstRefVector.h:356
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator=
ConstRefVectorConstIterator & operator=(const ConstRefVectorConstIterator &rhs)
Definition: ConstRefVector.h:113
OpenMS::ConstRefVector::ConstRefVectorIterator::swap
friend void swap(ConstRefVectorIterator &i1, ConstRefVectorIterator &i2)
Definition: ConstRefVector.h:338
OpenMS::ConstRefVector::ConstRefVectorConstIterator::vector_
std::vector< ValueType * > * vector_
Definition: ConstRefVector.h:229
OpenMS::ConstRefVector::pointer
ContainerType::pointer pointer
Definition: ConstRefVector.h:367
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator+
ConstRefVectorConstIterator operator+(difference_type n) const
Definition: ConstRefVector.h:186
OpenMS::ConstRefVector::clear
void clear()
See std::vector documentation.
Definition: ConstRefVector.h:493
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator>
bool operator>(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:128
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator!=
bool operator!=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:148
OpenMS::ConstRefVector::ConstRefVectorIterator::ConstRefVectorIterator
ConstRefVectorIterator(const ConstRefVectorIterator< ValueType > &it)
Definition: ConstRefVector.h:260
OpenMS::ConstRefVector::ConstRefVectorIterator::operator++
ConstRefVectorIterator & operator++()
Definition: ConstRefVector.h:279
OpenMS::ConstRefVector::Iterator
ConstRefVectorIterator< const ValueType > Iterator
Definition: ConstRefVector.h:354
OpenMS::ConstRefVector::operator>=
bool operator>=(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:560
OpenMS::ConstRefVector::ConstRefVectorConstIterator::difference_type
std::vector< ValueType * >::difference_type difference_type
Definition: ConstRefVector.h:83
ComparatorUtils.h
OpenMS::ConstRefVector::ConstRefVectorIterator::operator->
pointer operator->() const
Definition: ConstRefVector.h:274
OpenMS::ConstRefVector::insert
Iterator insert(Iterator pos, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:578
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector()
See std::vector documentation.
Definition: ConstRefVector.h:629
OpenMS::ConstRefVector
This vector holds pointer to the elements of another container.
Definition: ConstRefVector.h:70
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator+
friend ConstRefVectorConstIterator operator+(difference_type n, const ConstRefVectorConstIterator &i)
Definition: ConstRefVector.h:210
OpenMS::ConstRefVector::ConstRefVectorConstIterator::value_type
ValueType value_type
Definition: ConstRefVector.h:82
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator-
ConstRefVectorConstIterator operator-(difference_type n) const
Definition: ConstRefVector.h:179
OpenMS::ConstRefVector::sortByIntensity
void sortByIntensity(bool reverse=false)
Sorting.
Definition: ConstRefVector.h:741
OpenMS::ConstRefVector::size
size_type size() const
See std::vector documentation.
Definition: ConstRefVector.h:389
OpenMS::ConstRefVector::vector_
std::vector< const ValueType * > vector_
the internal vector of ValueType pointers
Definition: ConstRefVector.h:787
OpenMS::ConstRefVector::operator==
bool operator==(const ConstRefVector &array) const
See std::vector documentation.
Definition: ConstRefVector.h:511
OpenMS::ConstRefVector::ConstRefVectorIterator::~ConstRefVectorIterator
~ConstRefVectorIterator()
Definition: ConstRefVector.h:265
OpenMS::ConstRefVector::resize
void resize(size_type new_size)
See std::vector documentation.
Definition: ConstRefVector.h:467
OpenMS::ConstRefVector::ConstRefVectorIterator::operator++
ConstRefVectorIterator operator++(int)
Definition: ConstRefVector.h:285
OpenMS::ConstRefVector::insert
void insert(Iterator pos, size_type n, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:586
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator--
ConstRefVectorConstIterator & operator--()
Definition: ConstRefVector.h:166
OpenMS::ConstRefVector::sortByComparator
void sortByComparator(ComparatorType const &comparator=ComparatorType())
Definition: ConstRefVector.h:775
OpenMS::ConstRefVector::ConstRefVectorConstIterator::ConstRefVectorConstIterator
ConstRefVectorConstIterator(const ConstRefVectorConstIterator &it)
Definition: ConstRefVector.h:104
OpenMS::ConstRefVector::iterator
Iterator iterator
Definition: ConstRefVector.h:368
OpenMS::ConstRefVector::front
const_reference front() const
See std::vector documentation.
Definition: ConstRefVector.h:481
OpenMS::ConstRefVector::ConstRefVectorConstIterator::iterator_category
std::random_access_iterator_tag iterator_category
Definition: ConstRefVector.h:86
OpenMS::ConstRefVector::operator>
bool operator>(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:548
OpenMS::ConstRefVector::~ConstRefVector
~ConstRefVector()
See std::vector documentation.
Definition: ConstRefVector.h:692
OpenMS::ConstRefVector::difference_type
ContainerType::difference_type difference_type
Definition: ConstRefVector.h:364
OpenMS::ConstRefVector::assign
void assign(InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:718
OpenMS::ConstRefVector::ConstIterator
ConstRefVectorConstIterator< const ValueType > ConstIterator
Definition: ConstRefVector.h:355
OpenMS::ConstRefVector::end
ConstIterator end() const
See std::vector documentation.
Definition: ConstRefVector.h:437
OpenMS::pointerComparator
PointerComparator< Cmp > pointerComparator(Cmp const &cmp)
Make-function to create a PointerComparator from another comparator without the need to specify the t...
Definition: ComparatorUtils.h:209
OpenMS::ConstRefVector::ConstRefVectorConstIterator
ConstIterator for the ConstRefVector.
Definition: ConstRefVector.h:76
OpenMS::ConstRefVector::erase
Iterator erase(Iterator first, Iterator last)
See std::vector documentation.
Definition: ConstRefVector.h:620
OpenMS::ConstRefVector::max_size
size_type max_size() const
See std::vector documentation.
Definition: ConstRefVector.h:413
OpenMS::ConstRefVector::ConstRefVectorIterator::operator*
reference operator*() const
Definition: ConstRefVector.h:269
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator+=
ConstRefVectorConstIterator & operator+=(difference_type n)
Definition: ConstRefVector.h:193
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector(ContainerType &p)
See std::vector documentation.
Definition: ConstRefVector.h:679
seqan::position
Size< TNeedle >::Type position(const PatternAuxData< TNeedle > &dh)
Definition: AhoCorasickAmbiguous.h:561
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator->
pointer operator->() const
Definition: ConstRefVector.h:222
OpenMS::ConstRefVector::push_back
void push_back(const ValueType &x)
See std::vector documentation.
Definition: ConstRefVector.h:376
OpenMS::ConstRefVector::operator!=
bool operator!=(const ConstRefVector &array) const
See std::vector documentation.
Definition: ConstRefVector.h:536
OpenMS::ConstRefVector::ContainerType
ContainerT ContainerType
Type definitions.
Definition: ConstRefVector.h:351
OpenMS::ConstRefVector::ConstRefVectorConstIterator::~ConstRefVectorConstIterator
~ConstRefVectorConstIterator()
Definition: ConstRefVector.h:110
OpenMS::ConstRefVector::capacity_
size_type capacity_
the current capacity
Definition: ConstRefVector.h:789
OpenMS::ConstRefVector::const_reference
ContainerType::const_reference const_reference
Definition: ConstRefVector.h:366
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator>=
bool operator>=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:138
OpenMS::ConstRefVector::rend
ReverseIterator rend()
See std::vector documentation.
Definition: ConstRefVector.h:449
OpenMS::ConstRefVector::ConstRefVectorIterator::reference
ConstRefVectorConstIterator< ValueType >::value_type & reference
Definition: ConstRefVector.h:244
OpenMS::ConstRefVector::value_type
ValueType value_type
STL-compliance type definitions.
Definition: ConstRefVector.h:362
OpenMS::ConstRefVector::ConstRefVectorConstIterator::pointer
const typedef value_type * pointer
Definition: ConstRefVector.h:85