diff --git a/core/meta/inc/TClassAttributeMap.h b/core/meta/inc/TClassAttributeMap.h new file mode 100644 index 0000000000000000000000000000000000000000..dc0d76ffc9492f183152ebb0aed8d41905bf1217 --- /dev/null +++ b/core/meta/inc/TClassAttributeMap.h @@ -0,0 +1,62 @@ + +// @(#)root/meta:$Id$ +// Author: Bianca-Cristina Cristescu 03/07/13 + +/************************************************************************* + * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_TClassAttributeMap +#define ROOT_TClassAttributeMap + + +////////////////////////////////////////////////////////////////////////// +// // +// TClassAttributeMap // +// // +// Dictionary of attributes of a TClass. // +// // +////////////////////////////////////////////////////////////////////////// + + +#ifndef ROOT_TObject +#include "TObject.h" +#endif +#ifndef ROOT_THashTable +#include "THashTable.h" +#endif + + +class TClassAttributeMap : public TObject +{ +public: + + TClassAttributeMap(); + virtual ~TClassAttributeMap(); + + void AddProperty(const char* key, Int_t value); + void AddProperty(const char* key, const char* value); + Bool_t HasKey(const char* key) const; + const char *GetPropertyAsString(const char* key) const; + Int_t GetPropertyAsInt(const char* key) const; + Int_t GetPropertySize() const; + Int_t RemovePropertyInt(const char* key); + TString RemovePropertyString(const char* key); + void RemoveProperty(const char* key); + void Clear(); + +private: + + THashTable fStringProperty; //all properties of String type + THashTable fIntProperty; //all properties of Int type + +ClassDef(TClassAttributeMap,1) // Container for name/value pairs of TClass attributes +}; + +#endif // ROOT_TClassAttributeMap + + diff --git a/core/meta/src/TClassAttributeMap.cxx b/core/meta/src/TClassAttributeMap.cxx index df2e3899376d1d33c5ffad7ecd8be42639e6fc29..5e03fab6a60b66d088f6cb000ff066d01b4d19ee 100644 --- a/core/meta/src/TClassAttributeMap.cxx +++ b/core/meta/src/TClassAttributeMap.cxx @@ -82,7 +82,7 @@ Int_t TClassAttributeMap::GetPropertyAsInt(const char* key) const TObject* found = fIntProperty.FindObject(key); if (found) return ((TParameter<int>*)found)->GetVal(); - else { + else //Show an error message if the key is not found. Error("GetPropertyAsInt" , "Could not find property with Int value for this key: %s", key);