int AliHLTDataSource::GetEvent( const AliHLTComponentEventData& evtData,
AliHLTComponentTriggerData& trigData,
AliHLTUInt8_t* /*outputPtr*/,
- AliHLTUInt32_t& /*size*/,
+ AliHLTUInt32_t& size,
vector<AliHLTComponentBlockData>& /*outputBlocks*/ )
{
// we just forward to the high level method, all other parameters already
// have been stored internally
+ size=0;
return GetEvent(evtData, trigData);
}
const AliHLTComponentBlockData* /*blocks*/,
AliHLTComponentTriggerData& trigData,
AliHLTUInt8_t* /*outputPtr*/,
- AliHLTUInt32_t& /*size*/,
+ AliHLTUInt32_t& size,
vector<AliHLTComponentBlockData>& /*outputBlocks*/ )
{
// we just forward to the high level method, all other parameters already
// have been stored internally
+ size=0;
return DoEvent(evtData, trigData);
}
} else {
long unsigned int iConstBase=0;
double fInputMultiplier=0;
- if (pComponent->GetComponentType()!=AliHLTComponent::kSink)
+ if (pComponent->GetComponentType()!=AliHLTComponent::kSink) {
pComponent->GetOutputDataSize(iConstBase, fInputMultiplier);
+ // add a small margin to the buffer to allow optional component
+ // statistics
+ iConstBase+=100;
+ }
if (fInputMultiplier<0) {
HLTWarning("ignoring negative input multiplier");
fInputMultiplier=0;
// see header file for class documentation
// handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
- if (dt==kAliHLTDataTypeComponentStatistics) {
+ if (dt==kAliHLTDataTypeComponentStatistics ||
+ dt==kAliHLTDataTypeComponentTable) {
desc=AliHLTOUTHandlerDesc(kChain, dt, GetModuleId());
return 1;
}
// see header file for class documentation
// handler for the component statistics data blocks {'COMPSTAT':'PRIV'}
- if (dt==kAliHLTDataTypeComponentStatistics) {
+ if (dt==kAliHLTDataTypeComponentStatistics ||
+ dt==kAliHLTDataTypeComponentTable) {
if (fCompStatDataHandler==NULL)
fCompStatDataHandler=new AliHLTOUTHandlerChain("chains=UTIL-compstat-writer");
return fCompStatDataHandler;
// process data events only
if (!IsDataEvent()) return 0;
+ AliHLTUInt32_t capacity=size;
+ size=0;
int iResult=0;
TObjLink *lnk=fpCurrent;
if (pFileDesc && (pFile=*pFileDesc)!=NULL) {
int iCopy=pFile->GetSize();
pFile->Seek(0);
- if (iCopy+iTotalSize<=(int)size) {
+ if (iCopy+iTotalSize<=(int)capacity) {
if (pFile->ReadBuffer((char*)outputPtr+iTotalSize, iCopy)!=0) {
// ReadBuffer returns 1 in case of failure and 0 in case of success
iResult=-EIO;
{
// see header file for class documentation
int iResult=0;
+ AliHLTUInt32_t capacity=size;
+ size=0;
// process data events only
if (!IsDataEvent()) return 0;
const AliHLTUInt8_t* pBuffer=NULL;
AliHLTUInt32_t bufferSize=0;
if ((iResult=pHLTOUT->GetDataBuffer(pBuffer, bufferSize))>=0) {
- if (bufferSize+offset<=size) {
+ if (bufferSize+offset<=capacity) {
memcpy(outputPtr+offset, pBuffer, bufferSize);
AliHLTComponentBlockData bd;
FillBlockData( bd );
if (iResult==-ENOENT) iResult=0;
// indicate too little space in buffer for repeated processing
- if (offset>size) {
+ if (offset>capacity) {
iResult=-ENOSPC;
}
} else if (GetEventCount()<5) {
// finally set the output size
if (iResult>=0)
size=offset;
- else
- size=0;
return iResult;
}
{
// see header file for class documentation
int iResult=0;
+ AliHLTUInt32_t capacity=size;
+ size=0;
// process data events only
if (!IsDataEvent()) return 0;
continue;
}
processedIds.push_back(id);
- if (readSize+offset<=size) {
+ if (readSize+offset<=capacity) {
memcpy(outputPtr+offset, pHeader, sizeof(AliRawDataHeader));
if (readSize>sizeof(AliRawDataHeader)) {
if (!pRawReader->ReadNext(outputPtr+offset+sizeof(AliRawDataHeader), readSize-sizeof(AliRawDataHeader))) {
if (curr!=processedIds.end() && *curr<=id) {
curr++;
} else {
- if (sizeof(AliRawDataHeader)<=size-offset) {
+ if (sizeof(AliRawDataHeader)<=capacity-offset) {
HLTInfo("add empty data block for equipment id %d", id);
memcpy(outputPtr+offset, &header, sizeof(AliRawDataHeader));
AliHLTComponentBlockData bd;
}
}
}
- if (offset<=size) {
+ if (offset<=capacity) {
size=offset;
} else {
- size=0;
outputBlocks.clear();
}
} else {
const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& /*trigData*/,
AliHLTUInt8_t* /*outputPtr*/,
- AliHLTUInt32_t& /*size*/,
+ AliHLTUInt32_t& size,
AliHLTComponentBlockDataList& /*outputBlocks*/ )
{
// see header file for class documentation
int iResult=0;
+ // no direct writing to the output buffer
+ size=0;
+
assert(fBase);
if (!fESD) {
fESD = new AliESDEvent;