fMemFiles(),
fpRunDesc(NULL),
fpDDLList(NULL),
- fCDBInitialized(false),
+ fCDBSetRunNoFunc(false),
fChainId()
{
// see header file for class documentation
return iResult;
}
-int AliHLTComponent::InitCDB(const char* cdbPath)
+int AliHLTComponent::InitCDB(const char* cdbPath, AliHLTComponentHandler* pHandler)
{
+ // see header file for function documentation
int iResult=0;
- // we presume the library already to be loaded
+ if (cdbPath, pHandler) {
+ // I have to think about separating the library handling from the
+ // component handler. Requiring the component hanlder here is not
+ // the cleanest solution.
+ // We presume the library already to be loaded
// find the symbol
- AliHLTComponentHandler cHandler;
- AliHLTMiscInitCDB_t pFunc=(AliHLTMiscInitCDB_t)cHandler.FindSymbol(ALIHLTMISC_LIBRARY, ALIHLTMISC_INIT_CDB);
+ AliHLTMiscInitCDB_t pFunc=(AliHLTMiscInitCDB_t)pHandler->FindSymbol(ALIHLTMISC_LIBRARY, ALIHLTMISC_INIT_CDB);
if (pFunc) {
- iResult=(*pFunc)(cdbPath);
- fCDBInitialized=iResult>=0;
+ if ((iResult=(*pFunc)(cdbPath))>=0) {
+ if (!(fCDBSetRunNoFunc=pHandler->FindSymbol(ALIHLTMISC_LIBRARY, ALIHLTMISC_SET_CDB_RUNNO))) {
+ Message(NULL, kHLTLogWarning, "AliHLTComponent::InitCDB", "init CDB",
+ "can not find function to set CDB run no");
+ }
+ }
} else {
Message(NULL, kHLTLogError, "AliHLTComponent::InitCDB", "init CDB",
"can not find initialization function");
iResult=-ENOSYS;
}
+ } else {
+ iResult=-EINVAL;
+ }
return iResult;
}
int AliHLTComponent::SetCDBRunNo(int runNo)
{
- int iResult=0;
- if (!fCDBInitialized) return iResult;
- // we presume the library already to be loaded
- // find the symbol
- AliHLTComponentHandler cHandler;
- AliHLTMiscSetCDBRunNo_t pFunc=(AliHLTMiscSetCDBRunNo_t)cHandler.FindSymbol(ALIHLTMISC_LIBRARY, ALIHLTMISC_SET_CDB_RUNNO);
- if (pFunc) {
- iResult=(*pFunc)(runNo);
- } else {
- Message(NULL, kHLTLogError, "AliHLTComponent::SetCDBRunNo", "init CDB",
- "can not find initialization function");
- iResult=-ENOSYS;
- }
- return iResult;
+ // see header file for function documentation
+ if (!fCDBSetRunNoFunc) return 0;
+ return (*((AliHLTMiscSetCDBRunNo_t)fCDBSetRunNoFunc))(runNo);
}
int AliHLTComponent::DoInit( int /*argc*/, const char** /*argv*/)
int AliHLTComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& /*tgtList*/)
{
+ // default implementation, childs can overload
HLTLogKeyword("dummy");
return 0;
}
* override the path initialized at the beginning of the AliRoot reconstruction.
*
* The method is used from the external interface in order to set the correct
- * path when running on-line.
+ * path when running on-line. The function also initializes the function
+ * callback for setting the run no during operation.
+ *
+ * A separation of library and component handling is maybe appropriate in the
+ * future. Using the global component handler here is maybe not the cleanest
+ * solution.
+ * @param cdbPath path of the CDB
+ * @param pHandler the component handler used for llibrary handling.
*/
- int InitCDB(const char* cdbPath);
+ int InitCDB(const char* cdbPath, AliHLTComponentHandler* pHandler);
/**
* Set the run no for the CDB.
/** the current DDL list */
AliHLTEventDDL* fpDDLList; //! transient
- /** indicates that the CDB has been initialized locally */
- bool fCDBInitialized; //! transient
+ /** external fct to set CDB run no, indicates external CDB initialization */
+ void* fCDBSetRunNoFunc; //! transient
/** id of the component in the analysis chain */
string fChainId; //! transient
- ClassDef(AliHLTComponent, 4)
+ ClassDef(AliHLTComponent, 5)
};
#endif