3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 * for The ALICE HLT Project. *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
19 /** @file AliHLTModuleAgent.cxx
20 @author Matthias Richter
22 @brief Agent helper class for component libraries.
23 @note The class is used in Offline (AliRoot) context
26 #include "AliHLTModuleAgent.h"
28 /** ROOT macro for the implementation of ROOT specific class methods */
29 ClassImp(AliHLTModuleAgent)
31 AliHLTModuleAgent::AliHLTModuleAgent()
33 // see header file for class documentation
35 // refer to README to build package
37 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
41 AliHLTModuleAgent::AliHLTModuleAgent(const AliHLTModuleAgent&)
46 // see header file for function documentation
49 AliHLTModuleAgent& AliHLTModuleAgent::operator=(const AliHLTModuleAgent&)
51 // see header file for function documentation
55 AliHLTModuleAgent::~AliHLTModuleAgent()
57 // see header file for function documentation
61 void AliHLTModuleAgent::PrintStatus(const char* agent)
63 // see header file for function documentation
66 AliHLTModuleAgent* pCurrent=fAnchor;
67 while (pCurrent!=NULL && strcmp(pCurrent->GetName(), agent)!=0) pCurrent=pCurrent->fpNext;
69 log.Logging(kHLTLogInfo, "AliHLTModuleAgent::PrintStatus", "module agents",
70 "agent %s available", pCurrent->GetName());
72 log.Logging(kHLTLogInfo, "AliHLTModuleAgent::PrintStatus", "module agents",
73 "agent %s not found", agent);
76 AliHLTModuleAgent* pCurrent=fAnchor;
77 log.Logging(kHLTLogInfo, "AliHLT", "", "-----------------------");
78 log.Logging(kHLTLogInfo, "AliHLT", "", "available module agents");
80 log.Logging(kHLTLogInfo, "AliHLT", "", " none");
83 msg.Form(" %s : %p", pCurrent->GetName(), pCurrent);
84 log.Logging(kHLTLogInfo, "AliHLT", "", msg.Data());
85 pCurrent=pCurrent->fpNext;
87 log.Logging(kHLTLogInfo, "AliHLT", "", "-----------------------");
91 int AliHLTModuleAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
92 AliRunLoader* runloader) const
94 // default method, nothing to be done, child classes can overload
95 if (handler==NULL && runloader==NULL) {
96 // get rid of 'unused parameter' warning
101 const char* AliHLTModuleAgent::GetLocalRecConfigurations(AliRunLoader* runloader) const
103 // default method, nothing to be done, child classes can overload
104 if (runloader==NULL) {
105 // get rid of 'unused parameter' warning
110 const char* AliHLTModuleAgent::GetEventRecConfigurations(AliRunLoader* runloader) const
112 // default method, nothing to be done, child classes can overload
113 if (runloader==NULL) {
114 // get rid of 'unused parameter' warning
119 const char* AliHLTModuleAgent::GetRequiredComponentLibraries() const
121 // default method, nothing to be done, child classes can overload
125 int AliHLTModuleAgent::RegisterComponents(AliRunLoader* runloader) const
127 if (runloader==NULL) {
128 // get rid of 'unused parameter' warning
130 // default method, nothing to be done, child classes can overload
134 AliHLTModuleAgent* AliHLTModuleAgent::fAnchor=NULL;
135 AliHLTModuleAgent* AliHLTModuleAgent::fCurrent=NULL;
136 int AliHLTModuleAgent::fCount=0;
138 AliHLTModuleAgent* AliHLTModuleAgent::GetFirstAgent()
140 // see header file for function documentation
145 AliHLTModuleAgent* AliHLTModuleAgent::GetNextAgent()
147 // see header file for function documentation
148 if (fCurrent!=NULL) fCurrent=fCurrent->fpNext;
152 int AliHLTModuleAgent::Register(AliHLTModuleAgent* pAgent)
154 // see header file for function documentation
156 if (!pAgent) return -EINVAL;
160 pAgent->fpNext=fAnchor;
163 // log.Logging(kHLTLogDebug, "AliHLTModuleAgent::Register", "", "module agent %p registered", pAgent);
168 int AliHLTModuleAgent::Unregister(AliHLTModuleAgent* pAgent)
170 // see header file for function documentation
172 if (!pAgent) return -EINVAL;
174 AliHLTModuleAgent* prev=NULL;
175 AliHLTModuleAgent* handler=fAnchor;
176 while (handler!=NULL && handler!=pAgent) {
178 handler=handler->fpNext;
182 fAnchor=handler->fpNext;
184 prev->fpNext=handler->fpNext;
186 //log.Logging(kHLTLogDebug, "AliHLTModuleAgent::Unregister", "", "module agent %p removed", pAgent);