]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - STEER/AliCDBMetaData.cxx
Bug fix
[u/mrichter/AliRoot.git] / STEER / AliCDBMetaData.cxx
... / ...
CommitLineData
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 AliCDBMetaData //
19// Set of data describing the object //
20// but not used to identify the object //
21// //
22/////////////////////////////////////////////////////////////////////
23
24#include "AliCDBMetaData.h"
25#include "AliLog.h"
26
27#include <TObjString.h>
28
29ClassImp(AliCDBMetaData)
30
31//_____________________________________________________________________________
32AliCDBMetaData::AliCDBMetaData() :
33TObject(),
34fObjectClassName(""),
35fResponsible(""),
36fBeamPeriod(0),
37fAliRootVersion(""),
38fComment(""),
39fProperties()
40{
41// default constructor
42
43 fProperties.SetOwner(1);
44}
45
46//_____________________________________________________________________________
47AliCDBMetaData::AliCDBMetaData(const char *responsible, UInt_t beamPeriod,
48 const char* alirootVersion, const char* comment) :
49TObject(),
50fObjectClassName(""),
51fResponsible(responsible),
52fBeamPeriod(beamPeriod),
53fAliRootVersion(alirootVersion),
54fComment(comment),
55fProperties()
56{
57// constructor
58
59 fProperties.SetOwner(1);
60}
61
62//_____________________________________________________________________________
63AliCDBMetaData::~AliCDBMetaData() {
64// destructor
65
66}
67
68//_____________________________________________________________________________
69void AliCDBMetaData::SetProperty(const char* property, TObject* object) {
70// add something to the list of properties
71
72 fProperties.Add(new TObjString(property), object);
73}
74
75//_____________________________________________________________________________
76TObject* AliCDBMetaData::GetProperty(const char* property) const {
77// get a property specified by its name (property)
78
79 return fProperties.GetValue(property);
80}
81
82//_____________________________________________________________________________
83Bool_t AliCDBMetaData::RemoveProperty(const char* property) {
84// removes a property
85
86 TObjString objStrProperty(property);
87 TObjString* aKey = (TObjString*) fProperties.Remove(&objStrProperty);
88
89 if (aKey) {
90 delete aKey;
91 return kTRUE;
92 } else {
93 return kFALSE;
94 }
95}
96
97//_____________________________________________________________________________
98void AliCDBMetaData::PrintMetaData() {
99// print the object's metaData
100
101 TString message;
102 if(fObjectClassName != "")
103 message += Form("\tObject's class name: %s\n", fObjectClassName.Data());
104 if(fResponsible != "")
105 message += Form("\tResponsible: %s\n", fResponsible.Data());
106 if(fBeamPeriod != 0)
107 message += Form("\tBeam period: %d\n", fBeamPeriod);
108 if(fAliRootVersion != "")
109 message += Form("\tAliRoot version: %s\n", fAliRootVersion.Data());
110 if(fComment != "")
111 message += Form("\tComment: %s\n", fComment.Data());
112 if(fProperties.GetEntries() > 0){
113 message += "\tProperties key names:";
114
115 TIter iter(fProperties.GetTable());
116 TPair* aPair;
117 while ((aPair = (TPair*) iter.Next())) {
118 message += Form("\t\t%s\n", ((TObjString* ) aPair->Key())->String().Data());
119 }
120 }
121 message += '\n';
122 AliInfo(Form("**** Object's MetaData parameters **** \n%s", message.Data()));
123}