OpenMS
LayerStoreData Class Referenceabstract

Base class to store either the currently visible or all data of a canvas. More...

#include <OpenMS/VISUAL/VISITORS/LayerStoreData.h>

Inheritance diagram for LayerStoreData:
[legend]
Collaboration diagram for LayerStoreData:
[legend]

Public Member Functions

 LayerStoreData (FileTypeList supported_storage_formats)
 
virtual ~LayerStoreData ()=default
 virtual D'tor for proper cleanup of derived classes' members More...
 
FileTypeList getSupportedFileFormats () const
 Which formats are supported when writing the file? More...
 
virtual void saveToFile (const String &filename, const ProgressLogger::LogType lt) const =0
 

Protected Member Functions

FileTypes::Type getSupportedExtension_ (const String &filename) const
 extracts the supported extension (converting UNKNOWN to first item in storage_formats_) or throws an Exception::UnableToCreateFile More...
 

Protected Attributes

FileTypeList storage_formats_
 file formats which can hold the data from the layer; The first item should be the preferred/default format More...
 

Detailed Description

Base class to store either the currently visible or all data of a canvas.

Constructor & Destructor Documentation

◆ LayerStoreData()

LayerStoreData ( FileTypeList  supported_storage_formats)
inline

◆ ~LayerStoreData()

virtual ~LayerStoreData ( )
virtualdefault

virtual D'tor for proper cleanup of derived classes' members

Member Function Documentation

◆ getSupportedExtension_()

FileTypes::Type getSupportedExtension_ ( const String filename) const
protected

extracts the supported extension (converting UNKNOWN to first item in storage_formats_) or throws an Exception::UnableToCreateFile

◆ getSupportedFileFormats()

FileTypeList getSupportedFileFormats ( ) const
inline

Which formats are supported when writing the file?

◆ saveToFile()

virtual void saveToFile ( const String filename,
const ProgressLogger::LogType  lt 
) const
pure virtual

Save the internal data to a file. The filename's suffix determines the file format. It must be one of getSupportedFileFormats() or UNKNOWN. If the filename's suffix is unknown, the first item from getSupportedFileFormats() determines the storage format.

Parameters
filenameA relative or absolute path+filename. Its suffix determines the format.
ltShow a progress bar in the GUI?
Exceptions
Exception::UnableToCreateFileif the extension of filename is neither in getSupportedFileFormats() nor UNKNOWN.

Implemented in LayerStoreDataIdentAll, LayerStoreDataIdentVisible, LayerStoreDataConsensusMapAll, LayerStoreDataConsensusMapVisible, LayerStoreDataFeatureMapAll, LayerStoreDataFeatureMapVisible, LayerStoreDataPeakMapAll, and LayerStoreDataPeakMapVisible.

Member Data Documentation

◆ storage_formats_

FileTypeList storage_formats_
protected

file formats which can hold the data from the layer; The first item should be the preferred/default format