AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpDataMap.cxx
Go to the documentation of this file.
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 // Category: basic
18 
19 //-----------------------------------------------------------------------------
20 // Class AliMpDataMap
21 // ------------------------
22 // TObject class containing a map of strings to strings
23 // Author:Ivana Hrivnacova; IPN Orsay
24 //-----------------------------------------------------------------------------
25 
26 #include "AliMpDataMap.h"
27 #include "Riostream.h"
28 
29 #include "AliLog.h"
30 
31 #include <TObjString.h>
32 
36 
37 //_____________________________________________________________________________
39  : TObject(),
40  fMap()
41 {
43 
44 }
45 
46 //_____________________________________________________________________________
48 {
50 }
51 
52 //
53 // private methods
54 //
55 
56 //_____________________________________________________________________________
57 void AliMpDataMap::Add(const TString& path, const TString& data)
58 {
60 
61  fMap.Add(new TObjString(path), new TObjString(data));
62 }
63 
64 //_____________________________________________________________________________
65 TString AliMpDataMap::Get(const TString& path, Bool_t warn) const
66 {
69 
70  TObject* object = fMap.GetValue(path.Data());
71 
72  if ( ! object ) {
73  if ( warn ) {
74  AliWarningStream()
75  << path << " not found in the map." << std::endl;
76  }
77  return "";
78  }
79 
80  return ((TObjString*)object)->String();
81 }
82 
TMap fMap
the map of strings to strings
Definition: AliMpDataMap.h:35
TString Get(const TString &path, Bool_t warn=kTRUE) const
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
virtual ~AliMpDataMap()
TObject class containing a map of strings to strings.
Definition: AliMpDataMap.h:21
void Add(const TString &path, const TString &data)