AliRoot Core  ee782a0 (ee782a0)
AliCDBId.h
Go to the documentation of this file.
1 #ifndef ALI_CDB_ID_H
2 #define ALI_CDB_ID_H
3 
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
8 // //
9 // class AliCDBId //
10 // Identity of an object stored into a database: //
11 // path, run validity range, version, subVersion //
12 // //
14 
15 #include "AliCDBPath.h"
16 #include "AliCDBRunRange.h"
17 
18 #include <TObject.h>
19 
20 class AliCDBId: public TObject {
21 
22  public:
23 
24  AliCDBId();
25 
26  AliCDBId(const AliCDBId& other);
27 
28  AliCDBId(const AliCDBPath& path, const AliCDBRunRange& runRange,
29  Int_t version = -1, Int_t subVersion = -1);
30 
31  AliCDBId(const AliCDBPath& path,
32  Int_t firstRun , Int_t lastRun , Int_t verison = -1,
33  Int_t subVersion = -1);
34 
35  static AliCDBId* MakeFromString(const TString& idString);
36 
37  virtual ~AliCDBId();
38 
39  const AliCDBPath& GetAliCDBPath() const {return fPath;}
40  const TString& GetPath() const {return fPath.GetPath();}
41  const TString GetPathLevel(Int_t i) const {return fPath.GetLevel(i);}
42  Bool_t IsWildcard() const {return fPath.IsWildcard();}
43 
44  void SetPath(const char* path) {fPath.SetPath(path);}
45 
46  const AliCDBRunRange& GetAliCDBRunRange() const {return fRunRange;}
48  Int_t GetFirstRun() const {return fRunRange.GetFirstRun();}
49  Int_t GetLastRun() const {return fRunRange.GetLastRun();}
50  void SetFirstRun(Int_t firstRun) {fRunRange.SetFirstRun(firstRun);}
51  void SetLastRun(Int_t lastRun) {fRunRange.SetLastRun(lastRun);}
52  void SetRunRange(Int_t firstRun, Int_t lastRun)
53  {fRunRange.SetRunRange(firstRun, lastRun);}
54 
55 
56  Bool_t IsAnyRange() const {return fRunRange.IsAnyRange();}
57 
58 
59  Int_t GetVersion() const {return fVersion;}
60  Int_t GetSubVersion() const {return fSubVersion;}
61  void SetVersion(Int_t version) {fVersion = version;}
62  void SetSubVersion(Int_t subVersion) {fSubVersion = subVersion;}
63 
64  const TString& GetLastStorage() const {return fLastStorage;}
65  void SetLastStorage(TString& lastStorage){fLastStorage = lastStorage;}
66 
67  Bool_t IsValid() const;
68  Bool_t IsSpecified() const {return !(IsWildcard() || IsAnyRange());}
69 
70  Bool_t HasVersion() const {return fVersion >= 0;}
71  Bool_t HasSubVersion() const {return fSubVersion >= 0;}
72 
73  Bool_t Comprises(const AliCDBId& other) const
74  {return fPath.Comprises(other.fPath)
75  && fRunRange.Comprises(other.fRunRange);}
76 
77  virtual Bool_t IsEqual(const TObject *obj) const;
78 
79  TString ToString() const;
80  void Print(Option_t* option="") const;
81  virtual Int_t Compare(const TObject* obj) const;
82  virtual Bool_t IsSortable() const;
83  virtual const char *GetName() const { return fPath.GetPath().Data(); }
84  private:
85 
86  AliCDBPath fPath; // path
87  AliCDBRunRange fRunRange; // run range
88  Int_t fVersion; // version
89  Int_t fSubVersion; // subversion
90  TString fLastStorage; // previous storage place (new, grid, local, dump)
91 
92  ClassDef(AliCDBId, 1);
93 };
94 
95 #endif
Bool_t IsAnyRange() const
Definition: AliCDBId.h:56
virtual Bool_t IsSortable() const
Definition: AliCDBId.cxx:193
void SetFirstRun(Int_t firstRun)
Definition: AliCDBId.h:50
const TString & GetPath() const
Definition: AliCDBPath.h:38
void SetPath(const char *path)
Definition: AliCDBPath.h:39
Bool_t HasSubVersion() const
Definition: AliCDBId.h:71
Bool_t Comprises(const AliCDBPath &other) const
Definition: AliCDBPath.cxx:250
virtual const char * GetName() const
Definition: AliCDBId.h:83
void SetPath(const char *path)
Definition: AliCDBId.h:44
TString fLastStorage
Definition: AliCDBId.h:90
void SetRunRange(Int_t firstRun, Int_t lastRun)
Definition: AliCDBId.h:52
const char * path
AliCDBRunRange fRunRange
Definition: AliCDBId.h:87
void SetSubVersion(Int_t subVersion)
Definition: AliCDBId.h:62
Bool_t Comprises(const AliCDBId &other) const
Definition: AliCDBId.h:73
const AliCDBPath & GetAliCDBPath() const
Definition: AliCDBId.h:39
Int_t GetVersion() const
Definition: AliCDBId.h:59
Int_t GetLastRun() const
Definition: AliCDBId.h:49
const AliCDBRunRange & GetAliCDBRunRange() const
Definition: AliCDBId.h:46
const TString & GetLastStorage() const
Definition: AliCDBId.h:64
static AliCDBId * MakeFromString(const TString &idString)
Definition: AliCDBId.cxx:85
const char * GetLevel(Int_t i) const
Definition: AliCDBPath.cxx:259
virtual Int_t Compare(const TObject *obj) const
Definition: AliCDBId.cxx:184
Int_t fVersion
Definition: AliCDBId.h:88
void SetVersion(Int_t version)
Definition: AliCDBId.h:61
void SetFirstRun(Int_t firstRun)
void SetRunRange(Int_t firstRun, Int_t lastRun)
virtual Bool_t IsEqual(const TObject *obj) const
Definition: AliCDBId.cxx:147
virtual ~AliCDBId()
Definition: AliCDBId.cxx:129
Int_t GetFirstRun() const
Bool_t IsValid() const
Definition: AliCDBId.cxx:135
const TString GetPathLevel(Int_t i) const
Definition: AliCDBId.h:41
Bool_t IsWildcard() const
Definition: AliCDBId.h:42
Int_t GetLastRun() const
TString ToString() const
Definition: AliCDBId.cxx:163
Bool_t IsAnyRange() const
void SetLastStorage(TString &lastStorage)
Definition: AliCDBId.h:65
Bool_t HasVersion() const
Definition: AliCDBId.h:70
AliCDBId()
Definition: AliCDBId.cxx:34
AliCDBRunRange & GetAliCDBRunRange()
Definition: AliCDBId.h:47
const TString & GetPath() const
Definition: AliCDBId.h:40
Bool_t IsSpecified() const
Definition: AliCDBId.h:68
Bool_t IsWildcard() const
Definition: AliCDBPath.h:45
Int_t fSubVersion
Definition: AliCDBId.h:89
AliCDBPath fPath
Definition: AliCDBId.h:86
void SetLastRun(Int_t lastRun)
Definition: AliCDBId.h:51
void Print(Option_t *option="") const
Definition: AliCDBId.cxx:175
Bool_t Comprises(const AliCDBRunRange &other) const
Int_t GetFirstRun() const
Definition: AliCDBId.h:48
void SetLastRun(Int_t lastRun)
Int_t GetSubVersion() const
Definition: AliCDBId.h:60