// $Id$
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * ALICE Experiment at CERN, All rights reserved. *
- * *
- * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * Timm Steinbeck <timm@kip.uni-heidelberg.de> *
- * for The ALICE HLT Project. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
+//* Timm Steinbeck <timm@kip.uni-heidelberg.de> *
+//* for The ALICE HLT Project. *
+//* *
+//* Permission to use, copy, modify and distribute this software and its *
+//* documentation strictly for non-commercial purposes is hereby granted *
+//* without fee, provided that the above copyright notice appears in all *
+//* copies and that both the copyright notice and this permission notice *
+//* appear in the supporting documentation. The authors make no claims *
+//* about the suitability of this software for any purpose. It is *
+//* provided "as is" without express or implied warranty. *
+//**************************************************************************
/** @file AliHLTComponent.cxx
@author Matthias Richter, Timm Steinbeck
@date
@brief Base class implementation for HLT components. */
-// 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
if (fpInputBlocks!=NULL) {
int idx=startIdx<0?0:startIdx;
for ( ; (UInt_t)idx<fCurrentEventData.fBlockCnt && iResult==-ENOENT; idx++) {
+ if (dt!=fpInputBlocks[idx].fDataType) continue;
+
if (bObject!=0) {
if (fpInputBlocks[idx].fPtr==NULL) continue;
AliHLTUInt32_t firstWord=*((AliHLTUInt32_t*)fpInputBlocks[idx].fPtr);
if (firstWord!=fpInputBlocks[idx].fSize-sizeof(AliHLTUInt32_t)) continue;
}
- if (dt==fpInputBlocks[idx].fDataType) {
- iResult=idx;
- }
+ iResult=idx;
}
}
return iResult;
* Get the first object of a specific data type from the input data.
* The hight-level methods provide functionality to transfer ROOT data
* structures which inherit from TObject.
+ *
* The method looks for the first ROOT object of type dt in the input stream.
* If also the class name is provided, the object is checked for the right
* class type. The input data block needs a certain structure, namely the
* buffer size as first word. If the cross check fails, the retrieval is
* silently abondoned, unless the \em bForce parameter is set.<br>
- * \em Note: THE OBJECT MUST NOT BE DELETED by the caller.
+ * \b Note: THE OBJECT MUST NOT BE DELETED by the caller.
+ *
+ * If called without parameters, the function tries to create objects from
+ * all available input blocks, also the ones of data type kAliHLTVoidDataType
+ * which are not matched by kAliHLTAnyDataType.
+ *
* @param dt data type of the object
* @param classname class name of the object
* @param bForce force the retrieval of an object, error messages
* @return pointer to @ref TObject, NULL if no objects of specified type
* available
*/
- const TObject* GetFirstInputObject(const AliHLTComponentDataType& dt=kAliHLTAnyDataType,
+ const TObject* GetFirstInputObject(const AliHLTComponentDataType& dt=kAliHLTAllDataTypes,
const char* classname=NULL,
int bForce=0);
/**
* Get the first block of a specific data type from the input data.
- * The method looks for the first block of type dt in the input stream. It is intended
- * to be used within the high-level interface.<br>
+ * The method looks for the first block of type dt in the input stream.
+ * It is intended to be used within the high-level interface.<br>
* \em Note: THE BLOCK DESCRIPTOR MUST NOT BE DELETED by the caller.
+ *
+ * If called without parameters, the function works on all input blocks,
+ * also the ones of data type kAliHLTVoidDataType which are not matched by
+ * kAliHLTAnyDataType.
+ *
* @param dt data type of the block
* @return pointer to @ref AliHLTComponentBlockData
*/
- const AliHLTComponentBlockData* GetFirstInputBlock(const AliHLTComponentDataType& dt=kAliHLTAnyDataType);
+ const AliHLTComponentBlockData* GetFirstInputBlock(const AliHLTComponentDataType& dt=kAliHLTAllDataTypes);
/**
* Get the first block of a specific data type from the input data.
* Input blocks containing a TObject have the size of the object as an
* unsigned 32 bit number in the first 4 bytes. This has to match the block
* size minus 4.
+ *
+ * kAliHLTAllDataTypes is a special data type which includes both
+ * kAliHLTVoidDataType and kAliHLTAnyDataType.
+ *
* @param dt data type
* @param startIdx index to start the search
* @param bObject check if this is an object
/** id of the component in the analysis chain */
string fChainId; //! transient
- ClassDef(AliHLTComponent, 5)
+ ClassDef(AliHLTComponent, 6)
};
#endif
* specs
* 5 Data types for Run and Event summary, and for monitoring added
* 6 Common data types for TreeD and TreeR defined
+ * kAliHLTAllDataTypes added
*/
#define ALIHLT_DATA_TYPES_VERSION 6
*/
# define kAliHLTVoidDataTypeID "\0\0\0\0\0\0\0"
-/** special id for any data type id
+/** special id for all data types: any + void
+ * @ingroup alihlt_component_datatypes
+ */
+# define kAliHLTAllDataTypesID "ALLDATA"
+
+/** special id for any valid data type id
* @ingroup alihlt_component_datatypes
*/
# define kAliHLTAnyDataTypeID "*******"
kAliHLTDataOriginVoid
};
+ /** all data types, means any + void data type
+ * @ingroup alihlt_component_datatypes
+ */
+ const AliHLTComponentDataType kAliHLTAllDataTypes = {
+ sizeof(AliHLTComponentDataType),
+ kAliHLTAllDataTypesID,
+ kAliHLTDataOriginAny
+ };
+
// there is currently a problem with rootcint if the predefined ids
// (commented below) are used. rootcint does not find the id if they
// are char arrays defined with {} and individual chars. If strings
//
//////////////////////////////////////////////////////////////////////////
+/** exact comparison of HLT component data types
+ * @ingroup alihlt_component_datatypes
+ */
+inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
+{
+ for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
+ if ( dt1.fID[i] != dt2.fID[i] )
+ return false;
+ for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
+ if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
+ return false;
+ return true;
+}
+
/** Comparison operator for HLT component data types.
* The operator takes wildcards into account, i.e. the ::kAliHLTAnyDataType,
* ::kAliHLTAnyDataTypeID and ::kAliHLTDataOriginAny definitions.
*/
inline bool operator==( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
{
+ if (MatchExactly(dt1, kAliHLTAllDataTypes)) return true;
+ if (MatchExactly(dt2, kAliHLTAllDataTypes)) return true;
+
bool any1=true, any2=true, void1=true, void2=true, match=true;
for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ ) {
any1&=(dt1.fOrigin[i]==kAliHLTDataOriginAny[i]);
return !(dt1==dt2);
}
-/** exact comparison of HLT component data types
- * @ingroup alihlt_component_datatypes
- */
-inline bool MatchExactly( const AliHLTComponentDataType& dt1, const AliHLTComponentDataType& dt2 )
-{
- for ( int i = 0; i < kAliHLTComponentDataTypefIDsize; i++ )
- if ( dt1.fID[i] != dt2.fID[i] )
- return false;
- for ( int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++ )
- if ( dt1.fOrigin[i] != dt2.fOrigin[i] )
- return false;
- return true;
-}
-
/** merge operator for HLT component data types and origins
* @ingroup alihlt_component_datatypes
*/
-// $Id: AliHLTModulePreprocessor.cxx 23039 2007-12-13 20:53:02Z richterm $
+// $Id$
//**************************************************************************
//* This file is property of and copyright by the ALICE HLT Project *
//-*- Mode: C++ -*-
-// @(#) $Id: AliHLTModulePreprocessor.h 23318 2008-01-14 12:43:28Z hristov $
+// @(#) $Id$
#ifndef ALIHLTMODULEPREPROCESSOR_H
#define ALIHLTMODULEPREPROCESSOR_H
-// $Id: AliHLTShuttleInterface.cxx 23039 2007-12-13 20:53:02Z richterm $
+// $Id$
//**************************************************************************
//* This file is property of and copyright by the ALICE HLT Project *
//-*- Mode: C++ -*-
-// @(#) $Id: AliHLTShuttleInterface.h 23318 2008-01-14 12:43:28Z hristov $
+// @(#) $Id$
#ifndef ALIHLTSHUTTLEINTERFACE_H
#define ALIHLTSHUTTLEINTERFACE_H
if (iResult<0) {
HLTError("can not start task list, error %d", iResult);
} else {
+ SetStatusFlags(kStarted);
fEventCount=0;
fGoodEvents=0;
if ((iResult=SendControlEvent(kAliHLTDataTypeSOR))<0) {
lnk = lnk->Next();
}
PrintBenchmarking(fStopwatches, 1 /*clean*/);
+ ClearStatusFlags(kStarted);
return iResult;
}
bool result;
} test_t;
-int main(int argc, const char** argv)
+int main(int /*argc*/, const char** /*argv*/)
{
AliHLTComponentDataType testdt1={
sizeof(AliHLTComponentDataType),
int result=0;
cout << "checking data type operators" << endl;
- for (int i=0; i<(sizeof(tests)/sizeof(test_t)); i++) {
+ for (unsigned int i=0; i<(sizeof(tests)/sizeof(test_t)); i++) {
//if (!tests[i].type) continue;
const char* op=(tests[i].type)?" == ":" != ";
cout << "checking: " << AliHLTComponent::DataType2Text(tests[i].dt1).c_str() << op << AliHLTComponent::DataType2Text(tests[i].dt2).c_str() << " -> ";
file.Close();
} else {
HLTError("can not open file %s", tmpfilename.Data());
+ iResult=-EBADF;
}
} else {
HLTError("can not get temporary file name from system");
AliHLTSystem* pSystem=GetInstance();
if (pSystem) {
AliDebug(0, Form("delete HLT system: status %#x", pSystem->GetStatusFlags()));
- if (pSystem->CheckStatus(AliHLTSystem::kReady)) {
+ if (pSystem->CheckStatus(AliHLTSystem::kStarted)) {
// send specific 'event' to execute the stop sequence
pSystem->Reconstruct(0, NULL, NULL);
}