#include <OpenMS/KERNEL/DPeakConstReferenceArray.h>
If you for example want to sort the elements of a constant container, you have to copy the whole container. To avoid copy actions this class only holds pointer to the constant elements of a container. It behaves like a PeakArray. You can insert new elements, but it is not possible to change existing ones. (E.g. generating a DPeakConstReferenceArray pointer_array of a FeatureMap feature_map is done by: pointer_array(feature_map.begin(),feature_map.end()))
Public Types | |
Type definitions | |
enum | { DIMENSION = PeakType::DIMENSION } |
typedef MapT | BaseMapType |
typedef BaseMapType::value_type | PeakType |
typedef DPeakConstReferenceArrayIterator < const PeakType > | Iterator |
typedef DPeakConstReferenceArrayConstIterator < const PeakType > | ConstIterator |
typedef std::reverse_iterator < Iterator > | ReverseIterator |
typedef std::reverse_iterator < ConstIterator > | ConstReverseIterator |
typedef std::vector< PeakType > ::value_type | value_type |
typedef std::vector< PeakType > ::size_type | size_type |
typedef std::vector< PeakType > ::difference_type | difference_type |
typedef std::vector< PeakType > ::reference | reference |
typedef std::vector< PeakType > ::const_reference | const_reference |
typedef std::vector< PeakType > ::pointer | pointer |
typedef Iterator | iterator |
typedef ConstIterator | const_iterator |
typedef ReverseIterator | reverse_iterator |
typedef ConstReverseIterator | const_reverse_iterator |
Public Member Functions | |
void | push_back (const PeakType &x) |
See std::vector documentation. | |
void | pop_back () |
See std::vector documentation. | |
size_type | size () const |
See std::vector documentation. | |
size_type | capacity () const |
See std::vector documentation. | |
void | reserve (size_type n) |
See std::vector documentation. | |
size_type | max_size () const |
See std::vector documentation. | |
Iterator | begin () |
See std::vector documentation. | |
Iterator | end () |
See std::vector documentation. | |
ConstIterator | begin () const |
See std::vector documentation. | |
ConstIterator | end () const |
See std::vector documentation. | |
ReverseIterator | rbegin () |
See std::vector documentation. | |
ReverseIterator | rend () |
See std::vector documentation. | |
ConstReverseIterator | rbegin () const |
See std::vector documentation. | |
ConstReverseIterator | rend () const |
See std::vector documentation. | |
void | resize (size_type new_size) |
See std::vector documentation. | |
void | resize (size_type new_size, const PeakType &t) |
See std::vector documentation. | |
const_reference | front () const |
See std::vector documentation. | |
const_reference | back () const |
See std::vector documentation. | |
void | clear () |
See std::vector documentation. | |
bool | empty () const |
See std::vector documentation. | |
const_reference | operator[] (size_type n) const |
See std::vector documentation. | |
bool | operator== (const DPeakConstReferenceArray &array) const |
See std::vector documentation. | |
bool | operator!= (const DPeakConstReferenceArray &array) const |
See std::vector documentation. | |
bool | operator< (const DPeakConstReferenceArray &array) const |
Comparison of container sizes. | |
bool | operator> (const DPeakConstReferenceArray &array) const |
Comparison of container sizes. | |
bool | operator<= (const DPeakConstReferenceArray &array) const |
Comparison of container sizes. | |
bool | operator>= (const DPeakConstReferenceArray &array) const |
Comparison of container sizes. | |
void | swap (DPeakConstReferenceArray &array) |
See std::vector documentation. | |
Iterator | insert (Iterator pos, const PeakType &element) |
See std::vector documentation. | |
void | insert (Iterator pos, size_type n, const PeakType &element) |
See std::vector documentation. | |
template<class InputIterator> | |
void | insert (Iterator pos, InputIterator f, InputIterator l) |
See std::vector documentation. | |
Iterator | erase (Iterator pos) |
See std::vector documentation. | |
Iterator | erase (Iterator first, Iterator last) |
See std::vector documentation. | |
DPeakConstReferenceArray & | operator= (const DPeakConstReferenceArray &rhs) |
See std::vector documentation. | |
template<class InputIterator> | |
void | assign (InputIterator f, InputIterator l) |
See std::vector documentation. | |
void | assign (size_type n, const PeakType &x) |
See std::vector documentation. | |
Accesssor methods | |
void | setBaseContainer (const BaseMapType &base_map) |
Set base container. | |
void | setBaseContainerPointer (const BaseMapType *base_map_pointer) |
Set pointer to the base container. | |
const BaseMapType * | getBaseContainerPointer () const |
Get pointer to the base container. | |
const BaseMapType & | getBaseContainer () const |
Get reference to the base container. | |
Constructors and Destructor | |
DPeakConstReferenceArray () | |
See std::vector documentation. | |
DPeakConstReferenceArray (size_type n) | |
See std::vector documentation. | |
DPeakConstReferenceArray (size_type n, const PeakType &element) | |
See std::vector documentation. | |
DPeakConstReferenceArray (const DPeakConstReferenceArray &p) | |
See std::vector documentation. | |
template<class InputIterator> | |
DPeakConstReferenceArray (InputIterator f, InputIterator l) | |
See std::vector documentation. | |
DPeakConstReferenceArray (BaseMapType &p) | |
~DPeakConstReferenceArray () | |
See std::vector documentation. | |
void | sortByIntensity () |
Sorting. | |
void | sortByPosition () |
Lexicographically sorts the elements by their position. | |
void | sortByNthPosition (UInt i) throw (Exception::NotImplemented) |
Sorts the elements by one dimension of their position. | |
Generic sorting function templates. | |
Any element comparator can be given as template argument. You can also give the comparator as an argument to the function template (this is useful if the comparator is not default constructed, but keep in mind that STL copies comparators a lot).
Thus your can e.g. write | |
template<typename ComparatorType> | |
void | sortByComparator (ComparatorType const &comparator) |
template<typename ComparatorType> | |
void | sortByComparator () |
Protected Attributes | |
std::vector< const PeakType * > | vector_ |
the internal vector of PeakType pointers | |
size_type | capacity_ |
the current capacity | |
const BaseMapType * | base_container_ptr_ |
Pointer to the base container. | |
Friends | |
void | swap (DPeakConstReferenceArray &a1, DPeakConstReferenceArray &a2) |
See std::vector documentation. | |
Classes | |
class | DPeakConstReferenceArrayConstIterator |
ConstIterator for the DPeakConstReferenceArray. More... | |
class | DPeakConstReferenceArrayIterator |
Mutable iterator for the DPeakConstReferenceArray. More... |
typedef MapT BaseMapType |
typedef BaseMapType::value_type PeakType |
typedef DPeakConstReferenceArrayIterator<const PeakType> Iterator |
typedef DPeakConstReferenceArrayConstIterator<const PeakType> ConstIterator |
typedef std::reverse_iterator<Iterator> ReverseIterator |
typedef std::reverse_iterator<ConstIterator> ConstReverseIterator |
typedef std::vector<PeakType>::value_type value_type |
typedef std::vector<PeakType>::difference_type difference_type |
typedef std::vector<PeakType>::const_reference const_reference |
typedef ConstIterator const_iterator |
typedef ReverseIterator reverse_iterator |
DPeakConstReferenceArray | ( | ) | [inline] |
See std::vector documentation.
DPeakConstReferenceArray | ( | size_type | n | ) | [inline] |
See std::vector documentation.
DPeakConstReferenceArray | ( | size_type | n, | |
const PeakType & | element | |||
) | [inline] |
See std::vector documentation.
DPeakConstReferenceArray | ( | const DPeakConstReferenceArray< MapT > & | p | ) | [inline] |
See std::vector documentation.
DPeakConstReferenceArray | ( | InputIterator | f, | |
InputIterator | l | |||
) | [inline] |
See std::vector documentation.
DPeakConstReferenceArray | ( | BaseMapType & | p | ) | [inline] |
~DPeakConstReferenceArray | ( | ) | [inline] |
See std::vector documentation.
void push_back | ( | const PeakType & | x | ) | [inline] |
See std::vector documentation.
void pop_back | ( | ) | [inline] |
See std::vector documentation.
size_type size | ( | ) | const [inline] |
See std::vector documentation.
size_type capacity | ( | ) | const [inline] |
See std::vector documentation.
void reserve | ( | size_type | n | ) | [inline] |
See std::vector documentation.
size_type max_size | ( | ) | const [inline] |
See std::vector documentation.
Iterator begin | ( | ) | [inline] |
See std::vector documentation.
Iterator end | ( | ) | [inline] |
See std::vector documentation.
ConstIterator begin | ( | ) | const [inline] |
See std::vector documentation.
ConstIterator end | ( | ) | const [inline] |
See std::vector documentation.
ReverseIterator rbegin | ( | ) | [inline] |
See std::vector documentation.
ReverseIterator rend | ( | ) | [inline] |
See std::vector documentation.
ConstReverseIterator rbegin | ( | ) | const [inline] |
See std::vector documentation.
ConstReverseIterator rend | ( | ) | const [inline] |
See std::vector documentation.
void resize | ( | size_type | new_size | ) | [inline] |
See std::vector documentation.
const_reference front | ( | ) | const [inline] |
See std::vector documentation.
const_reference back | ( | ) | const [inline] |
See std::vector documentation.
void clear | ( | ) | [inline] |
See std::vector documentation.
bool empty | ( | ) | const [inline] |
See std::vector documentation.
const_reference operator[] | ( | size_type | n | ) | const [inline] |
See std::vector documentation.
bool operator== | ( | const DPeakConstReferenceArray< MapT > & | array | ) | const [inline] |
See std::vector documentation.
bool operator!= | ( | const DPeakConstReferenceArray< MapT > & | array | ) | const [inline] |
See std::vector documentation.
bool operator< | ( | const DPeakConstReferenceArray< MapT > & | array | ) | const [inline] |
Comparison of container sizes.
bool operator> | ( | const DPeakConstReferenceArray< MapT > & | array | ) | const [inline] |
Comparison of container sizes.
bool operator<= | ( | const DPeakConstReferenceArray< MapT > & | array | ) | const [inline] |
Comparison of container sizes.
bool operator>= | ( | const DPeakConstReferenceArray< MapT > & | array | ) | const [inline] |
Comparison of container sizes.
void swap | ( | DPeakConstReferenceArray< MapT > & | array | ) | [inline] |
See std::vector documentation.
See std::vector documentation.
void insert | ( | Iterator | pos, | |
InputIterator | f, | |||
InputIterator | l | |||
) | [inline] |
See std::vector documentation.
void setBaseContainer | ( | const BaseMapType & | base_map | ) | [inline] |
Set base container.
void setBaseContainerPointer | ( | const BaseMapType * | base_map_pointer | ) | [inline] |
Set pointer to the base container.
const BaseMapType* getBaseContainerPointer | ( | ) | const [inline] |
Get pointer to the base container.
const BaseMapType& getBaseContainer | ( | ) | const [inline] |
Get reference to the base container.
DPeakConstReferenceArray& operator= | ( | const DPeakConstReferenceArray< MapT > & | rhs | ) | [inline] |
See std::vector documentation.
void assign | ( | InputIterator | f, | |
InputIterator | l | |||
) | [inline] |
See std::vector documentation.
void sortByIntensity | ( | ) | [inline] |
Sorting.
These simplified sorting methods are supported in addition to the standard sorting methods of std::vector. Sorts the elements by intensity
void sortByPosition | ( | ) | [inline] |
Lexicographically sorts the elements by their position.
void sortByNthPosition | ( | UInt | i | ) | throw (Exception::NotImplemented) [inline] |
Sorts the elements by one dimension of their position.
It is only sorted according to dimentsion i
.
void sortByComparator | ( | ComparatorType const & | comparator | ) | [inline] |
void sortByComparator | ( | ) | [inline] |
void swap | ( | DPeakConstReferenceArray< MapT > & | a1, | |
DPeakConstReferenceArray< MapT > & | a2 | |||
) | [friend] |
See std::vector documentation.
const BaseMapType* base_container_ptr_ [protected] |
Pointer to the base container.
Generated Tue Apr 1 15:36:45 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |