KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVDatedFileManager.h
Go to the documentation of this file.
1 /*
2 $Id: KVDatedFileManager.h,v 1.2 2007/05/03 11:05:47 franklan Exp $
3 $Revision: 1.2 $
4 $Date: 2007/05/03 11:05:47 $
5 */
6 
9 
10 #ifndef __KVDatedFileManager_H
11 #define __KVDatedFileManager_H
12 
13 #include "TNamed.h"
14 #include "KVDatime.h"
15 #include "KVString.h"
16 #include "KVList.h"
17 
25 class KVSortableDatedFile : public TNamed {
27 
28 public:
29 
31  KVSortableDatedFile(const Char_t* filename, const Char_t* basename);
32  virtual ~KVSortableDatedFile() {};
33  virtual Int_t Compare(const TObject* obj) const;
34  virtual Bool_t IsEqual(const TObject* obj) const;
36  {
37  return fTimestamp;
38  };
39 
40  ClassDef(KVSortableDatedFile, 1)//A filename with an SQL-format date extension which can be used to sort a list according to date
41 };
42 
58 
59  void ReadFiles();
60 
61 public:
62 
64  KVDatedFileManager(const Char_t* base, const Char_t* dir);
65  virtual ~KVDatedFileManager() {};
66 
67  const Char_t* GetPreviousVersion(const Char_t* name);
68  const Char_t* GetOldestVersion();
69  void Update();
70 
71  ClassDef(KVDatedFileManager, 1) //Handles a set of different versions of files in a directory with the same base name and a timestamp
72 };
73 
74 #endif
int Int_t
char Char_t
bool Bool_t
#define ClassDef(name, id)
Handles a set of different versions of files with the same base name and a timestamp.
KVString fDirectory
the directory containg the files
const Char_t * GetPreviousVersion(const Char_t *name)
void Update()
Updates list of files.
KVString fBaseName
the base name of the file
const Char_t * GetOldestVersion()
Returns name of file with earliest timestamp.
KVList fFileList
list of files sorted by timestamp
Extension of TDatime to handle various useful date formats.
Definition: KVDatime.h:32
Extended TList class which owns its objects by default.
Definition: KVList.h:27
A filename with an SQL-format date extension which can be used to sort a list according to date.
KVDatime GetTimeStamp() const
virtual Bool_t IsEqual(const TObject *obj) const
Two files are the same if they have the same basename and timestamp.
KVDatime fTimestamp
timestamp extracted from filename
virtual Int_t Compare(const TObject *obj) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72