]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliRunData.cxx
first prototype of interface to storage of run dependent objects, implementation...
[u/mrichter/AliRoot.git] / STEER / AliRunData.cxx
CommitLineData
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"
27
28
29ClassImp(AliRunData)
30
31
32//_____________________________________________________________________________
33AliRunData::AliRunData() :
34 TObject(),
35 fObject(NULL),
36 fMetaData()
37{
38// default constructor
39
40}
41
42//_____________________________________________________________________________
43AliRunData::AliRunData(TObject* object, const AliMetaData& metaData) :
44 TObject(),
45 fObject(object),
46 fMetaData(metaData)
47{
48// constructor
49
50}
51
52//_____________________________________________________________________________
53AliRunData::~AliRunData()
54{
55// destructor
56
57 delete fObject;
58}
59
60
61//_____________________________________________________________________________
62AliRunData::AliRunData(const AliRunData& entry) :
63 TObject(entry),
64 fMetaData(entry.fMetaData)
65{
66// copy constructor
67
68}
69
70//_____________________________________________________________________________
71AliRunData& AliRunData::operator = (const AliRunData& entry)
72{
73// assignment operator
74
75 delete fObject;
76 fObject = entry.fObject->Clone();
77 fMetaData = entry.fMetaData;
78 return *this;
79}
80
81
82
83//_____________________________________________________________________________
84const char* AliRunData::GetName() const
85{
86// get the name
87
88 return fMetaData.GetName();
89}
90
91
92//_____________________________________________________________________________
93Int_t AliRunData::Compare(const TObject* object) const
94{
95// check whether this is prefered to object
96
97 if (!object || !object->InheritsFrom(AliRunData::Class())) return 1;
98 return fMetaData.Compare(&((AliRunData*)object)->GetMetaData());
99}
100