Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
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-2017.
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 #ifndef OPENMS_DATASTRUCTURES_CONSTREFVECTOR_H
36 #define OPENMS_DATASTRUCTURES_CONSTREFVECTOR_H
37 
38 #include <OpenMS/CONCEPT/Types.h>
40 
41 #include <algorithm>
42 #include <typeinfo>
43 #include <vector>
44 
45 namespace OpenMS
46 {
47 
70  template <typename ContainerT>
72  {
73 public:
74 
76  template <class ValueT>
78  {
79  friend class ConstRefVector;
80 
81 public:
82  typedef ValueT ValueType;
83  typedef ValueType value_type;
84  typedef typename std::vector<ValueType*>::difference_type difference_type;
85  typedef const value_type& reference;
86  typedef const value_type* pointer;
87  typedef std::random_access_iterator_tag iterator_category;
88 
90  {
91  }
92 
93  ConstRefVectorConstIterator(const typename std::vector<ValueType*>* vec, unsigned int position)
94  {
95  vector_ = (typename std::vector<ValueType*>*)vec;
96  position_ = position;
97  }
98 
99  ConstRefVectorConstIterator(typename std::vector<ValueType*>* vec, unsigned int position)
100  {
101  vector_ = vec;
102  position_ = position;
103  }
104 
106  {
107  vector_ = it.vector_;
108  position_ = it.position_;
109  }
110 
112  {}
113 
115  {
116  if (this == &rhs) return *this;
117 
118  vector_ = rhs.vector_;
119  position_ = rhs.position_;
120 
121  return *this;
122  }
123 
125  {
126  return position_ < it.position_;
127  }
128 
130  {
131  return position_ > it.position_;
132  }
133 
135  {
136  return position_ < it.position_ || position_ == it.position_;
137  }
138 
140  {
141  return position_ > it.position_ || position_ == it.position_;
142  }
143 
145  {
146  return position_ == it.position_ && vector_ == it.vector_;
147  }
148 
150  {
151  return position_ != it.position_ || vector_ != it.vector_;
152  }
153 
155  {
156  position_ += 1;
157  return *this;
158  }
159 
161  {
162  ConstRefVectorConstIterator tmp(*this);
163  ++(*this);
164  return tmp;
165  }
166 
168  {
169  position_ -= 1;
170  return *this;
171  }
172 
174  {
175  ConstRefVectorConstIterator tmp(*this);
176  --(*this);
177  return tmp;
178  }
179 
180  ConstRefVectorConstIterator operator-(difference_type n) const
181  {
182  ConstRefVectorConstIterator tmp(*this);
183  tmp.position_ -= n;
184  return tmp;
185  }
186 
187  ConstRefVectorConstIterator operator+(difference_type n) const
188  {
189  ConstRefVectorConstIterator tmp(*this);
190  tmp.position_ += n;
191  return tmp;
192  }
193 
195  {
196  position_ += n;
197  return *this;
198  }
199 
201  {
202  position_ -= n;
203  return *this;
204  }
205 
206  friend difference_type operator-(const ConstRefVectorConstIterator& i1, const ConstRefVectorConstIterator& i2)
207  {
208  return i1.position_ - i2.position_;
209  }
210 
212  {
214  tmp.position_ += n;
215  return tmp;
216  }
217 
218  reference operator*()
219  {
220  return *((*vector_)[position_]);
221  }
222 
223  pointer operator->()
224  {
225  return (*vector_)[position_];
226  }
227 
228  pointer operator->() const
229  {
230  return (*vector_)[position_];
231  }
232 
233 protected:
234 
235  typename std::vector<ValueType*>* vector_;
236  unsigned int position_;
237  };
238 
239 
241  template <class ValueT>
243  public ConstRefVectorConstIterator<ValueT>
244  {
245  friend class ConstRefVector;
246 
247 public:
248 
249  typedef ValueT ValueType;
252 
255 
256 
258  {
259  }
260 
261  ConstRefVectorIterator(typename std::vector<ValueType*>* vec, unsigned int position) :
262  ConstRefVectorConstIterator<ValueType>(vec, position)
263  {
264  }
265 
267  ConstRefVectorConstIterator<ValueType>(it)
268  {
269  }
270 
272  {
273  }
274 
275  reference operator*()
276  {
277  return *((*vector_)[position_]);
278  }
279 
280  pointer operator->()
281  {
282  return (*vector_)[position_];
283  }
284 
285  pointer operator->() const
286  {
287  return (*vector_)[position_];
288  }
289 
291  {
293  return *this;
294  }
295 
297  {
298  ConstRefVectorIterator tmp(*this);
299  ++(*this);
300  return tmp;
301  }
302 
304  {
306  return *this;
307  }
308 
310  {
311  ConstRefVectorIterator tmp(*this);
312  --(*this);
313  return tmp;
314  }
315 
317  {
318  ConstRefVectorIterator tmp(*this);
319  tmp.position_ -= n;
320  return tmp;
321  }
322 
324  {
325  ConstRefVectorIterator tmp(*this);
326  tmp.position_ += n;
327  return tmp;
328  }
329 
331  {
332  ConstRefVectorIterator tmp(i);
333  tmp.position_ += n;
334  return tmp;
335  }
336 
338  {
340  return *this;
341  }
342 
344  {
346  return *this;
347  }
348 
350  {
351  unsigned int tmp = i1.position_;
352  i1.position_ = i2.position_;
353  i2.position_ = tmp;
354  }
355 
356  };
357 
358 
360 
361  typedef ContainerT ContainerType;
364  typedef typename ContainerType::value_type ValueType;
367  typedef std::reverse_iterator<Iterator> ReverseIterator;
368  typedef std::reverse_iterator<ConstIterator> ConstReverseIterator;
370 
372 
373  typedef ValueType value_type;
374  typedef typename ContainerType::size_type size_type;
375  typedef typename ContainerType::difference_type difference_type;
376  typedef typename ContainerType::reference reference;
377  typedef typename ContainerType::const_reference const_reference;
378  typedef typename ContainerType::pointer pointer;
379  typedef Iterator iterator;
380  typedef ConstIterator const_iterator;
381  typedef ReverseIterator reverse_iterator;
382  typedef ConstReverseIterator const_reverse_iterator;
384 
385 
387  void push_back(const ValueType& x)
388  {
389  const ValueType* element = &x;
390  vector_.push_back(element);
391  }
392 
394  void pop_back()
395  {
396  vector_.pop_back();
397  }
398 
400  size_type size() const
401  {
402  return vector_.size();
403  }
404 
406  size_type capacity() const
407  {
408  return std::max(vector_.size(), capacity_);
409  }
410 
412  void reserve(size_type n)
413  {
414  size_type cap = capacity();
415 
416  if (n > cap)
417  {
418  vector_.reserve(n);
419  capacity_ = n;
420  }
421  }
422 
424  size_type max_size() const
425  {
426  return vector_.max_size();
427  }
428 
430  Iterator begin()
431  {
432  return Iterator((std::vector<const ValueType*>*) & vector_, (unsigned int)0);
433  }
434 
436  Iterator end()
437  {
438  return Iterator((std::vector<const ValueType*>*) & vector_, (unsigned int)(vector_.size()));
439  }
440 
442  ConstIterator begin() const
443  {
444  return ConstIterator((const std::vector<const ValueType*>*) & vector_, (unsigned int)0);
445  }
446 
448  ConstIterator end() const
449  {
450  return ConstIterator((const std::vector<const ValueType*>*) & vector_, (unsigned int)(vector_.size()));
451  }
452 
454  ReverseIterator rbegin()
455  {
456  return ReverseIterator(end());
457  }
458 
460  ReverseIterator rend()
461  {
462  return ReverseIterator(begin());
463  }
464 
466  ConstReverseIterator rbegin() const
467  {
468  return ConstReverseIterator(end());
469  }
470 
472  ConstReverseIterator rend() const
473  {
474  return ConstReverseIterator(begin());
475  }
476 
478  void resize(size_type new_size)
479  {
480  vector_.resize(new_size);
481  capacity_ = vector_.capacity();
482  }
483 
485  void resize(size_type new_size, const ValueType& t)
486  {
487  vector_.resize(new_size, &t);
488  capacity_ = vector_.capacity();
489  }
490 
492  const_reference front() const
493  {
494  return *(begin());
495  }
496 
498  const_reference back() const
499  {
500  return *(end() - 1);
501  }
502 
504  void clear()
505  {
506  vector_.clear();
507  }
508 
510  bool empty() const
511  {
512  return vector_.empty();
513  }
514 
516  const_reference operator[](size_type n) const
517  {
518  return *(vector_[n]);
519  }
520 
522  bool operator==(const ConstRefVector& array) const
523  {
525  {
526  return false;
527  }
528  if (size() != array.size())
529  {
530  return false;
531  }
532  for (Size i = 0; i < size(); i++)
533  {
534  if (typeid(*(vector_[i])) != typeid(*(array.vector_[i])))
535  {
536  return false;
537  }
538  if (vector_[i]->operator!=(* array.vector_[i]))
539  {
540  return false;
541  }
542  }
543  return true;
544  }
545 
547  bool operator!=(const ConstRefVector& array) const
548  {
549  return !(operator==(array));
550  }
551 
553  bool operator<(const ConstRefVector& array) const
554  {
555  return size() < array.size();
556  }
557 
559  bool operator>(const ConstRefVector& array) const
560  {
561  return size() > array.size();
562  }
563 
565  bool operator<=(const ConstRefVector& array) const
566  {
567  return operator<(array) || operator==(array);
568  }
569 
571  bool operator>=(const ConstRefVector& array) const
572  {
573  return operator>(array) || operator==(array);
574  }
575 
577  void swap(ConstRefVector& array)
578  {
579  vector_.swap(array.vector_);
580  }
581 
583  friend void swap(ConstRefVector& a1, ConstRefVector& a2)
584  {
585  a1.vector_.swap(a2.vector_);
586  }
587 
589  Iterator insert(Iterator pos, const ValueType& element)
590  {
591  const ValueType* pointer = &element;
592  vector_.insert(vector_.begin() + pos.position_, pointer);
593  return pos;
594  }
595 
597  void insert(Iterator pos, size_type n, const ValueType& element)
598  {
599  const ValueType* pointer;
600  std::vector<const ValueType*> tmp;
601  for (size_type i = 0; i < n; i++)
602  {
603  pointer = &element;
604  tmp.push_back(pointer);
605  }
606  vector_.insert(vector_.begin() + pos.position_, tmp.begin(), tmp.end());
607  }
608 
610  template <class InputIterator>
611  void insert(Iterator pos, InputIterator f, InputIterator l)
612  {
613  const ValueType* pointer;
614  std::vector<const ValueType*> tmp;
615  for (InputIterator it = f; it != l; ++it)
616  {
617  pointer = &(*it);
618  tmp.push_back(pointer);
619  }
620  vector_.insert(vector_.begin() + pos.position_, tmp.begin(), tmp.end());
621  }
622 
624  Iterator erase(Iterator pos)
625  {
626  vector_.erase(vector_.begin() + pos.position_);
627  return pos;
628  }
629 
631  Iterator erase(Iterator first, Iterator last)
632  {
633  vector_.erase(vector_.begin() + first.position_, vector_.begin() + last.position_);
634  return first;
635  }
636 
638 
639  ConstRefVector() :
641  capacity_(0),
643  {
644  }
645 
647  ConstRefVector(size_type n) :
648  capacity_(0),
650  {
651  vector_ = std::vector<const ValueType*>(n);
652  }
653 
655  ConstRefVector(size_type n, const ValueType& element) :
656  capacity_(0),
658  {
659  vector_ = std::vector<const ValueType*>(n, &element);
660  }
661 
664  capacity_(0),
666  {
667  const ValueType* element;
668  for (ConstIterator it = p.begin(); it != p.end(); ++it)
669  {
670  element = &(*it);
671  vector_.push_back(element);
672  }
673  }
674 
676  template <class InputIterator>
677  ConstRefVector(InputIterator f, InputIterator l) :
678  capacity_(0),
680  {
681  const ValueType* pointer;
682  for (InputIterator it = f; it != l; ++it)
683  {
684  pointer = &(*it);
685  vector_.push_back(pointer);
686  }
687  }
688 
690  ConstRefVector(ContainerType& p) :
691  capacity_(0),
693  {
694  const ValueType* element;
695  for (typename ContainerType::iterator it = p.begin(); it != p.end(); ++it)
696  {
697  element = &(*it);
698  vector_.push_back(element);
699  }
700  }
701 
704  {
705  }
706 
708 
711  {
712  if (this == &rhs) return *this;
713 
715  clear();
716  reserve(rhs.size());
717  const ValueType* element;
718  for (ConstIterator it = rhs.begin(); it != rhs.end(); ++it)
719  {
720  element = &(*it);
721  vector_.push_back(element);
722  }
723 
724  return *this;
725  }
726 
728  template <class InputIterator>
729  void assign(InputIterator f, InputIterator l)
730  {
731  clear();
732  insert(end(), f, l);
733  }
734 
736  void assign(size_type n, const ValueType& x)
737  {
738  clear();
739  insert(end(), n, x);
740  }
741 
750 
752  void sortByIntensity(bool reverse = false)
753  {
754  if (reverse)
755  {
756  std::sort(vector_.begin(), vector_.end(), reverseComparator(pointerComparator(typename ValueType::IntensityLess())));
757  }
758  else
759  {
760  std::sort(vector_.begin(), vector_.end(), pointerComparator(typename ValueType::IntensityLess()));
761  }
762  }
763 
766  {
767  std::sort(vector_.begin(), vector_.end(), pointerComparator(typename ValueType::PositionLess()));
768  }
769 
771 
785  template <typename ComparatorType>
786  void sortByComparator(ComparatorType const& comparator = ComparatorType())
787  {
788  std::sort(vector_.begin(), vector_.end(), pointerComparator(comparator));
789  }
790 
792 
793  //----------------------------------------------------------------------
794 
795 protected:
796 
798  std::vector<const ValueType*> vector_;
800  size_type capacity_;
802  const ContainerType* base_container_ptr_;
803  };
804 
805 } // namespace OpenMS
806 
807 #endif // OPENMS_DATASTRUCTURES_CONSTREFVECTOR_H
ConstRefVectorIterator(const ConstRefVectorIterator< ValueType > &it)
Definition: ConstRefVector.h:266
ConstRefVectorConstIterator< ValueType >::value_type & reference
Definition: ConstRefVector.h:250
ContainerT ContainerType
Type definitions.
Definition: ConstRefVector.h:362
std::vector< ValueType * > * vector_
Definition: ConstRefVector.h:235
bool operator<=(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:565
Iterator iterator
Definition: ConstRefVector.h:379
~ConstRefVector()
See std::vector documentation.
Definition: ConstRefVector.h:703
ContainerType::pointer pointer
Definition: ConstRefVector.h:378
pointer operator->() const
Definition: ConstRefVector.h:285
ConstRefVectorIterator()
Definition: ConstRefVector.h:257
ValueT ValueType
Definition: ConstRefVector.h:249
ConstRefVectorConstIterator operator-(difference_type n) const
Definition: ConstRefVector.h:180
ConstRefVector & operator=(const ConstRefVector &rhs)
See std::vector documentation.
Definition: ConstRefVector.h:710
Iterator insert(Iterator pos, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:589
void resize(size_type new_size, const ValueType &t)
See std::vector documentation.
Definition: ConstRefVector.h:485
pointer operator->()
Definition: ConstRefVector.h:223
ConstRefVectorConstIterator< ValueType >::value_type * pointer
Definition: ConstRefVector.h:251
ConstRefVectorConstIterator operator++(int)
Definition: ConstRefVector.h:160
Iterator erase(Iterator pos)
See std::vector documentation.
Definition: ConstRefVector.h:624
~ConstRefVectorConstIterator()
Definition: ConstRefVector.h:111
friend difference_type operator-(const ConstRefVectorConstIterator &i1, const ConstRefVectorConstIterator &i2)
Definition: ConstRefVector.h:206
ConstRefVector(size_type n, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:655
ConstRefVectorConstIterator(const typename std::vector< ValueType *> *vec, unsigned int position)
Definition: ConstRefVector.h:93
ContainerType::size_type size_type
Definition: ConstRefVector.h:374
Iterator begin()
See std::vector documentation.
Definition: ConstRefVector.h:430
bool operator<(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:553
void sortByIntensity(bool reverse=false)
Sorting.
Definition: ConstRefVector.h:752
ConstRefVectorConstIterator & operator-=(difference_type n)
Definition: ConstRefVector.h:200
bool operator>=(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:571
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:261
pointer operator->() const
Definition: ConstRefVector.h:228
ConstRefVector(const ConstRefVector &p)
See std::vector documentation.
Definition: ConstRefVector.h:663
ConstRefVectorConstIterator(typename std::vector< ValueType *> *vec, unsigned int position)
Definition: ConstRefVector.h:99
ConstRefVectorConstIterator & operator+=(difference_type n)
Definition: ConstRefVector.h:194
ConstRefVectorIterator< const ValueType > Iterator
Definition: ConstRefVector.h:365
ConstRefVectorIterator & operator++()
Definition: ConstRefVector.h:290
std::vector< const ValueType * > vector_
the internal vector of ValueType pointers
Definition: ConstRefVector.h:798
ValueT ValueType
Definition: ConstRefVector.h:82
friend void swap(ConstRefVector &a1, ConstRefVector &a2)
See std::vector documentation.
Definition: ConstRefVector.h:583
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
ConstReverseIterator rend() const
See std::vector documentation.
Definition: ConstRefVector.h:472
bool operator>(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:559
ConstIterator for the ConstRefVector.
Definition: ConstRefVector.h:77
size_type max_size() const
See std::vector documentation.
Definition: ConstRefVector.h:424
ConstRefVectorIterator & operator+=(typename ConstRefVectorIterator::difference_type n)
Definition: ConstRefVector.h:337
ConstRefVectorIterator & operator-=(typename ConstRefVectorIterator::difference_type n)
Definition: ConstRefVector.h:343
ConstRefVectorConstIterator & operator=(const ConstRefVectorConstIterator &rhs)
Definition: ConstRefVector.h:114
ConstRefVectorIterator & operator--()
Definition: ConstRefVector.h:303
void assign(InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:729
pointer operator->()
Definition: ConstRefVector.h:280
ReverseIterator rbegin()
See std::vector documentation.
Definition: ConstRefVector.h:454
void assign(size_type n, const ValueType &x)
See std::vector documentation.
Definition: ConstRefVector.h:736
const value_type & reference
Definition: ConstRefVector.h:85
ConstRefVectorConstIterator(const ConstRefVectorConstIterator &it)
Definition: ConstRefVector.h:105
friend void swap(ConstRefVectorIterator &i1, ConstRefVectorIterator &i2)
Definition: ConstRefVector.h:349
ConstRefVectorIterator operator-(typename ConstRefVectorIterator::difference_type n) const
Definition: ConstRefVector.h:316
ConstIterator end() const
See std::vector documentation.
Definition: ConstRefVector.h:448
bool operator!=(const ConstRefVector &array) const
See std::vector documentation.
Definition: ConstRefVector.h:547
ValueType value_type
STL-compliance type definitions.
Definition: ConstRefVector.h:373
bool empty() const
See std::vector documentation.
Definition: ConstRefVector.h:510
const_reference operator[](size_type n) const
See std::vector documentation.
Definition: ConstRefVector.h:516
ValueType value_type
Definition: ConstRefVector.h:83
ConstRefVectorConstIterator operator+(difference_type n) const
Definition: ConstRefVector.h:187
ContainerType::reference reference
Definition: ConstRefVector.h:376
const_reference back() const
See std::vector documentation.
Definition: ConstRefVector.h:498
ConstRefVectorConstIterator operator--(int)
Definition: ConstRefVector.h:173
void swap(ConstRefVector &array)
See std::vector documentation.
Definition: ConstRefVector.h:577
void clear()
See std::vector documentation.
Definition: ConstRefVector.h:504
ContainerType::difference_type difference_type
Definition: ConstRefVector.h:375
std::vector< ValueType * >::difference_type difference_type
Definition: ConstRefVector.h:84
reference operator*()
Definition: ConstRefVector.h:218
bool operator>=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:139
void pop_back()
See std::vector documentation.
Definition: ConstRefVector.h:394
ConstRefVectorConstIterator()
Definition: ConstRefVector.h:89
std::reverse_iterator< ConstIterator > ConstReverseIterator
Definition: ConstRefVector.h:368
ConstRefVector(InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:677
ConstRefVector(size_type n)
See std::vector documentation.
Definition: ConstRefVector.h:647
Mutable iterator for the ConstRefVector.
Definition: ConstRefVector.h:242
void push_back(const ValueType &x)
See std::vector documentation.
Definition: ConstRefVector.h:387
bool operator==(const ConstRefVector &array) const
See std::vector documentation.
Definition: ConstRefVector.h:522
void insert(Iterator pos, size_type n, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:597
void resize(size_type new_size)
See std::vector documentation.
Definition: ConstRefVector.h:478
friend ConstRefVectorConstIterator operator+(difference_type n, const ConstRefVectorConstIterator &i)
Definition: ConstRefVector.h:211
ContainerType::value_type ValueType
Definition: ConstRefVector.h:364
size_type capacity_
the current capacity
Definition: ConstRefVector.h:800
ConstRefVectorConstIterator & operator--()
Definition: ConstRefVector.h:167
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:210
const ContainerType * base_container_ptr_
Pointer to the base container.
Definition: ConstRefVector.h:802
Iterator erase(Iterator first, Iterator last)
See std::vector documentation.
Definition: ConstRefVector.h:631
bool operator>(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:129
ConstRefVectorIterator(typename std::vector< ValueType *> *vec, unsigned int position)
Definition: ConstRefVector.h:261
ContainerType::const_reference const_reference
Definition: ConstRefVector.h:377
ConstRefVectorIterator operator++(int)
Definition: ConstRefVector.h:296
bool operator!=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:149
const_reference front() const
See std::vector documentation.
Definition: ConstRefVector.h:492
std::reverse_iterator< Iterator > ReverseIterator
Definition: ConstRefVector.h:367
ConstRefVectorConstIterator< const ValueType > ConstIterator
Definition: ConstRefVector.h:366
const value_type * pointer
Definition: ConstRefVector.h:86
void sortByComparator(ComparatorType const &comparator=ComparatorType())
Definition: ConstRefVector.h:786
ReverseIterator reverse_iterator
Definition: ConstRefVector.h:381
ConstRefVectorIterator operator--(int)
Definition: ConstRefVector.h:309
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
ConstRefVector(ContainerType &p)
See std::vector documentation.
Definition: ConstRefVector.h:690
std::random_access_iterator_tag iterator_category
Definition: ConstRefVector.h:87
ReverseIterator rend()
See std::vector documentation.
Definition: ConstRefVector.h:460
ConstIterator const_iterator
Definition: ConstRefVector.h:380
This vector holds pointer to the elements of another container.
Definition: ConstRefVector.h:71
~ConstRefVectorIterator()
Definition: ConstRefVector.h:271
reference operator*()
Definition: ConstRefVector.h:275
size_type size() const
See std::vector documentation.
Definition: ConstRefVector.h:400
bool operator<=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:134
void sortByPosition()
Lexicographically sorts the elements by their position.
Definition: ConstRefVector.h:765
friend ConstRefVectorIterator operator+(typename ConstRefVectorIterator::difference_type n, const ConstRefVectorIterator &i)
Definition: ConstRefVector.h:330
unsigned int position_
Definition: ConstRefVector.h:236
bool operator<(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:124
ConstRefVectorIterator operator+(typename ConstRefVectorIterator::difference_type n) const
Definition: ConstRefVector.h:323
ConstIterator begin() const
See std::vector documentation.
Definition: ConstRefVector.h:442
Iterator end()
See std::vector documentation.
Definition: ConstRefVector.h:436
ConstRefVectorConstIterator & operator++()
Definition: ConstRefVector.h:154
ConstReverseIterator const_reverse_iterator
Definition: ConstRefVector.h:382
size_type capacity() const
See std::vector documentation.
Definition: ConstRefVector.h:406
ConstReverseIterator rbegin() const
See std::vector documentation.
Definition: ConstRefVector.h:466
void insert(Iterator pos, InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:611
bool operator==(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:144
friend class ConstRefVector
Definition: ConstRefVector.h:79
void reserve(size_type n)
See std::vector documentation.
Definition: ConstRefVector.h:412

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:21:59 using doxygen 1.8.13