]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTTask.cxx
Implementation of kChain HLTOUT handler
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTTask.cxx
index e55d204698cb100c2bb77fdc5e106fdc61f3568e..5145f450454d81af1e1e7187f57f0735f18ca418 100644 (file)
@@ -113,7 +113,7 @@ int AliHLTTask::Init(AliHLTConfiguration* pConf, AliHLTComponentHandler* pCH)
        // TODO: we have to think about the optional environment parameter,
        // currently just set to NULL. 
        iResult=pCH->CreateComponent(fpConfiguration->GetComponentID(), NULL, argc, argv, fpComponent);
-       if (fpComponent || iResult<=0) {
+       if (fpComponent && iResult>=0) {
          //HLTDebug("component %s (%p) created", fpComponent->GetComponentID(), fpComponent); 
        } else {
          //HLTError("can not find component \"%s\" (%d)", fpConfiguration->GetComponentID(), iResult);
@@ -130,6 +130,9 @@ int AliHLTTask::Init(AliHLTConfiguration* pConf, AliHLTComponentHandler* pCH)
     HLTError("configuration object instance needed for task initialization");
     iResult=-EINVAL;
   }
+  if (iResult>=0) {
+    iResult=CustomInit(pCH);
+  }
   return iResult;
 }
 
@@ -137,6 +140,7 @@ int AliHLTTask::Deinit()
 {
   // see header file for function documentation
   int iResult=0;
+  CustomCleanup();
   AliHLTComponent* pComponent=GetComponent();
   fpComponent=NULL;
   if (pComponent) {
@@ -714,3 +718,15 @@ void AliHLTTask::PrintStatus()
     HLTMessage("     task \"%s\" not initialized", GetName());
   }
 }
+
+int AliHLTTask::CustomInit(AliHLTComponentHandler* /*pCH*/)
+{
+  // default implementation nothing to do
+  return 0;
+}
+
+int AliHLTTask::CustomCleanup()
+{
+  // default implementation nothing to do
+  return 0;
+}