Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
SampleSet.h
Go to the documentation of this file.
1 
12 #ifndef __KOME_OBJECTS_SAMPLE_SET_H__
13 #define __KOME_OBJECTS_SAMPLE_SET_H__
14 
15 
16 #include <string>
17 #include <vector>
18 
19 
20 namespace kome {
21  namespace objects {
22 
23  class Sample;
24 
29  class DATA_OBJECTS_CLASS SampleSet {
30  public:
35  SampleSet();
36 
41  virtual ~SampleSet();
42 
43  protected:
45  std::string m_filePath;
46 
48  std::string m_fileName;
49 
51  std::vector< Sample* > m_samples;
52 
54  bool m_opened;
55 
58 
59  // >>>>>> @Date:2013/06/13 <Add> A.Ozaki
62  // <<<<<< @Date:2013/06/13 <Add> A.Ozaki
63 
66 
67  protected:
68  static int m_currentSampleSetId;
69 
70  public:
76  int getSampleSetId();
77 
78  public:
84  void setFilePath( const char* path );
85 
91  const char* getFilePath();
92 
98  const char* getFileName();
99 
105  bool isOpened();
106 
107  // >>>>>> @Date:2013/06/13 <Add> A.Ozaki
113  int getErrorCode( void );
114 
120  void setErrorCode( const int errorCode );
121  // <<<<<< @Date:2013/06/13 <Add> A.Ozaki
122  public:
127  void clearSamples();
128 
134  void addSample( Sample* sample );
135 
141  unsigned int getNumberOfSamples();
142 
149  Sample* getSample( const unsigned int index );
150 
151  public:
159  bool openFile( const char* path, kome::core::Progress* progress = NULL );
160 
166  bool closeFile();
167 
168  public:
173  static void startLoadingTimer();
174 
179  static void stopLoadingTimer();
180 
186  static double getTotalLoadingTime();
187 
193  static int issueSampleSetId();
194 
195  protected:
203  virtual bool onOpenFile( const char* path, kome::core::Progress* progress = NULL ) = 0;
204 
210  virtual bool onCloseFile() = 0;
211 
212  public:
220  virtual bool onOpenSample( Sample* sample, kome::core::Progress* progress = NULL ) = 0;
221 
228  virtual bool onCloseSample( Sample* sample ) = 0;
229  };
230  }
231 }
232 
233 #endif // __KOME_OBJECTS_SAMPLE_SET_H__
sample set information management class
Definition: SampleSet.h:29
static kome::core::Timer m_loadingTimer
Definition: SampleSet.h:57
sample information management class
Definition: Sample.h:34
std::vector< Sample * > m_samples
Definition: SampleSet.h:51
std::string m_fileName
Definition: SampleSet.h:48
timer class
Definition: Timer.h:26
std::string m_filePath
Definition: SampleSet.h:45
progress display abstract class
Definition: Progress.h:31
#define NULL
Definition: CoreMacros.h:18
void setErrorCode(int code, const char *msg)
set error code and message