]>
Commit | Line | Data |
---|---|---|
9e1ceb13 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | ///////////////////////////////////////////////////////////////////// | |
17 | // // | |
18 | // class AliCDBId // | |
19 | // Identity of an object stored into a database: // | |
20 | // path, run validity range, version, subVersion // | |
21 | // // | |
22 | ///////////////////////////////////////////////////////////////////// | |
23 | ||
24 | #include "AliCDBId.h" | |
25 | ||
26 | ClassImp(AliCDBId) | |
27 | ||
28 | //_____________________________________________________________________________ | |
29 | AliCDBId::AliCDBId(): | |
30 | fPath(), | |
31 | fRunRange(-1,-1), | |
32 | fVersion(-1), | |
33 | fSubVersion(-1), | |
34 | fLastStorage("new") | |
35 | { | |
36 | // constructor | |
37 | ||
38 | } | |
39 | ||
40 | //_____________________________________________________________________________ | |
41 | AliCDBId::AliCDBId(const AliCDBId& other): | |
42 | TObject(), | |
43 | fPath(other.fPath), | |
44 | fRunRange(other.fRunRange), | |
45 | fVersion(other.fVersion), | |
46 | fSubVersion(other.fSubVersion), | |
47 | fLastStorage(other.fLastStorage) | |
48 | { | |
49 | // constructor | |
50 | ||
51 | } | |
52 | ||
53 | //_____________________________________________________________________________ | |
54 | AliCDBId::AliCDBId(const AliCDBPath& path, Int_t firstRun, Int_t lastRun, | |
55 | Int_t version, Int_t subVersion): | |
56 | fPath(path), | |
57 | fRunRange(firstRun, lastRun), | |
58 | fVersion(version), | |
59 | fSubVersion(subVersion), | |
60 | fLastStorage("new") | |
61 | { | |
62 | // constructor | |
63 | ||
64 | } | |
65 | ||
66 | //_____________________________________________________________________________ | |
67 | AliCDBId::AliCDBId(const AliCDBPath& path, const AliCDBRunRange& runRange, | |
68 | Int_t version, Int_t subVersion): | |
69 | fPath(path), | |
70 | fRunRange(runRange), | |
71 | fVersion(version), | |
72 | fSubVersion(subVersion), | |
73 | fLastStorage("new") | |
74 | { | |
75 | // constructor | |
76 | ||
77 | } | |
78 | ||
79 | //_____________________________________________________________________________ | |
80 | AliCDBId::~AliCDBId() { | |
81 | //destructor | |
82 | ||
83 | } | |
84 | ||
85 | //_____________________________________________________________________________ | |
86 | Bool_t AliCDBId::IsValid() const { | |
87 | // validity check | |
88 | ||
89 | if (!(fPath.IsValid() && fRunRange.IsValid())) { | |
90 | return kFALSE; | |
91 | } | |
92 | ||
93 | // FALSE if doesn't have version but has subVersion | |
94 | return !(!HasVersion() && HasSubVersion()); | |
95 | } | |
96 | ||
97 | //_____________________________________________________________________________ | |
98 | TString AliCDBId::ToString() const { | |
99 | // returns a string of Id data | |
100 | ||
101 | TString result; | |
b05400be | 102 | result += "path \""; |
9e1ceb13 | 103 | result += GetPath(); |
b05400be | 104 | result += "\"; run range ["; |
9e1ceb13 | 105 | result += GetFirstRun(); |
106 | result += ","; | |
107 | result += GetLastRun(); | |
b05400be | 108 | result += "]; version v"; |
9e1ceb13 | 109 | result += GetVersion(); |
110 | result += "_s"; | |
111 | result += GetSubVersion(); | |
9e1ceb13 | 112 | |
113 | return result; | |
114 | } |