emcDataManager.h

Go to the documentation of this file.
00001 #ifndef __EMCDATAMANAGER_H__
00002 #define __EMCDATAMANAGER_H__
00003 
00004 
00005 #include <iosfwd>
00006 #include <string>
00007 
00008 #ifndef __PHTIMESTAMP_H__
00009 #include "PHTimeStamp.h"
00010 #endif
00011 
00012 class emcManageable;
00013 
00035 class emcDataManager
00036 {
00037  private:
00039   emcDataManager();
00040 
00041  public:
00042 
00044   ~emcDataManager() {}
00045  
00047   static emcDataManager* GetInstance();
00048 
00052   void ls(const char* opt="");
00053 
00063   emcManageable* Collect(const emcManageable& object, const PHTimeStamp& when);
00064 
00068   const char* GetDestinationDir(void) { return fDestinationDir.c_str(); }
00069 
00073   const char* GetSourceDir(void) { return fSourceDir.c_str(); }
00074 
00076   static int GetVerboseLevel(void) { return fVerboseLevel; }
00077 
00090   bool Read(emcManageable& object, 
00091             const PHTimeStamp& tSearch,
00092             int id=-1);
00093 
00100   bool Read(emcManageable& object, int runnumber);
00101 
00107   bool ReadPreviousVersion(emcManageable& object, 
00108                            const PHTimeStamp& time_stamp,
00109                            int id,
00110                            int version=0);
00111 
00115   void Reset(void);
00116 
00120   void SetDestinationDir(const char* path) { fDestinationDir=path; }
00121 
00125   void SetSourceDir(const char* path) { fSourceDir=path; }
00126 
00128   static void SetVerboseLevel(int level=0) { fVerboseLevel = level; }
00129 
00140   bool Write(const emcManageable& object,
00141              const PHTimeStamp& tStart = PHTimeStamp(0),
00142              int id=-1);
00143 
00144 private:
00145   static int fVerboseLevel;
00146   std::string fSourceDir;
00147   std::string fDestinationDir;
00148 };
00149 
00151 std::ostream& operator << (std::ostream&, const emcDataManager&);
00152 
00153 #endif