New version of CDB storage framework (A.Colla)
[u/mrichter/AliRoot.git] / STEER / AliCDBEntry.cxx
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 AliCDBEntry                                              //
19 //  container for an object, it identity (AliCDBId)                //
20 //  and its metaData (AliCDBMetaData)                              //
21 //                                                                 //
22 /////////////////////////////////////////////////////////////////////
23
24 #include "AliCDBEntry.h"
25
26 ClassImp(AliCDBEntry)
27
28 //_____________________________________________________________________________
29 AliCDBEntry::AliCDBEntry():
30 fObject(NULL),
31 fMetaData(NULL), 
32 fIsOwner(kFALSE){
33 // default constructor
34
35 }
36
37 //_____________________________________________________________________________
38 AliCDBEntry::AliCDBEntry(TObject* object, const AliCDBId& id, 
39                         AliCDBMetaData* metaData, Bool_t owner):
40 fObject(object), 
41 fId(id), 
42 fMetaData(metaData), 
43 fIsOwner(owner){
44 // constructor
45
46 }
47
48 //_____________________________________________________________________________
49 AliCDBEntry::AliCDBEntry(TObject* object, const AliCDBPath& path, 
50                         const AliCDBRunRange& runRange,
51                         AliCDBMetaData* metaData,Bool_t owner):
52 fObject(object), 
53 fId(path, runRange, -1, -1), 
54 fMetaData(metaData),
55 fIsOwner(owner){
56 // constructor
57
58 }
59
60 //_____________________________________________________________________________
61 AliCDBEntry::AliCDBEntry(TObject* object, const AliCDBPath& path, 
62                         const AliCDBRunRange& runRange,
63                         Int_t version, AliCDBMetaData* metaData, Bool_t owner):
64 fObject(object), 
65 fId(path, runRange, version, -1), 
66 fMetaData(metaData),
67 fIsOwner(owner){
68 // constructor
69
70 }
71
72 //_____________________________________________________________________________
73 AliCDBEntry::AliCDBEntry(TObject* object, const AliCDBPath& path, 
74                         const AliCDBRunRange& runRange,
75                         Int_t version, Int_t subVersion, 
76                         AliCDBMetaData* metaData, Bool_t owner):
77 fObject(object),
78 fId(path, runRange, version, subVersion), 
79 fMetaData(metaData), 
80 fIsOwner(owner){
81 // constructor
82
83 }
84
85
86 //_____________________________________________________________________________
87 AliCDBEntry::AliCDBEntry(TObject* object, const AliCDBPath& path, 
88                         Int_t firstRun, Int_t lastRun, 
89                         AliCDBMetaData* metaData, Bool_t owner):
90 fObject(object),
91 fId(path, firstRun, lastRun, -1, -1), 
92 fMetaData(metaData), 
93 fIsOwner(owner){
94 // constructor
95
96 }
97
98 //_____________________________________________________________________________
99 AliCDBEntry::AliCDBEntry(TObject* object, const AliCDBPath& path, 
100                         Int_t firstRun, Int_t lastRun,
101                         Int_t version, AliCDBMetaData* metaData,
102                         Bool_t owner):
103 fObject(object),
104 fId(path, firstRun, lastRun, version, -1),
105 fMetaData(metaData), 
106 fIsOwner(owner){
107 // constructor
108
109 }
110
111 //_____________________________________________________________________________
112 AliCDBEntry::AliCDBEntry( TObject* object, const AliCDBPath& path, 
113                         Int_t firstRun, Int_t lastRun,
114                         Int_t version, Int_t subVersion,
115                         AliCDBMetaData* metaData, Bool_t owner):
116 fObject(object),
117 fId(path, firstRun, lastRun, version, subVersion),
118 fMetaData(metaData), fIsOwner(owner){
119 // constructor
120
121 }
122
123 //_____________________________________________________________________________
124 AliCDBEntry::~AliCDBEntry() {
125 // destructor
126
127         if (fIsOwner) {
128                 if (fObject) {
129                         delete fObject;
130                 }
131
132                 if (fMetaData) {
133                         delete fMetaData;
134                 }
135         }
136 }
137