@date
@brief Implementation of HLT component handler. */
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
#if __GNUC__>= 3
using namespace std;
#endif
fScheduleList(),
fLibraryList(),
fEnvironment(),
- fOwnedComponents()
+ fOwnedComponents(),
+ fLibraryMode(kDynamic)
{
// see header file for class documentation
// or
fScheduleList(),
fLibraryList(),
fEnvironment(),
- fOwnedComponents()
+ fOwnedComponents(),
+ fLibraryMode(kDynamic)
{
// see header file for class documentation
if (pEnv) {
HLTbaseCompileInfo(date, time);
if (!date) date="unknown";
if (!time) time="unknown";
- HLTInfo("%s build on %s (%s)", PACKAGE_STRING, date, time);
+ HLTImportant("%s build on %s (%s)", PACKAGE_STRING, date, time);
#else
- HLTInfo("ALICE High Level Trigger build on %s (%s) (embedded AliRoot build)", __DATE__, __TIME__);
+ HLTImportant("ALICE High Level Trigger build on %s (%s) (embedded AliRoot build)", __DATE__, __TIME__);
#endif
return iResult;
}
return iResult;
}
-int AliHLTComponentHandler::CreateComponent(const char* componentID, void* pEnvParam, int argc, const char** argv, AliHLTComponent*& component )
+int AliHLTComponentHandler::CreateComponent(const char* componentID, void* pEnvParam, int argc, const char** argv, AliHLTComponent*& component, const char* cdbPath )
{
// see header file for class documentation
int iResult=0;
component=pSample->Spawn();
if (component) {
HLTDebug("component \"%s\" created (%p)", componentID, component);
+ if (cdbPath) {
+ component->InitCDB(cdbPath, this);
+ }
if ((iResult=component->Init(&fEnvironment, pEnvParam, argc, argv))!=0) {
HLTError("Initialization of component \"%s\" failed with error %d", componentID, iResult);
delete component;
// see header file for class documentation
Int_t iResult=0;
if (componentID) {
- vector<AliHLTComponent*>::iterator element=fComponentList.begin();
+ AliHLTComponentPList::iterator element=fComponentList.begin();
while (element!=fComponentList.end() && iResult>=0) {
if (strcmp(componentID, (*element)->GetComponentID())==0) {
break;
void AliHLTComponentHandler::List()
{
// see header file for class documentation
- vector<AliHLTComponent*>::iterator element=fComponentList.begin();
+ AliHLTComponentPList::iterator element=fComponentList.begin();
int index=0;
while (element!=fComponentList.end()) {
HLTInfo("%d. %s", index++, (*element++)->GetComponentID());
const char* loadtype="";
#ifdef HAVE_DLFCN_H
// use interface to the dynamic linking loader
- try {
+
+ // exeption does not help in Root context, the Root exeption
+ // handler always catches the exeption before. Have to find out
+ // how exeptions can be used in Root
+ /*try*/ {
hLib.fHandle=dlopen(libraryPath, RTLD_NOW);
loadtype="dlopen";
}
+ /*
catch (...) {
// error message printed further down
loadtype="dlopen exeption";
}
+ */
#else
// use ROOT dynamic loader
// check if the library was already loaded, as Load returns
// 'failure' if the library was already loaded
- try {
+ /*try*/ {
AliHLTLibHandle* pLib=FindLibrary(libraryPath);
if (pLib) {
int* pRootHandle=reinterpret_cast<int*>(pLib->fHandle);
hLib.fHandle=pRootHandle;
}
- if (hLib.fHandle==NULL && gSystem->Load(libraryPath)==0) {
+ if (hLib.fHandle==NULL && gSystem->Load(libraryPath)>=0) {
int* pRootHandle=new int;
if (pRootHandle) *pRootHandle=1;
hLib.fHandle=pRootHandle;
}
loadtype="gSystem";
}
+ /*
catch (...) {
// error message printed further down
loadtype="gSystem exeption";
}
+ */
#endif //HAVE_DLFCN_H
if (hLib.fHandle!=NULL) {
// create TString object to store library path and use pointer as handle
hLib.fName=new TString(libraryPath);
hLib.fMode=fLibraryMode;
- HLTInfo("library %s loaded (%s%s)", libraryPath, hLib.fMode==kStatic?"persistent, ":"", loadtype);
+ HLTImportant("library %s loaded (%s%s)", libraryPath, hLib.fMode==kStatic?"persistent, ":"", loadtype);
fLibraryList.insert(fLibraryList.begin(), hLib);
typedef void (*CompileInfo)( char*& date, char*& time);
CompileInfo fctInfo=(CompileInfo)FindSymbol(libraryPath, "CompileInfo");
(*fctInfo)(date, time);
if (!date) date="unknown";
if (!time) time="unknown";
- HLTInfo("build on %s (%s)", date, time);
+ HLTImportant("build on %s (%s)", date, time);
} else {
- HLTInfo("no build info available (possible AliRoot embedded build)");
+ HLTImportant("no build info available (possible AliRoot embedded build)");
}
// static registration of components when library is loaded
TString* pName=reinterpret_cast<TString*>(handle.fName);
if (handle.fMode!=kStatic) {
#ifdef HAVE_DLFCN_H
- try {
+ // exeption does not help in Root context, the Root exeption
+ // handler always catches the exeption before. Have to find out
+ // how exeptions can be used in Root
+
+ /*try*/ {
dlclose(handle.fHandle);
}
+ /*
catch (...) {
HLTError("exeption caught during dlclose of library %s", pName!=NULL?pName->Data():"");
}
+ */
#else
int* pCount=reinterpret_cast<int*>(handle.fHandle);
if (--(*pCount)==0) {
{
// see header file for class documentation
int iResult=0;
- vector<AliHLTComponent*>::iterator element=fScheduleList.begin();
+ AliHLTComponentPList::iterator element=fScheduleList.begin();
int iLocalResult=0;
while (element!=fScheduleList.end()) {
iLocalResult=RegisterComponent(*element);
{
// see header file for class documentation
int iResult=0;
- vector<AliHLTComponent*>::iterator element=fOwnedComponents.begin();
+ AliHLTComponentPList::iterator element=fOwnedComponents.begin();
while (element!=fOwnedComponents.end()) {
//DeregisterComponent((*element)->GetComponentID());
- try {
+ // exeption does not help in Root context, the Root exeption
+ // handler always catches the exeption before. Have to find out
+ // how exeptions can be used in Root
+ /*try*/ {
delete *element;
}
+ /*
catch (...) {
HLTError("delete managed sample %p", *element);
}
+ */
fOwnedComponents.erase(element);
element=fOwnedComponents.begin();
}