OpenMS
RangeManagerContainer< RangeBases > Class Template Referenceabstract

#include <OpenMS/KERNEL/RangeManager.h>

Inheritance diagram for RangeManagerContainer< RangeBases >:
[legend]
Collaboration diagram for RangeManagerContainer< RangeBases >:
[legend]

Public Types

using ThisRangeType = typename RangeManager< RangeBases... >::ThisRangeType
 
- Public Types inherited from RangeManager< RangeBases... >
using ThisRangeType = RangeManager< RangeBases... >
 

Public Member Functions

virtual ~RangeManagerContainer ()=default
 D'tor. More...
 
virtual void updateRanges ()=0
 
const ThisRangeTypegetRange () const
 get range of current data (call updateRanges() before to ensure the range is accurate) More...
 
ThisRangeTypegetRange ()
 get mutable range, provided for efficiency reasons (avoid updateRanges(), if only minor changes were made) More...
 
- Public Member Functions inherited from RangeManager< RangeBases... >
bool operator== (const RangeManager &rhs) const
 
bool operator!= (const RangeManager &rhs) const
 
bool assignUnsafe (const RangeManager< RangeBasesOther... > &rhs)
 
auto & assign (const RangeManager< RangeBasesOther... > &rhs)
 
bool extendUnsafe (const RangeManager< RangeBasesOther... > &rhs)
 
void extend (const RangeManager< RangeBasesOther... > &rhs)
 
void scaleBy (const double factor)
 calls RangeBase::scale() for each dimension More...
 
void minSpanIfSingular (const double min_span)
 If any dimension is a single point, e.g. min==max, then extend this dimension by min_span / 2 on either side. More...
 
bool pushIntoUnsafe (const RangeManager< RangeBasesOther... > &rhs)
 
void pushInto (const RangeManager< RangeBasesOther... > &sandbox)
 
bool clampToUnsafe (const RangeManager< RangeBasesOther... > &rhs)
 
void clampTo (const RangeManager< RangeBasesOther... > &rhs)
 
const RangeBasegetRangeForDim (MSDim dim) const
 obtain a range dimension at runtime using dim More...
 
RangeBasegetRangeForDim (MSDim dim)
 obtain a range dimension at runtime using dim More...
 
HasRangeType hasRange () const
 is any/some/all dimension in this range populated? More...
 
bool containsAll (const RangeManager< RangeBasesOther... > &rhs) const
 
void clearRanges ()
 Resets all ranges. More...
 
ThisRangeTypeclear (const DIM_UNIT range)
 
void printRange (std::ostream &out) const
 print each dimension (base classes) to a stream More...
 

Additional Inherited Members

- Protected Member Functions inherited from RangeManager< RangeBases... >
void for_each_base_ (Visitor &&visitor)
 use fold expression to iterate over all RangeBases of RangeManager and apply a lambda (Visitor) for each one More...
 
void for_each_base_ (Visitor &&visitor) const
 .. and a const version More...
 
- Static Protected Member Functions inherited from RangeManager< RangeBases... >
static void static_for_each_base_ (Visitor &&visitor)
 use fold expression to iterate over all RangeBases of RangeManager and apply a lambda (Visitor) for each one (for static members) More...
 

Detailed Description

template<typename ... RangeBases>
class OpenMS::RangeManagerContainer< RangeBases >

use this class as a base class for containers, e.g. MSSpectrum. It forces them to implement 'updateRanges()' as a common interface and provides a 'getRange()' member which saves casting to a range type manually

Member Typedef Documentation

◆ ThisRangeType

using ThisRangeType = typename RangeManager<RangeBases...>::ThisRangeType

Constructor & Destructor Documentation

◆ ~RangeManagerContainer()

virtual ~RangeManagerContainer ( )
virtualdefault

D'tor.

Member Function Documentation

◆ getRange() [1/2]

ThisRangeType& getRange ( )
inline

get mutable range, provided for efficiency reasons (avoid updateRanges(), if only minor changes were made)

◆ getRange() [2/2]

const ThisRangeType& getRange ( ) const
inline

get range of current data (call updateRanges() before to ensure the range is accurate)

◆ updateRanges()

virtual void updateRanges ( )
pure virtual

implement this function to reflect the underlying data of the derived class (e.g. an MSSpectrum) Usually, call clearRanges() internally and then populate the dimensions.

Implemented in MSSpectrum, MSExperiment, MSChromatogram, Mobilogram, FeatureMap, and ConsensusMap.