]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliCDBEntry.cxx
Renaming calibration classes (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 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 // class that contains an object from the data base and knows about its      //
21 // validity range (meta data)                                                //
22 //                                                                           //
23 ///////////////////////////////////////////////////////////////////////////////
24
25
26 #include "AliCDBEntry.h"
27
28 ClassImp(AliCDBEntry)
29
30
31 //_____________________________________________________________________________
32 AliCDBEntry::AliCDBEntry() :
33   TObject(),
34   fObject(NULL),
35   fMetaData()
36 {
37 // default constructor
38
39 }
40
41 //_____________________________________________________________________________
42 AliCDBEntry::AliCDBEntry(const TObject* object, const AliCDBMetaData& metaData) :
43   TObject(),
44   fObject(object->Clone()),
45   fMetaData(metaData)
46 {
47 // constructor
48
49 }
50
51 //_____________________________________________________________________________
52 AliCDBEntry::~AliCDBEntry()
53 {
54 // destructor
55
56   delete fObject;
57 }
58
59
60 //_____________________________________________________________________________
61 AliCDBEntry::AliCDBEntry(const AliCDBEntry& entry) :
62   TObject(entry),
63   fMetaData(entry.fMetaData)
64 {
65 // copy constructor
66
67 }
68
69 //_____________________________________________________________________________
70 AliCDBEntry& AliCDBEntry::operator = (const AliCDBEntry& entry)
71 {
72 // assignment operator
73
74   delete fObject;
75   fObject = entry.fObject->Clone();
76   fMetaData = entry.fMetaData;
77   return *this;
78 }
79
80
81
82 //_____________________________________________________________________________
83 const char* AliCDBEntry::GetName() const
84 {
85 // get the name
86
87   return fMetaData.GetName();
88 }
89
90
91 //_____________________________________________________________________________
92 Int_t AliCDBEntry::Compare(const TObject* object) const
93 {
94 // check whether this is preferred to object
95
96   if (!object || !object->InheritsFrom(AliCDBEntry::Class())) return 1;
97   return fMetaData.Compare(&((AliCDBEntry*)object)->GetCDBMetaData());
98 }
99