OpenMS  2.4.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-2018.
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 
228  {
229  return (*vector_)[position_];
230  }
231 
232 protected:
233 
234  typename std::vector<ValueType*>* vector_;
235  unsigned int position_;
236  };
237 
238 
240  template <class ValueT>
242  public ConstRefVectorConstIterator<ValueT>
243  {
244  friend class ConstRefVector;
245 
246 public:
247 
248  typedef ValueT ValueType;
251 
254 
255 
257  {
258  }
259 
260  ConstRefVectorIterator(typename std::vector<ValueType*>* vec, unsigned int position) :
262  {
263  }
264 
267  {
268  }
269 
271  {
272  }
273 
275  {
276  return *((*vector_)[position_]);
277  }
278 
280  {
281  return (*vector_)[position_];
282  }
283 
285  {
286  return (*vector_)[position_];
287  }
288 
290  {
292  return *this;
293  }
294 
296  {
297  ConstRefVectorIterator tmp(*this);
298  ++(*this);
299  return tmp;
300  }
301 
303  {
305  return *this;
306  }
307 
309  {
310  ConstRefVectorIterator tmp(*this);
311  --(*this);
312  return tmp;
313  }
314 
316  {
317  ConstRefVectorIterator tmp(*this);
318  tmp.position_ -= n;
319  return tmp;
320  }
321 
323  {
324  ConstRefVectorIterator tmp(*this);
325  tmp.position_ += n;
326  return tmp;
327  }
328 
330  {
331  ConstRefVectorIterator tmp(i);
332  tmp.position_ += n;
333  return tmp;
334  }
335 
337  {
339  return *this;
340  }
341 
343  {
345  return *this;
346  }
347 
349  {
350  unsigned int tmp = i1.position_;
351  i1.position_ = i2.position_;
352  i2.position_ = tmp;
353  }
354 
355  };
356 
357 
359 
360  typedef ContainerT ContainerType;
363  typedef typename ContainerType::value_type ValueType;
366  typedef std::reverse_iterator<Iterator> ReverseIterator;
367  typedef std::reverse_iterator<ConstIterator> ConstReverseIterator;
369 
371 
373  typedef typename ContainerType::size_type size_type;
374  typedef typename ContainerType::difference_type difference_type;
375  typedef typename ContainerType::reference reference;
376  typedef typename ContainerType::const_reference const_reference;
377  typedef typename ContainerType::pointer pointer;
383 
384 
386  void push_back(const ValueType& x)
387  {
388  const ValueType* element = &x;
389  vector_.push_back(element);
390  }
391 
393  void pop_back()
394  {
395  vector_.pop_back();
396  }
397 
399  size_type size() const
400  {
401  return vector_.size();
402  }
403 
406  {
407  return std::max(vector_.size(), capacity_);
408  }
409 
412  {
413  size_type cap = capacity();
414 
415  if (n > cap)
416  {
417  vector_.reserve(n);
418  capacity_ = n;
419  }
420  }
421 
424  {
425  return vector_.max_size();
426  }
427 
430  {
431  return Iterator((std::vector<const ValueType*>*) & vector_, (unsigned int)0);
432  }
433 
436  {
437  return Iterator((std::vector<const ValueType*>*) & vector_, (unsigned int)(vector_.size()));
438  }
439 
442  {
443  return ConstIterator((const std::vector<const ValueType*>*) & vector_, (unsigned int)0);
444  }
445 
448  {
449  return ConstIterator((const std::vector<const ValueType*>*) & vector_, (unsigned int)(vector_.size()));
450  }
451 
454  {
455  return ReverseIterator(end());
456  }
457 
460  {
461  return ReverseIterator(begin());
462  }
463 
466  {
467  return ConstReverseIterator(end());
468  }
469 
472  {
473  return ConstReverseIterator(begin());
474  }
475 
477  void resize(size_type new_size)
478  {
479  vector_.resize(new_size);
480  capacity_ = vector_.capacity();
481  }
482 
484  void resize(size_type new_size, const ValueType& t)
485  {
486  vector_.resize(new_size, &t);
487  capacity_ = vector_.capacity();
488  }
489 
492  {
493  return *(begin());
494  }
495 
498  {
499  return *(end() - 1);
500  }
501 
503  void clear()
504  {
505  vector_.clear();
506  }
507 
509  bool empty() const
510  {
511  return vector_.empty();
512  }
513 
516  {
517  return *(vector_[n]);
518  }
519 
521  bool operator==(const ConstRefVector& array) const
522  {
524  {
525  return false;
526  }
527  if (size() != array.size())
528  {
529  return false;
530  }
531  for (Size i = 0; i < size(); i++)
532  {
533  if (typeid(*(vector_[i])) != typeid(*(array.vector_[i])))
534  {
535  return false;
536  }
537  if (vector_[i]->operator!=(* array.vector_[i]))
538  {
539  return false;
540  }
541  }
542  return true;
543  }
544 
546  bool operator!=(const ConstRefVector& array) const
547  {
548  return !(operator==(array));
549  }
550 
552  bool operator<(const ConstRefVector& array) const
553  {
554  return size() < array.size();
555  }
556 
558  bool operator>(const ConstRefVector& array) const
559  {
560  return size() > array.size();
561  }
562 
564  bool operator<=(const ConstRefVector& array) const
565  {
566  return operator<(array) || operator==(array);
567  }
568 
570  bool operator>=(const ConstRefVector& array) const
571  {
572  return operator>(array) || operator==(array);
573  }
574 
576  void swap(ConstRefVector& array)
577  {
578  vector_.swap(array.vector_);
579  }
580 
582  friend void swap(ConstRefVector& a1, ConstRefVector& a2)
583  {
584  a1.vector_.swap(a2.vector_);
585  }
586 
588  Iterator insert(Iterator pos, const ValueType& element)
589  {
590  const ValueType* pointer = &element;
591  vector_.insert(vector_.begin() + pos.position_, pointer);
592  return pos;
593  }
594 
596  void insert(Iterator pos, size_type n, const ValueType& element)
597  {
598  const ValueType* pointer;
599  std::vector<const ValueType*> tmp;
600  for (size_type i = 0; i < n; i++)
601  {
602  pointer = &element;
603  tmp.push_back(pointer);
604  }
605  vector_.insert(vector_.begin() + pos.position_, tmp.begin(), tmp.end());
606  }
607 
609  template <class InputIterator>
610  void insert(Iterator pos, InputIterator f, InputIterator l)
611  {
612  const ValueType* pointer;
613  std::vector<const ValueType*> tmp;
614  for (InputIterator it = f; it != l; ++it)
615  {
616  pointer = &(*it);
617  tmp.push_back(pointer);
618  }
619  vector_.insert(vector_.begin() + pos.position_, tmp.begin(), tmp.end());
620  }
621 
624  {
625  vector_.erase(vector_.begin() + pos.position_);
626  return pos;
627  }
628 
631  {
632  vector_.erase(vector_.begin() + first.position_, vector_.begin() + last.position_);
633  return first;
634  }
635 
637 
638  ConstRefVector() :
640  capacity_(0),
641  base_container_ptr_(nullptr)
642  {
643  }
644 
647  capacity_(0),
649  {
650  vector_ = std::vector<const ValueType*>(n);
651  }
652 
654  ConstRefVector(size_type n, const ValueType& element) :
655  capacity_(0),
657  {
658  vector_ = std::vector<const ValueType*>(n, &element);
659  }
660 
663  capacity_(0),
665  {
666  const ValueType* element;
667  for (ConstIterator it = p.begin(); it != p.end(); ++it)
668  {
669  element = &(*it);
670  vector_.push_back(element);
671  }
672  }
673 
675  template <class InputIterator>
676  ConstRefVector(InputIterator f, InputIterator l) :
677  capacity_(0),
678  base_container_ptr_(nullptr)
679  {
680  const ValueType* pointer;
681  for (InputIterator it = f; it != l; ++it)
682  {
683  pointer = &(*it);
684  vector_.push_back(pointer);
685  }
686  }
687 
690  capacity_(0),
692  {
693  const ValueType* element;
694  for (typename ContainerType::iterator it = p.begin(); it != p.end(); ++it)
695  {
696  element = &(*it);
697  vector_.push_back(element);
698  }
699  }
700 
703  {
704  }
705 
707 
710  {
711  if (this == &rhs) return *this;
712 
714  clear();
715  reserve(rhs.size());
716  const ValueType* element;
717  for (ConstIterator it = rhs.begin(); it != rhs.end(); ++it)
718  {
719  element = &(*it);
720  vector_.push_back(element);
721  }
722 
723  return *this;
724  }
725 
727  template <class InputIterator>
728  void assign(InputIterator f, InputIterator l)
729  {
730  clear();
731  insert(end(), f, l);
732  }
733 
735  void assign(size_type n, const ValueType& x)
736  {
737  clear();
738  insert(end(), n, x);
739  }
740 
749 
751  void sortByIntensity(bool reverse = false)
752  {
753  if (reverse)
754  {
755  std::sort(vector_.begin(), vector_.end(), reverseComparator(pointerComparator(typename ValueType::IntensityLess())));
756  }
757  else
758  {
759  std::sort(vector_.begin(), vector_.end(), pointerComparator(typename ValueType::IntensityLess()));
760  }
761  }
762 
765  {
766  std::sort(vector_.begin(), vector_.end(), pointerComparator(typename ValueType::PositionLess()));
767  }
768 
770 
784  template <typename ComparatorType>
785  void sortByComparator(ComparatorType const& comparator = ComparatorType())
786  {
787  std::sort(vector_.begin(), vector_.end(), pointerComparator(comparator));
788  }
789 
791 
792  //----------------------------------------------------------------------
793 
794 protected:
795 
797  std::vector<const ValueType*> vector_;
802  };
803 
804 } // namespace OpenMS
805 
ConstRefVectorIterator(const ConstRefVectorIterator< ValueType > &it)
Definition: ConstRefVector.h:265
ConstRefVectorConstIterator< ValueType >::value_type & reference
Definition: ConstRefVector.h:249
ContainerT ContainerType
Type definitions.
Definition: ConstRefVector.h:361
std::vector< ValueType * > * vector_
Definition: ConstRefVector.h:234
bool operator<=(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:564
Iterator iterator
Definition: ConstRefVector.h:378
~ConstRefVector()
See std::vector documentation.
Definition: ConstRefVector.h:702
ContainerType::pointer pointer
Definition: ConstRefVector.h:377
pointer operator->() const
Definition: ConstRefVector.h:284
ConstRefVectorIterator()
Definition: ConstRefVector.h:256
ValueT ValueType
Definition: ConstRefVector.h:248
ConstRefVectorConstIterator operator-(difference_type n) const
Definition: ConstRefVector.h:179
Size< TNeedle >::Type position(const PatternAuxData< TNeedle > &dh)
Definition: AhoCorasickAmbiguous.h:561
ConstRefVector & operator=(const ConstRefVector &rhs)
See std::vector documentation.
Definition: ConstRefVector.h:709
Iterator insert(Iterator pos, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:588
void resize(size_type new_size, const ValueType &t)
See std::vector documentation.
Definition: ConstRefVector.h:484
pointer operator->()
Definition: ConstRefVector.h:222
ConstRefVectorConstIterator< ValueType >::value_type * pointer
Definition: ConstRefVector.h:250
ConstRefVectorConstIterator operator++(int)
Definition: ConstRefVector.h:159
Iterator erase(Iterator pos)
See std::vector documentation.
Definition: ConstRefVector.h:623
~ConstRefVectorConstIterator()
Definition: ConstRefVector.h:110
friend difference_type operator-(const ConstRefVectorConstIterator &i1, const ConstRefVectorConstIterator &i2)
Definition: ConstRefVector.h:205
ConstRefVector(size_type n, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:654
ConstRefVectorConstIterator(const typename std::vector< ValueType *> *vec, unsigned int position)
Definition: ConstRefVector.h:92
ContainerType::size_type size_type
Definition: ConstRefVector.h:373
Iterator begin()
See std::vector documentation.
Definition: ConstRefVector.h:429
bool operator<(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:552
void sortByIntensity(bool reverse=false)
Sorting.
Definition: ConstRefVector.h:751
ConstRefVectorConstIterator & operator-=(difference_type n)
Definition: ConstRefVector.h:199
bool operator>=(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:570
ConstRefVector()
See std::vector documentation.
Definition: ConstRefVector.h:639
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
pointer operator->() const
Definition: ConstRefVector.h:227
ConstRefVector(const ConstRefVector &p)
See std::vector documentation.
Definition: ConstRefVector.h:662
ConstRefVectorConstIterator(typename std::vector< ValueType *> *vec, unsigned int position)
Definition: ConstRefVector.h:98
ConstRefVectorConstIterator & operator+=(difference_type n)
Definition: ConstRefVector.h:193
ConstRefVectorIterator< const ValueType > Iterator
Definition: ConstRefVector.h:364
ConstRefVectorIterator & operator++()
Definition: ConstRefVector.h:289
std::vector< const ValueType * > vector_
the internal vector of ValueType pointers
Definition: ConstRefVector.h:797
ValueT ValueType
Definition: ConstRefVector.h:81
friend void swap(ConstRefVector &a1, ConstRefVector &a2)
See std::vector documentation.
Definition: ConstRefVector.h:582
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
ConstReverseIterator rend() const
See std::vector documentation.
Definition: ConstRefVector.h:471
bool operator>(const ConstRefVector &array) const
Comparison of container sizes.
Definition: ConstRefVector.h:558
ConstIterator for the ConstRefVector.
Definition: ConstRefVector.h:76
size_type max_size() const
See std::vector documentation.
Definition: ConstRefVector.h:423
ConstRefVectorIterator & operator+=(typename ConstRefVectorIterator::difference_type n)
Definition: ConstRefVector.h:336
ConstRefVectorIterator & operator-=(typename ConstRefVectorIterator::difference_type n)
Definition: ConstRefVector.h:342
ConstRefVectorConstIterator & operator=(const ConstRefVectorConstIterator &rhs)
Definition: ConstRefVector.h:113
ConstRefVectorIterator & operator--()
Definition: ConstRefVector.h:302
void assign(InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:728
pointer operator->()
Definition: ConstRefVector.h:279
ReverseIterator rbegin()
See std::vector documentation.
Definition: ConstRefVector.h:453
void assign(size_type n, const ValueType &x)
See std::vector documentation.
Definition: ConstRefVector.h:735
const value_type & reference
Definition: ConstRefVector.h:84
ConstRefVectorConstIterator(const ConstRefVectorConstIterator &it)
Definition: ConstRefVector.h:104
friend void swap(ConstRefVectorIterator &i1, ConstRefVectorIterator &i2)
Definition: ConstRefVector.h:348
ConstRefVectorIterator operator-(typename ConstRefVectorIterator::difference_type n) const
Definition: ConstRefVector.h:315
ConstIterator end() const
See std::vector documentation.
Definition: ConstRefVector.h:447
bool operator!=(const ConstRefVector &array) const
See std::vector documentation.
Definition: ConstRefVector.h:546
ValueType value_type
STL-compliance type definitions.
Definition: ConstRefVector.h:372
bool empty() const
See std::vector documentation.
Definition: ConstRefVector.h:509
const_reference operator[](size_type n) const
See std::vector documentation.
Definition: ConstRefVector.h:515
ValueType value_type
Definition: ConstRefVector.h:82
ConstRefVectorConstIterator operator+(difference_type n) const
Definition: ConstRefVector.h:186
ContainerType::reference reference
Definition: ConstRefVector.h:375
const_reference back() const
See std::vector documentation.
Definition: ConstRefVector.h:497
ConstRefVectorConstIterator operator--(int)
Definition: ConstRefVector.h:172
void swap(ConstRefVector &array)
See std::vector documentation.
Definition: ConstRefVector.h:576
void clear()
See std::vector documentation.
Definition: ConstRefVector.h:503
ContainerType::difference_type difference_type
Definition: ConstRefVector.h:374
std::vector< ValueType * >::difference_type difference_type
Definition: ConstRefVector.h:83
reference operator*()
Definition: ConstRefVector.h:217
bool operator>=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:138
void pop_back()
See std::vector documentation.
Definition: ConstRefVector.h:393
ConstRefVectorConstIterator()
Definition: ConstRefVector.h:88
std::reverse_iterator< ConstIterator > ConstReverseIterator
Definition: ConstRefVector.h:367
ConstRefVector(InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:676
ConstRefVector(size_type n)
See std::vector documentation.
Definition: ConstRefVector.h:646
Mutable iterator for the ConstRefVector.
Definition: ConstRefVector.h:241
void push_back(const ValueType &x)
See std::vector documentation.
Definition: ConstRefVector.h:386
bool operator==(const ConstRefVector &array) const
See std::vector documentation.
Definition: ConstRefVector.h:521
void insert(Iterator pos, size_type n, const ValueType &element)
See std::vector documentation.
Definition: ConstRefVector.h:596
void resize(size_type new_size)
See std::vector documentation.
Definition: ConstRefVector.h:477
friend ConstRefVectorConstIterator operator+(difference_type n, const ConstRefVectorConstIterator &i)
Definition: ConstRefVector.h:210
ContainerType::value_type ValueType
Definition: ConstRefVector.h:363
size_type capacity_
the current capacity
Definition: ConstRefVector.h:799
ConstRefVectorConstIterator & operator--()
Definition: ConstRefVector.h:166
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
const ContainerType * base_container_ptr_
Pointer to the base container.
Definition: ConstRefVector.h:801
Iterator erase(Iterator first, Iterator last)
See std::vector documentation.
Definition: ConstRefVector.h:630
bool operator>(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:128
ConstRefVectorIterator(typename std::vector< ValueType *> *vec, unsigned int position)
Definition: ConstRefVector.h:260
ContainerType::const_reference const_reference
Definition: ConstRefVector.h:376
ConstRefVectorIterator operator++(int)
Definition: ConstRefVector.h:295
bool operator!=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:148
const_reference front() const
See std::vector documentation.
Definition: ConstRefVector.h:491
std::reverse_iterator< Iterator > ReverseIterator
Definition: ConstRefVector.h:366
ConstRefVectorConstIterator< const ValueType > ConstIterator
Definition: ConstRefVector.h:365
const value_type * pointer
Definition: ConstRefVector.h:85
void sortByComparator(ComparatorType const &comparator=ComparatorType())
Definition: ConstRefVector.h:785
ReverseIterator reverse_iterator
Definition: ConstRefVector.h:380
ConstRefVectorIterator operator--(int)
Definition: ConstRefVector.h:308
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
ConstRefVector(ContainerType &p)
See std::vector documentation.
Definition: ConstRefVector.h:689
std::random_access_iterator_tag iterator_category
Definition: ConstRefVector.h:86
ReverseIterator rend()
See std::vector documentation.
Definition: ConstRefVector.h:459
ConstIterator const_iterator
Definition: ConstRefVector.h:379
This vector holds pointer to the elements of another container.
Definition: ConstRefVector.h:70
~ConstRefVectorIterator()
Definition: ConstRefVector.h:270
reference operator*()
Definition: ConstRefVector.h:274
size_type size() const
See std::vector documentation.
Definition: ConstRefVector.h:399
bool operator<=(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:133
void sortByPosition()
Lexicographically sorts the elements by their position.
Definition: ConstRefVector.h:764
friend ConstRefVectorIterator operator+(typename ConstRefVectorIterator::difference_type n, const ConstRefVectorIterator &i)
Definition: ConstRefVector.h:329
unsigned int position_
Definition: ConstRefVector.h:235
bool operator<(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:123
ConstRefVectorIterator operator+(typename ConstRefVectorIterator::difference_type n) const
Definition: ConstRefVector.h:322
ConstIterator begin() const
See std::vector documentation.
Definition: ConstRefVector.h:441
Iterator end()
See std::vector documentation.
Definition: ConstRefVector.h:435
ConstRefVectorConstIterator & operator++()
Definition: ConstRefVector.h:153
ConstReverseIterator const_reverse_iterator
Definition: ConstRefVector.h:381
size_type capacity() const
See std::vector documentation.
Definition: ConstRefVector.h:405
ConstReverseIterator rbegin() const
See std::vector documentation.
Definition: ConstRefVector.h:465
void insert(Iterator pos, InputIterator f, InputIterator l)
See std::vector documentation.
Definition: ConstRefVector.h:610
bool operator==(const ConstRefVectorConstIterator &it) const
Definition: ConstRefVector.h:143
void reserve(size_type n)
See std::vector documentation.
Definition: ConstRefVector.h:411