| 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>
38 #include <OpenMS/KERNEL/ComparatorUtils.h>
39
40 #include <algorithm>
41 #include <typeinfo>
42 #include <vector>
43
44 namespace OpenMS
45 {
46
69 template <typename ContainerT>
70 class ConstRefVector
71 {
72 public:
73
75 template <class ValueT>
76 class ConstRefVectorConstIterator
77 {
78 friend class ConstRefVector;
79
80 public:
81 typedef ValueT ValueType;
82 typedef ValueType value_type;
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
88 ConstRefVectorConstIterator()
89 {
90 }
91
92 ConstRefVectorConstIterator(const typename std::vector<ValueType*>* vec, unsigned int position)
93 {
94 vector_ = (typename std::vector<ValueType*>*)vec;
95 position_ = position;
96 }
97
98 ConstRefVectorConstIterator(typename std::vector<ValueType*>* vec, unsigned int position)
99 {
100 vector_ = vec;
101 position_ = position;
102 }
103
104 ConstRefVectorConstIterator(const ConstRefVectorConstIterator& it)
105 {
106 vector_ = it.vector_;
107 position_ = it.position_;
108 }
109
110 ~ConstRefVectorConstIterator()
111 {}
112
113 ConstRefVectorConstIterator& operator=(const ConstRefVectorConstIterator& rhs)
114 {
115 if (this == &rhs) return *this;
116
117 vector_ = rhs.vector_;
118 position_ = rhs.position_;
119
120 return *this;
121 }
122
123 bool operator<(const ConstRefVectorConstIterator& it) const
124 {
125 return position_ < it.position_;
126 }
127
128 bool operator>(const ConstRefVectorConstIterator& it) const
129 {
130 return position_ > it.position_;
131 }
132
133 bool operator<=(const ConstRefVectorConstIterator& it) const
134 {
135 return position_ < it.position_ || position_ == it.position_;
136 }
137
138 bool operator>=(const ConstRefVectorConstIterator& it) const
139 {
140 return position_ > it.position_ || position_ == it.position_;
141 }
142
143 bool operator==(const ConstRefVectorConstIterator& it) const
144 {
145 return position_ == it.position_ && vector_ == it.vector_;
146 }
147
148 bool operator!=(const ConstRefVectorConstIterator& it) const
149 {
150 return position_ != it.position_ || vector_ != it.vector_;
151 }
152
153 ConstRefVectorConstIterator& operator++()
154 {
155 position_ += 1;
156 return *this;
157 }
158
159 ConstRefVectorConstIterator operator++(int)
160 {
161 ConstRefVectorConstIterator tmp(*this);
162 ++(*this);
163 return tmp;
164 }
165
166 ConstRefVectorConstIterator& operator--()
167 {
168 position_ -= 1;
169 return *this;
170 }
171
172 ConstRefVectorConstIterator operator--(int)
173 {
174 ConstRefVectorConstIterator tmp(*this);
175 --(*this);
176 return tmp;
177 }
178
179 ConstRefVectorConstIterator operator-(difference_type n) const
180 {
181 ConstRefVectorConstIterator tmp(*this);
182 tmp.position_ -= n;
183 return tmp;
184 }
185
186 ConstRefVectorConstIterator operator+(difference_type n) const
187 {
188 ConstRefVectorConstIterator tmp(*this);
189 tmp.position_ += n;
190 return tmp;
191 }
192
193 ConstRefVectorConstIterator& operator+=(difference_type n)
194 {
195 position_ += n;
196 return *this;
197 }
198
199 ConstRefVectorConstIterator& operator-=(difference_type n)
200 {
201 position_ -= n;
202 return *this;
203 }
204
205 friend difference_type operator-(const ConstRefVectorConstIterator& i1, const ConstRefVectorConstIterator& i2)
206 {
207 return i1.position_ - i2.position_;
208 }
209
210 friend ConstRefVectorConstIterator operator+(difference_type n, const ConstRefVectorConstIterator& i)
211 {
212 ConstRefVectorConstIterator tmp(i);
213 tmp.position_ += n;
214 return tmp;
215 }
216
217 reference operator*() const
218 {
219 return *((*vector_)[position_]);
220 }
221
222 pointer operator->() const
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>
236 class ConstRefVectorIterator :
237 public ConstRefVectorConstIterator<ValueT>
238 {
239 friend class ConstRefVector;
240
241 public:
242
243 typedef ValueT ValueType;
244 typedef typename ConstRefVectorConstIterator<ValueType>::value_type& reference;
245 typedef typename ConstRefVectorConstIterator<ValueType>::value_type* pointer;
246
247 using ConstRefVectorConstIterator<ValueType>::vector_;
248 using ConstRefVectorConstIterator<ValueType>::position_;
249
250
251 ConstRefVectorIterator()
252 {
253 }
254
255 ConstRefVectorIterator(typename std::vector<ValueType*>* vec, unsigned int position) :
256 ConstRefVectorConstIterator<ValueType>(vec, position)
257 {
258 }
259
260 ConstRefVectorIterator(const ConstRefVectorIterator<ValueType>& it) :
261 ConstRefVectorConstIterator<ValueType>(it)
262 {
263 }
264
265 ~ConstRefVectorIterator()
266 {
267 }
268
269 reference operator*() const
270 {
271 return *((*vector_)[position_]);
272 }
273
274 pointer operator->() const
275 {
276 return (*vector_)[position_];
277 }
278
279 ConstRefVectorIterator& operator++()
280 {
281 ConstRefVectorConstIterator<ValueType>::position_ += 1;
282 return *this;
283 }
284
285 ConstRefVectorIterator operator++(int)
286 {
287 ConstRefVectorIterator tmp(*this);
288 ++(*this);
289 return tmp;
290 }
291
292 ConstRefVectorIterator& operator--()
293 {
294 ConstRefVectorConstIterator<ValueType>::position_ -= 1;
295 return *this;
296 }
297
298 ConstRefVectorIterator operator--(int)
299 {
300 ConstRefVectorIterator tmp(*this);
301 --(*this);
302 return tmp;
303 }
304
305 ConstRefVectorIterator operator-(typename ConstRefVectorIterator::difference_type n) const
306 {
307 ConstRefVectorIterator tmp(*this);
308 tmp.position_ -= n;
309 return tmp;
310 }
311
312 ConstRefVectorIterator operator+(typename ConstRefVectorIterator::difference_type n) const
313 {
314 ConstRefVectorIterator tmp(*this);
315 tmp.position_ += n;
316 return tmp;
317 }
318
319 friend ConstRefVectorIterator operator+(typename ConstRefVectorIterator::difference_type n, const ConstRefVectorIterator& i)
320 {
321 ConstRefVectorIterator tmp(i);
322 tmp.position_ += n;
323 return tmp;
324 }
325
326 ConstRefVectorIterator& operator+=(typename ConstRefVectorIterator::difference_type n)
327 {
328 ConstRefVectorConstIterator<ValueType>::position_ += n;
329 return *this;
330 }
331
332 ConstRefVectorIterator& operator-=(typename ConstRefVectorIterator::difference_type n)
333 {
334 ConstRefVectorConstIterator<ValueType>::position_ -= n;
335 return *this;
336 }
337
338 friend void swap(ConstRefVectorIterator& i1, ConstRefVectorIterator& i2)
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;
354 typedef ConstRefVectorIterator<const ValueType> Iterator;
355 typedef ConstRefVectorConstIterator<const ValueType> ConstIterator;
356 typedef std::reverse_iterator<Iterator> ReverseIterator;
357 typedef std::reverse_iterator<ConstIterator> ConstReverseIterator;
359
361
362 typedef ValueType value_type;
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;
368 typedef Iterator iterator;
369 typedef ConstIterator const_iterator;
370 typedef ReverseIterator reverse_iterator;
371 typedef ConstReverseIterator const_reverse_iterator;
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
395 size_type capacity() const
396 {
397 return std::max(vector_.size(), capacity_);
398 }
399
401 void reserve(size_type n)
402 {
403 size_type cap = capacity();
404
405 if (n > cap)
406 {
407 vector_.reserve(n);
408 capacity_ = n;
409 }
410 }
411
413 size_type max_size() const
414 {
415 return vector_.max_size();
416 }
417
419 Iterator begin()
420 {
421 return Iterator((std::vector<const ValueType*>*) & vector_, (unsigned int)0);
422 }
423
425 Iterator end()
426 {
427 return Iterator((std::vector<const ValueType*>*) & vector_, (unsigned int)(vector_.size()));
428 }
429
431 ConstIterator begin() const
432 {
433 return ConstIterator((const std::vector<const ValueType*>*) & vector_, (unsigned int)0);
434 }
435
437 ConstIterator end() const
438 {
439 return ConstIterator((const std::vector<const ValueType*>*) & vector_, (unsigned int)(vector_.size()));
440 }
441
443 ReverseIterator rbegin()
444 {
445 return ReverseIterator(end());
446 }
447
449 ReverseIterator rend()
450 {
451 return ReverseIterator(begin());
452 }
453
455 ConstReverseIterator rbegin() const
456 {
457 return ConstReverseIterator(end());
458 }
459
461 ConstReverseIterator rend() const
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
481 const_reference front() const
482 {
483 return *(begin());
484 }
485
487 const_reference back() const
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
505 const_reference operator[](size_type n) const
506 {
507 return *(vector_[n]);
508 }
509
511 bool operator==(const ConstRefVector& array) const
512 {
513 if (base_container_ptr_ != array.base_container_ptr_)
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
613 Iterator erase(Iterator pos)
614 {
615 vector_.erase(vector_.begin() + pos.position_);
616 return pos;
617 }
618
620 Iterator erase(Iterator first, Iterator last)
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
636 ConstRefVector(size_type n) :
637 capacity_(0),
638 base_container_ptr_(0)
639 {
640 vector_ = std::vector<const ValueType*>(n);
641 }
642
644 ConstRefVector(size_type n, const ValueType& element) :
645 capacity_(0),
646 base_container_ptr_(0)
647 {
648 vector_ = std::vector<const ValueType*>(n, &element);
649 }
650
652 ConstRefVector(const ConstRefVector& p) :
653 capacity_(0),
654 base_container_ptr_(p.base_container_ptr_)
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
679 ConstRefVector(ContainerType& p) :
680 capacity_(0),
681 base_container_ptr_(&p)
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
692 ~ConstRefVector()
693 {
694 }
695
697
699 ConstRefVector& operator=(const ConstRefVector& rhs)
700 {
701 if (this == &rhs) return *this;
702
703 base_container_ptr_ = rhs.base_container_ptr_;
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
754 void sortByPosition()
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_;
789 size_type capacity_;
791 const ContainerType* base_container_ptr_;
792 };
793
794 } // namespace OpenMS
795
OpenMS::ConstRefVector::ConstRefVectorConstIterator::difference_type
std::vector< ValueType * >::difference_type difference_type
Definition: ConstRefVector.h:83
OpenMS::ConstRefVector::ConstRefVectorIterator::operator--
ConstRefVectorIterator & operator--()
Definition: ConstRefVector.h:292
OpenMS::ConstRefVector::ConstRefVectorConstIterator::ConstRefVectorConstIterator
ConstRefVectorConstIterator()
Definition: ConstRefVector.h:88
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector(size_type n, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:644
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator++
ConstRefVectorConstIterator & operator++()
Definition: ConstRefVector.h:153
OpenMS::ConstRefVector::ConstRefVectorIterator::ConstRefVectorIterator
ConstRefVectorIterator()
Definition: ConstRefVector.h:251
OpenMS::ConstRefVector::ConstRefVectorIterator::operator*
reference operator*() const
Definition: ConstRefVector.h:269
OpenMS::ConstRefVector::const_reverse_iterator
ConstReverseIterator const_reverse_iterator
Definition: ConstRefVector.h:371
OpenMS::ConstRefVector::erase
Iterator erase(Iterator first, Iterator last)
See std::vector documentation.
Definition: ConstRefVector.h:620
OpenMS::ConstRefVector::ConstRefVectorIterator::operator+
friend ConstRefVectorIterator operator+(typename ConstRefVectorIterator::difference_type n, const ConstRefVectorIterator &i)
Definition: ConstRefVector.h:319
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector(size_type n)
See std::vector documentation.
Definition: ConstRefVector.h:636
OpenMS::ConstRefVector::begin
Iterator begin()
See std::vector documentation.
Definition: ConstRefVector.h:419
OpenMS::ConstRefVector::ConstRefVectorConstIterator::value_type
ValueType value_type
Definition: ConstRefVector.h:82
OpenMS::ConstRefVector::operator<=
bool operator<=(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:554
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::capacity
size_type capacity() const
See std::vector documentation.
Definition: ConstRefVector.h:395
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::front
const_reference front() const
See std::vector documentation.
Definition: ConstRefVector.h:481
OpenMS::ConstRefVector::ConstRefVectorIterator::operator++
ConstRefVectorIterator & operator++()
Definition: ConstRefVector.h:279
OpenMS::ConstRefVector::ConstRefVectorIterator::operator++
ConstRefVectorIterator operator++(int)
Definition: ConstRefVector.h:285
OpenMS::ConstRefVector::resize
void resize(size_type new_size)
See std::vector documentation.
Definition: ConstRefVector.h:467
OpenMS::ConstRefVector::ConstRefVectorConstIterator::ConstRefVectorConstIterator
ConstRefVectorConstIterator(const typename std::vector< ValueType *> *vec, unsigned int position)
Definition: ConstRefVector.h:92
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator++
ConstRefVectorConstIterator operator++(int)
Definition: ConstRefVector.h:159
OpenMS::ConstRefVector::push_back
void push_back(const ValueType &x)
See std::vector documentation.
Definition: ConstRefVector.h:376
OpenMS::ConstRefVector::sortByIntensity
void sortByIntensity(bool reverse=false)
Sorting.
Definition: ConstRefVector.h:741
seqan::position
Size< TNeedle >::Type position(const PatternAuxData< TNeedle > &dh)
Definition: AhoCorasickAmbiguous.h:561
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator+
ConstRefVectorConstIterator operator+(difference_type n) const
Definition: ConstRefVector.h:186
OpenMS::ConstRefVector::ConstReverseIterator
std::reverse_iterator< ConstIterator > ConstReverseIterator
Definition: ConstRefVector.h:357
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator<
bool operator<(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:123
OpenMS::ConstRefVector::ConstRefVectorIterator::ValueType
ValueT ValueType
Definition: ConstRefVector.h:243
OpenMS::ConstRefVector::reverse_iterator
ReverseIterator reverse_iterator
Definition: ConstRefVector.h:370
OpenMS::ConstRefVector::ConstRefVectorConstIterator::iterator_category
std::random_access_iterator_tag iterator_category
Definition: ConstRefVector.h:86
OpenMS::ConstRefVector::empty
bool empty() const
See std::vector documentation.
Definition: ConstRefVector.h:499
OpenMS::ConstRefVector::operator[]
const_reference operator[](size_type n) const
See std::vector documentation.
Definition: ConstRefVector.h:505
OpenMS::ConstRefVector::~ConstRefVector
~ConstRefVector()
See std::vector documentation.
Definition: ConstRefVector.h:692
OpenMS::ConstRefVector::insert
Iterator insert(Iterator pos, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:578
OpenMS::ConstRefVector::back
const_reference back() const
See std::vector documentation.
Definition: ConstRefVector.h:487
OpenMS::ConstRefVector::difference_type
ContainerType::difference_type difference_type
Definition: ConstRefVector.h:364
OpenMS::ConstRefVector::base_container_ptr_
const ContainerType * base_container_ptr_
Pointer to the base container.
Definition: ConstRefVector.h:791
OpenMS::ConstRefVector::value_type
ValueType value_type
STL-compliance type definitions.
Definition: ConstRefVector.h:362
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator>=
bool operator>=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:138
OpenMS::ConstRefVector::rend
ConstReverseIterator rend() const
See std::vector documentation.
Definition: ConstRefVector.h:461
OpenMS::ConstRefVector::ConstIterator
ConstRefVectorConstIterator< const ValueType > ConstIterator
Definition: ConstRefVector.h:355
Types.h
OpenMS::ConstRefVector::ConstRefVectorIterator::operator->
pointer operator->() const
Definition: ConstRefVector.h:274
OpenMS::ConstRefVector::ValueType
ContainerType::value_type ValueType
Definition: ConstRefVector.h:353
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::operator*
reference operator*() const
Definition: ConstRefVector.h:217
OpenMS::ConstRefVector::sortByComparator
void sortByComparator(ComparatorType const &comparator=ComparatorType())
Definition: ConstRefVector.h:775
OpenMS::ConstRefVector::ReverseIterator
std::reverse_iterator< Iterator > ReverseIterator
Definition: ConstRefVector.h:356
OpenMS::ConstRefVector::ConstRefVectorIterator::operator-
ConstRefVectorIterator operator-(typename ConstRefVectorIterator::difference_type n) const
Definition: ConstRefVector.h:305
OpenMS::ConstRefVector::ConstRefVectorConstIterator::ConstRefVectorConstIterator
ConstRefVectorConstIterator(const ConstRefVectorConstIterator &it)
Definition: ConstRefVector.h:104
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator--
ConstRefVectorConstIterator & operator--()
Definition: ConstRefVector.h:166
OpenMS::ConstRefVector::reserve
void reserve(size_type n)
See std::vector documentation.
Definition: ConstRefVector.h:401
OpenMS::ConstRefVector::ConstRefVectorIterator::ConstRefVectorIterator
ConstRefVectorIterator(typename std::vector< ValueType *> *vec, unsigned int position)
Definition: ConstRefVector.h:255
OpenMS::ConstRefVector::ConstRefVectorIterator::~ConstRefVectorIterator
~ConstRefVectorIterator()
Definition: ConstRefVector.h:265
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator-
friend difference_type operator-(const ConstRefVectorConstIterator &i1, const ConstRefVectorConstIterator &i2)
Definition: ConstRefVector.h:205
OpenMS::ConstRefVector::ConstRefVectorIterator::swap
friend void swap(ConstRefVectorIterator &i1, ConstRefVectorIterator &i2)
Definition: ConstRefVector.h:338
OpenMS::ConstRefVector::operator!=
bool operator!=(const ConstRefVector &array) const
See std::vector documentation.
Definition: ConstRefVector.h:536
OpenMS::ConstRefVector::resize
void resize(size_type new_size, const ValueType &t)
See std::vector documentation.
Definition: ConstRefVector.h:474
OpenMS::ConstRefVector::ConstRefVectorConstIterator::reference
const value_type & reference
Definition: ConstRefVector.h:84
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector(InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:666
OpenMS::ConstRefVector::ConstRefVectorIterator::operator+
ConstRefVectorIterator operator+(typename ConstRefVectorIterator::difference_type n) const
Definition: ConstRefVector.h:312
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator=
ConstRefVectorConstIterator & operator=(const ConstRefVectorConstIterator &rhs)
Definition: ConstRefVector.h:113
OpenMS::ConstRefVector::capacity_
size_type capacity_
the current capacity
Definition: ConstRefVector.h:789
OpenMS::ConstRefVector::swap
friend void swap(ConstRefVector &a1, ConstRefVector &a2)
See std::vector documentation.
Definition: ConstRefVector.h:572
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator>
bool operator>(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:128
OpenMS::ConstRefVector::rend
ReverseIterator rend()
See std::vector documentation.
Definition: ConstRefVector.h:449
OpenMS::ConstRefVector::size
size_type size() const
See std::vector documentation.
Definition: ConstRefVector.h:389
OpenMS::ConstRefVector::reference
ContainerType::reference reference
Definition: ConstRefVector.h:365
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator-
ConstRefVectorConstIterator operator-(difference_type n) const
Definition: ConstRefVector.h:179
OpenMS::ConstRefVector::ConstRefVectorConstIterator::ConstRefVectorConstIterator
ConstRefVectorConstIterator(typename std::vector< ValueType *> *vec, unsigned int position)
Definition: ConstRefVector.h:98
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::ConstRefVector::ConstRefVectorConstIterator::vector_
std::vector< ValueType * > * vector_
Definition: ConstRefVector.h:229
OpenMS::ConstRefVector::max_size
size_type max_size() const
See std::vector documentation.
Definition: ConstRefVector.h:413
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:172
OpenMS::ConstRefVector::operator<
bool operator<(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:542
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator<=
bool operator<=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:133
OpenMS::ConstRefVector::sortByPosition
void sortByPosition()
Lexicographically sorts the elements by their position.
Definition: ConstRefVector.h:754
OpenMS::ConstRefVector
This vector holds pointer to the elements of another container.
Definition: ConstRefVector.h:70
OpenMS::ConstRefVector::ConstRefVectorConstIterator::pointer
const value_type * pointer
Definition: ConstRefVector.h:85
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator!=
bool operator!=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:148
OpenMS::ConstRefVector::iterator
Iterator iterator
Definition: ConstRefVector.h:368
OpenMS::ConstRefVector::ConstRefVectorConstIterator::~ConstRefVectorConstIterator
~ConstRefVectorConstIterator()
Definition: ConstRefVector.h:110
OpenMS::ConstRefVector::swap
void swap(ConstRefVector &array)
See std::vector documentation.
Definition: ConstRefVector.h:566
OpenMS::ConstRefVector::end
Iterator end()
See std::vector documentation.
Definition: ConstRefVector.h:425
OpenMS::ConstRefVector::const_reference
ContainerType::const_reference const_reference
Definition: ConstRefVector.h:366
OpenMS::ConstRefVector::ConstRefVectorIterator::ConstRefVectorIterator
ConstRefVectorIterator(const ConstRefVectorIterator< ValueType > &it)
Definition: ConstRefVector.h:260
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator+
friend ConstRefVectorConstIterator operator+(difference_type n, const ConstRefVectorConstIterator &i)
Definition: ConstRefVector.h:210
OpenMS::ConstRefVector::operator>=
bool operator>=(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:560
OpenMS::ConstRefVector::assign
void assign(InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:718
OpenMS::ConstRefVector::pointer
ContainerType::pointer pointer
Definition: ConstRefVector.h:367
OpenMS::ConstRefVector::ConstRefVectorIterator
Mutable iterator for the ConstRefVector.
Definition: ConstRefVector.h:236
ComparatorUtils.h
OpenMS::ConstRefVector::ConstRefVectorConstIterator::position_
unsigned int position_
Definition: ConstRefVector.h:230
OpenMS::ConstRefVector::insert
void insert(Iterator pos, size_type n, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:586
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector(const ConstRefVector &p)
See std::vector documentation.
Definition: ConstRefVector.h:652
OpenMS::ConstRefVector::size_type
ContainerType::size_type size_type
Definition: ConstRefVector.h:363
OpenMS::ConstRefVector::ConstRefVectorIterator::reference
ConstRefVectorConstIterator< ValueType >::value_type & reference
Definition: ConstRefVector.h:244
OpenMS::ConstRefVector::assign
void assign(size_type n, const ValueType &x)
See std::vector documentation.
Definition: ConstRefVector.h:725
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:548
OpenMS::ConstRefVector::Iterator
ConstRefVectorIterator< const ValueType > Iterator
Definition: ConstRefVector.h:354
OpenMS::ConstRefVector::ConstRefVectorIterator::pointer
ConstRefVectorConstIterator< ValueType >::value_type * pointer
Definition: ConstRefVector.h:245
OpenMS::ConstRefVector::pop_back
void pop_back()
See std::vector documentation.
Definition: ConstRefVector.h:383
OpenMS::ConstRefVector::begin
ConstIterator begin() const
See std::vector documentation.
Definition: ConstRefVector.h:431
OpenMS::ConstRefVector::operator=
ConstRefVector & operator=(const ConstRefVector &rhs)
See std::vector documentation.
Definition: ConstRefVector.h:699
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector()
See std::vector documentation.
Definition: ConstRefVector.h:629
OpenMS::ConstRefVector::operator==
bool operator==(const ConstRefVector &array) const
See std::vector documentation.
Definition: ConstRefVector.h:511
OpenMS::ConstRefVector::insert
void insert(Iterator pos, InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:600
OpenMS::ConstRefVector::ConstRefVectorConstIterator
ConstIterator for the ConstRefVector.
Definition: ConstRefVector.h:76
OpenMS::ConstRefVector::ContainerType
ContainerT ContainerType
Type definitions.
Definition: ConstRefVector.h:351
OpenMS::ConstRefVector::const_iterator
ConstIterator const_iterator
Definition: ConstRefVector.h:369
OpenMS::ConstRefVector::ConstRefVector
ConstRefVector(ContainerType &p)
See std::vector documentation.
Definition: ConstRefVector.h:679
OpenMS::ConstRefVector::ConstRefVectorConstIterator::ValueType
ValueT ValueType
Definition: ConstRefVector.h:81
OpenMS::ConstRefVector::ConstRefVectorIterator::operator-=
ConstRefVectorIterator & operator-=(typename ConstRefVectorIterator::difference_type n)
Definition: ConstRefVector.h:332
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator+=
ConstRefVectorConstIterator & operator+=(difference_type n)
Definition: ConstRefVector.h:193
OpenMS::ConstRefVector::end
ConstIterator end() const
See std::vector documentation.
Definition: ConstRefVector.h:437
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator-=
ConstRefVectorConstIterator & operator-=(difference_type n)
Definition: ConstRefVector.h:199
OpenMS::ConstRefVector::clear
void clear()
See std::vector documentation.
Definition: ConstRefVector.h:493
OpenMS::ConstRefVector::ConstRefVectorConstIterator::operator->
pointer operator->() const
Definition: ConstRefVector.h:222
OpenMS::ConstRefVector::ConstRefVectorIterator::operator--
ConstRefVectorIterator operator--(int)
Definition: ConstRefVector.h:298
OpenMS::ConstRefVector::rbegin
ReverseIterator rbegin()
See std::vector documentation.
Definition: ConstRefVector.h:443
OpenMS::ConstRefVector::vector_
std::vector< const ValueType * > vector_
the internal vector of ValueType pointers
Definition: ConstRefVector.h:787