/** @file testAliHLT_C_Component_WrapperInterface.C
@author Matthias Richter
@date
- @brief Test program for the external wrapper interface
+ @brief Test program for the old wrapper interface, frozen since Jul 08
*/
#include "AliHLTProcessor.h"
AliHLTComponent* Spawn() {return new TestProcessor;}
private:
int DoInit( int argc, const char** argv ) {
+ if (fState!=kCreated) {
+ HLTError("wrong state (%d): component already initialized", fState);
+ return -EBUSY;
+ }
+
if (argc>0 && argv) {
}
gRunNo=GetRunNo();
gChainId=GetChainId();
+
+ fState=kInitialized;
return 0;
}
int DoDeinit() {
+ if (fState!=kInitialized) {
+ HLTError("wrong state (%d): required %d kInitialized", fState, kInitialized);
+ return -ENODEV;
+ }
+
return 0;
}
int DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/) {
int iResult=0;
+ if (fState!=kInitialized) {
+ HLTError("wrong state (%d): component not initialized", fState);
+ return -ENODEV;
+ }
+
HLTInfo("processing event");
for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock();
pBlock!=NULL;
iResult=PushBack(pBlock->fPtr, pBlock->fSize/2, dt, ~pBlock->fSpecification);
Forward();
}
+
return iResult;
}
+
+ enum {
+ kCreated =0,
+ kInitialized,
+ kProcessing,
+ };
+
+ int fState; //!transient
};
TestProcessor::TestProcessor()
- : AliHLTProcessor()
+ :
+ AliHLTProcessor(),
+ fState(kCreated)
+
{
}
return iResult;
}
- if ((iResult=AliHLT_C_Component_LoadLibrary("libAliHLTUtil.so"))<0) {
+ if ((iResult=AliHLT_C_Component_LoadLibrary("../util/.libs/libAliHLTUtil.so"))<0) {
cerr << "error: AliHLT_C_Component_LoadLibrary failed with " << iResult << endl;
return iResult;
}