]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliCDBId.cxx
Return to the original methods from AliLoader (Marco)
[u/mrichter/AliRoot.git] / STEER / AliCDBId.cxx
CommitLineData
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
26ClassImp(AliCDBId)
27
28//_____________________________________________________________________________
29AliCDBId::AliCDBId():
30fPath(),
31fRunRange(-1,-1),
32fVersion(-1),
33fSubVersion(-1),
34fLastStorage("new")
35{
36// constructor
37
38}
39
40//_____________________________________________________________________________
41AliCDBId::AliCDBId(const AliCDBId& other):
42TObject(),
43fPath(other.fPath),
44fRunRange(other.fRunRange),
45fVersion(other.fVersion),
46fSubVersion(other.fSubVersion),
47fLastStorage(other.fLastStorage)
48{
49// constructor
50
51}
52
53//_____________________________________________________________________________
54AliCDBId::AliCDBId(const AliCDBPath& path, Int_t firstRun, Int_t lastRun,
55 Int_t version, Int_t subVersion):
56fPath(path),
57fRunRange(firstRun, lastRun),
58fVersion(version),
59fSubVersion(subVersion),
60fLastStorage("new")
61{
62// constructor
63
64}
65
66//_____________________________________________________________________________
67AliCDBId::AliCDBId(const AliCDBPath& path, const AliCDBRunRange& runRange,
68 Int_t version, Int_t subVersion):
69fPath(path),
70fRunRange(runRange),
71fVersion(version),
72fSubVersion(subVersion),
73fLastStorage("new")
74{
75// constructor
76
77}
78
79//_____________________________________________________________________________
80AliCDBId::~AliCDBId() {
81//destructor
82
83}
84
85//_____________________________________________________________________________
86Bool_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//_____________________________________________________________________________
98TString 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}