Mass++ mzML IO Plugin v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations
MzmlSampleSet.cpp
Go to the documentation of this file.
1 
12 #include "stdafx.h"
13 #include "MzmlSampleSet.h"
14 
15 #include "MzmlSample.h"
16 
17 
18 using namespace kome::io::mzml;
19 
20 
21 #include <crtdbg.h>
22 #ifdef _DEBUG
23  #define new new( _NORMAL_BLOCK, __FILE__, __LINE__ )
24  #define malloc( s ) _malloc_dbg( s, _NORMAL_BLOCK, __FILE__, __LINE__ )
25 #endif // _DEBUG
26 
27 
28 
29 // constructor
31  m_fp = NULL;
32 }
33 
34 // destructor
36 }
37 
38 // get file
40  return m_fp;
41 }
42 
43 // on open file
44 bool MzmlSampleSet::onOpenFile( const char* path, kome::core::Progress* progress ) { // add param @date 2014.07.08 <Mod> M.Izumi
45  // create sample
46  MzmlSample* sample = new MzmlSample( this );
47  addSample( sample );
48 
49  return true;
50 }
51 
52 // on close file
54  if( m_fp != NULL ) {
55  fclose( m_fp );
56  m_fp = NULL;
57  }
58  return true;
59 }
60 
61 // on open sample
62 bool MzmlSampleSet::onOpenSample( kome::objects::Sample* sample, kome::core::Progress* progress ) { // add param @date 2014.07.08 <Mod> M.Izumi
63  if( m_fp == NULL ) {
64  m_fp = fileopen( getFilePath(), "r" );
65  }
66 
67  return ( m_fp != NULL );
68 }
69 
70 // on close sample
71 bool MzmlSampleSet::onCloseSample( kome::objects::Sample* sample ) {
72  if( m_fp != NULL ) {
73  fclose( m_fp );
74  m_fp = NULL;
75  }
76  return true;
77 }
virtual bool onCloseSample(kome::objects::Sample *sample)
This method is called by closeTreatment method. (override method)
virtual bool onOpenFile(const char *path, kome::core::Progress *progress=NULL)
This method is called by openFile method. (override method)
interfaces of MzmlSample class
common header file
virtual bool onCloseFile()
This method is called by closeFile method. (override method)
virtual bool onOpenSample(kome::objects::Sample *sample, kome::core::Progress *progress=NULL)
This method is called by openTreatment method. (override method)
interfaces of MzmlSampleSet class
virtual ~MzmlSampleSet()
destructor
FILE * getFile()
gets file descriptor
mzML sample class
Definition: MzmlSample.h:26