]>
Commit | Line | Data |
---|---|---|
2c8628dd | 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 "AliRunData.h" | |
f05209ee | 27 | #include "AliObjectMetaData.h" |
2c8628dd | 28 | |
29 | ClassImp(AliRunData) | |
30 | ||
31 | ||
32 | //_____________________________________________________________________________ | |
33 | AliRunData::AliRunData() : | |
34 | TObject(), | |
35 | fObject(NULL), | |
f05209ee | 36 | fObjMetaData() |
2c8628dd | 37 | { |
38 | // default constructor | |
39 | ||
40 | } | |
41 | ||
42 | //_____________________________________________________________________________ | |
f05209ee | 43 | AliRunData::AliRunData(TObject* object, const AliObjectMetaData& objMetaData) : |
2c8628dd | 44 | TObject(), |
45 | fObject(object), | |
f05209ee | 46 | fObjMetaData(objMetaData) |
2c8628dd | 47 | { |
48 | // constructor | |
49 | ||
50 | } | |
51 | ||
52 | //_____________________________________________________________________________ | |
53 | AliRunData::~AliRunData() | |
54 | { | |
55 | // destructor | |
56 | ||
57 | delete fObject; | |
58 | } | |
59 | ||
60 | ||
61 | //_____________________________________________________________________________ | |
62 | AliRunData::AliRunData(const AliRunData& entry) : | |
63 | TObject(entry), | |
f05209ee | 64 | fObjMetaData(entry.fObjMetaData) |
2c8628dd | 65 | { |
66 | // copy constructor | |
67 | ||
68 | } | |
69 | ||
70 | //_____________________________________________________________________________ | |
71 | AliRunData& AliRunData::operator = (const AliRunData& entry) | |
72 | { | |
73 | // assignment operator | |
74 | ||
75 | delete fObject; | |
76 | fObject = entry.fObject->Clone(); | |
f05209ee | 77 | fObjMetaData = entry.fObjMetaData; |
2c8628dd | 78 | return *this; |
79 | } | |
80 | ||
81 | ||
82 | ||
83 | //_____________________________________________________________________________ | |
84 | const char* AliRunData::GetName() const | |
85 | { | |
86 | // get the name | |
87 | ||
f05209ee | 88 | return fObjMetaData.GetName(); |
2c8628dd | 89 | } |
90 | ||
91 | ||
92 | //_____________________________________________________________________________ | |
93 | Int_t AliRunData::Compare(const TObject* object) const | |
94 | { | |
f05209ee | 95 | // check whether this is preferred to object |
2c8628dd | 96 | |
97 | if (!object || !object->InheritsFrom(AliRunData::Class())) return 1; | |
f05209ee | 98 | return fObjMetaData.Compare(&((AliRunData*)object)->GetObjectMetaData()); |
2c8628dd | 99 | } |
100 |