Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Sample.h
Go to the documentation of this file.
1 
12 #ifndef __KOME_OBJECTS_SAMPLE_H__
13 #define __KOME_OBJECTS_SAMPLE_H__
14 
15 
16 #include <string>
17 #include <vector>
18 #include "DataSet.h"
19 
20 
21 namespace kome {
22  namespace objects {
23 
24  class SampleSet;
25  class DataGroupNode;
26  class Spectrum;
27  class Chromatogram;
28  class Peaks;
29 
34  class DATA_OBJECTS_CLASS Sample {
35  public:
40  Sample( SampleSet* sampleSet );
41 
46  virtual ~Sample();
47 
48  protected:
51 
54 
56  int m_specId;
57 
59  std::string m_name;
60 
62  std::string m_type;
63 
65  std::string m_instrument;
66 
68  std::string m_company;
69 
71  std::string m_softwareName;
72 
74  std::string m_softwareVersion;
75 
78 
80  bool m_opened;
81 
83  bool m_edited;
84 
86  std::vector< DataGroupNode* > m_groups;
87 
90 
93 
96 
98  static int m_optSampleId;
99 
100  protected:
102  static std::vector< std::string > m_commonProps;
103 
104  public:
110  SampleSet* getSampleSet();
111 
117  void setSampleIndex( const int index );
118 
124  int getSampleIndex();
125 
131  void setName( const char* name );
132 
138  const char* getName();
139 
145  void setType( const char* type );
146 
152  const char* getType();
153 
159  void setInstrument( const char* instrument );
160 
166  const char* getInstrument();
167 
173  void setMsCompany( const char* company );
174 
180  const char* getMsCompany();
181 
187  void setSoftwareName( const char* name );
188 
194  const char* getSoftwareName();
195 
201  void setSoftwareVersion( const char* version );
202 
208  const char* getSoftwareVersion();
209 
215  void setOpened( const bool opened );
216 
222  bool isOpened();
223 
229  void setEdited( const bool edited );
230 
236  bool isEdited();
237 
243  DataGroupNode* getRootDataGroupNode();
244 
250  DataSet* getHiddenDataSet();
251 
257  unsigned int getNumberOfGroups();
258 
265  DataGroupNode* getGroup( const unsigned int index );
266 
272  void setParallelReadable( const bool readable );
273 
279  bool isParallelReadable();
280 
285  static void resetId();
286 
287  protected:
293  void getGroups( DataGroupNode* parentGroup = NULL );
294 
295  public:
302  bool openSample( kome::core::Progress* progress = NULL );
303 
309  bool closeSample();
310 
317  void detectPeaksByAPI( Spectrum* spec, Peaks* peaks );
318 
319  public:
326  static bool isCommonProperty( const char* key );
327 
328  public:
334  static int issueSampleId();
335 
341  void setSampleId( int id );
342 
348  int getSampleId();
349 
355  static Sample* getSampleById( int id );
356 
362  int issueSpecId();
363 
370  Spectrum* getSpectrumById( int id );
371 
378  int issueChromId( Sample* sample );
379 
386  Chromatogram* getChromatogramById( int id );
387 
394  int issueGroupId( Sample* sample );
395 
402  DataGroupNode* getGroupById( int id );
403 
404  public:
410  bool isSupportedAPIPeaks();
411 
417  void setSupportedAPIPeaks( const bool supported );
418 
419  protected:
424  virtual void onDetectPeaksByAPI( Spectrum* spec, Peaks* peaks );
425 
426  protected:
434  virtual bool onOpenSample( DataGroupNode* rootGroup, kome::core::Progress* progress ) = 0;
435 
441  virtual bool onCloseSample() = 0;
442  };
443  }
444 }
445 
446 
447 #endif // __KOME_OBJECTS_SAMPLE_H__
bool m_parallelReadable
Definition: Sample.h:89
group of spectrum management class
Definition: DataGroupNode.h:33
sample set information management class
Definition: SampleSet.h:29
sample information management class
Definition: Sample.h:34
std::vector< DataGroupNode * > m_groups
Definition: Sample.h:86
static std::vector< std::string > m_commonProps
Definition: Sample.h:102
std::string m_company
Definition: Sample.h:68
DataSet m_hiddenSet
Definition: Sample.h:92
std::string m_softwareName
Definition: Sample.h:71
progress display abstract class
Definition: Progress.h:31
interfaces of DataSet class
std::string m_type
Definition: Sample.h:62
#define NULL
Definition: CoreMacros.h:18
SampleSet * m_sampleSet
Definition: Sample.h:50
std::string m_softwareVersion
Definition: Sample.h:74
bool m_supportedApiPeaks
Definition: Sample.h:95
std::string m_name
Definition: Sample.h:59
spectrum information management class
Definition: Spectrum.h:30
one or more spectra management class
Definition: DataSet.h:31
std::string m_instrument
Definition: Sample.h:65
peaks information class
Definition: Peaks.h:35
chromatogram information management class
Definition: Chromatogram.h:33
static int m_optSampleId
Definition: Sample.h:98
DataGroupNode * m_root
Definition: Sample.h:77