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