3 /**************************************************************************
4 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
7 * Timm Steinbeck <timm@kip.uni-heidelberg.de> *
8 * Artur Szostak <artursz@iafrica.com> *
9 * for The ALICE Off-line Project. *
11 * Permission to use, copy, modify and distribute this software and its *
12 * documentation strictly for non-commercial purposes is hereby granted *
13 * without fee, provided that the above copyright notice appears in all *
14 * copies and that both the copyright notice and this permission notice *
15 * appear in the supporting documentation. The authors make no claims *
16 * about the suitability of this software for any purpose. It is *
17 * provided "as is" without express or implied warranty. *
18 **************************************************************************/
20 ///////////////////////////////////////////////////////////////////////////////
22 // base class for HLT components //
24 ///////////////////////////////////////////////////////////////////////////////
30 #include "AliHLTComponent.h"
31 #include "AliHLTComponentHandler.h"
33 #include "AliHLTSystem.h"
35 ClassImp(AliHLTComponent)
37 AliHLTComponentHandler* AliHLTComponent::fpComponentHandler=NULL;
39 AliHLTComponent::AliHLTComponent()
41 memset(&fEnvironment, 0, sizeof(AliHLTComponentEnvironment));
42 if (fpComponentHandler)
43 fpComponentHandler->ScheduleRegister(this);
46 AliHLTComponent::~AliHLTComponent()
50 int AliHLTComponent::Init( AliHLTComponentEnvironment* environ, void* environ_param, int argc, const char** argv )
54 memcpy(&fEnvironment, environ, sizeof(AliHLTComponentEnvironment));
55 fEnvironment.fParam=environ_param;
57 iResult=DoInit(argc, argv);
61 int AliHLTComponent::Deinit()
68 int AliHLTComponent::Logging( AliHLTComponent_LogSeverity severity, const char* origin, const char* keyword, const char* format, ... ) {
69 if (fEnvironment.fLoggingFunc) {
71 va_start(args, format);
72 return (*fEnvironment.fLoggingFunc)(fEnvironment.fParam, severity, origin, keyword, AliHLTSystem::BuildLogString(format, args ));