]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
extending LoadInstance, can be used without library argument now to create instance...
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 14 Mar 2010 12:51:09 +0000 (12:51 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 14 Mar 2010 12:51:09 +0000 (12:51 +0000)
HLT/BASE/AliHLTMisc.h

index c3923229db760c657561472534c031912df469a2..f7996c71205699eef610e72aacc0f0f127a0663e 100644 (file)
@@ -32,7 +32,7 @@ class AliHLTMisc : public TObject {
   ~AliHLTMisc();
 
   template<class T>
-  static T* LoadInstance(const T* dummy, const char* classname, const char* library);
+  static T* LoadInstance(const T* dummy, const char* classname, const char* library=NULL);
 
   static AliHLTMisc& Instance();
 
@@ -109,7 +109,7 @@ T* AliHLTMisc::LoadInstance(const T* /*t*/, const char* classname, const char* l
   ROOT::NewFunc_t pNewFunc=NULL;
   do {
     pCl=TClass::GetClass(classname);
-  } while (!pCl && (iLibResult=gSystem->Load(library))==0);
+  } while (!pCl && library!=NULL && (iLibResult=gSystem->Load(library))==0);
   if (iLibResult>=0) {
     if (pCl && (pNewFunc=pCl->GetNew())!=NULL) {
       void* p=(*pNewFunc)(NULL);
@@ -122,7 +122,7 @@ T* AliHLTMisc::LoadInstance(const T* /*t*/, const char* classname, const char* l
        log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "can not create instance of type %s from class descriptor", classname);
       }
     } else {
-      log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "can not find class descriptor %s", classname);
+      log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "can not find TClass descriptor %s", classname);
     }
   } else {
     log.Logging(kHLTLogError, "AliHLTMisc::LoadInstance", "HLT Analysis", "can not load %s library in order to find class descriptor %s", library, classname);