1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /////////////////////////////////////////////////////////////////////
18 // class AliCDBMetaData //
19 // Set of data describing the object //
20 // but not used to identify the object //
22 /////////////////////////////////////////////////////////////////////
24 #include "AliCDBMetaData.h"
27 #include <TObjString.h>
29 ClassImp(AliCDBMetaData)
31 //_____________________________________________________________________________
32 AliCDBMetaData::AliCDBMetaData() :
41 // default constructor
43 fProperties.SetOwner(1);
46 //_____________________________________________________________________________
47 AliCDBMetaData::AliCDBMetaData(const char *responsible, UInt_t beamPeriod,
48 const char* alirootVersion, const char* comment) :
51 fResponsible(responsible),
52 fBeamPeriod(beamPeriod),
53 fAliRootVersion(alirootVersion),
59 fProperties.SetOwner(1);
62 //_____________________________________________________________________________
63 AliCDBMetaData::~AliCDBMetaData() {
68 //_____________________________________________________________________________
69 void AliCDBMetaData::SetProperty(const char* property, TObject* object) {
70 // add something to the list of properties
72 fProperties.Add(new TObjString(property), object);
75 //_____________________________________________________________________________
76 TObject* AliCDBMetaData::GetProperty(const char* property) const {
77 // get a property specified by its name (property)
79 return fProperties.GetValue(property);
82 //_____________________________________________________________________________
83 Bool_t AliCDBMetaData::RemoveProperty(const char* property) {
86 TObjString objStrProperty(property);
87 TObjString* aKey = (TObjString*) fProperties.Remove(&objStrProperty);
97 //_____________________________________________________________________________
98 void AliCDBMetaData::PrintMetaData() {
99 // print the object's metaData
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());
107 message += Form("\tBeam period: %d\n", fBeamPeriod);
108 if(fAliRootVersion != "")
109 message += Form("\tAliRoot version: %s\n", fAliRootVersion.Data());
111 message += Form("\tComment: %s\n", fComment.Data());
112 if(fProperties.GetEntries() > 0){
113 message += "\tProperties key names:";
115 TIter iter(fProperties.GetTable());
117 while ((aPair = (TPair*) iter.Next())) {
118 message += Form("\t\t%s\n", ((TObjString* ) aPair->Key())->String().Data());
122 AliInfo(Form("**** Object's MetaData parameters **** \n%s", message.Data()));