CleanupInputObjects();
if (fpStopwatches!=NULL) delete fpStopwatches;
fpStopwatches=NULL;
- vector<AliHLTMemoryFile*>::iterator element=fMemFiles.begin();
+ AliHLTMemoryFilePList::iterator element=fMemFiles.begin();
while (element!=fMemFiles.end()) {
if (*element) {
if ((*element)->IsClosed()==0) {
return 0;
}
-int AliHLTComponent::GetOutputDataTypes(vector<AliHLTComponentDataType>& /*tgtList*/)
+int AliHLTComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& /*tgtList*/)
{
HLTLogKeyword("dummy");
return 0;
return NULL;
}
-int AliHLTComponent::MakeOutputDataBlockList( const vector<AliHLTComponentBlockData>& blocks, AliHLTUInt32_t* blockCount,
+int AliHLTComponent::MakeOutputDataBlockList( const AliHLTComponentBlockDataList& blocks, AliHLTUInt32_t* blockCount,
AliHLTComponentBlockData** outputBlocks )
{
// see header file for function documentation
return -ENOSYS;
}
-int AliHLTComponent::FindMatchingDataTypes(AliHLTComponent* pConsumer, vector<AliHLTComponentDataType>* tgtList)
+int AliHLTComponent::FindMatchingDataTypes(AliHLTComponent* pConsumer, AliHLTComponentDataTypeList* tgtList)
{
// see header file for function documentation
int iResult=0;
if (pConsumer) {
- vector<AliHLTComponentDataType> ctlist;
+ AliHLTComponentDataTypeList ctlist;
((AliHLTComponent*)pConsumer)->GetInputDataTypes(ctlist);
- vector<AliHLTComponentDataType>::iterator type=ctlist.begin();
+ AliHLTComponentDataTypeList::iterator type=ctlist.begin();
//AliHLTComponentDataType ouptdt=GetOutputDataType();
//PrintDataTypeContent(ouptdt, "publisher \'%s\'");
while (type!=ctlist.end() && iResult==0) {
// see header file for function documentation
int iResult=0;
if (pFile) {
- vector<AliHLTMemoryFile*>::iterator element=fMemFiles.begin();
+ AliHLTMemoryFilePList::iterator element=fMemFiles.begin();
int i=0;
while (element!=fMemFiles.end() && iResult>=0) {
if (*element && *element==pFile) {
}
}
- vector<AliHLTComponentBlockData> blockData;
+ AliHLTComponentBlockDataList blockData;
{ // dont delete, sets the scope for the stopwatch guard
ALIHLTCOMPONENT_DA_STOPWATCH();
iResult=DoProcessing(evtData, blocks, trigData, outputPtr, size, blockData, edd);
//HLTDebug("got %d block(s) via high level interface", fOutputBlocks.size());
// sync memory files and descriptors
- vector<AliHLTMemoryFile*>::iterator element=fMemFiles.begin();
+ AliHLTMemoryFilePList::iterator element=fMemFiles.begin();
int i=0;
while (element!=fMemFiles.end() && iResult>=0) {
if (*element) {
class AliHLTComponentHandler;
class TObjArray;
class TStopwatch;
+class AliHLTComponent;
class AliHLTMemoryFile;
+/** list of component data type structures */
+typedef vector<AliHLTComponentDataType> AliHLTComponentDataTypeList;
+/** list of component block data structures */
+typedef vector<AliHLTComponentBlockData> AliHLTComponentBlockDataList;
+/** list of component pointers */
+typedef vector<AliHLTComponent*> AliHLTComponentPList;
+/** list of memory file pointers */
+typedef vector<AliHLTMemoryFile*> AliHLTMemoryFilePList;
+
/**
* @class AliHLTComponent
* Base class of HLT data processing components.
virtual int DoProcessing( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
AliHLTUInt32_t& size,
- vector<AliHLTComponentBlockData>& outputBlocks,
+ AliHLTComponentBlockDataList& outputBlocks,
AliHLTComponentEventDoneData*& edd ) = 0;
// Information member functions for registration.
* The function is pure virtual and must be implemented by the child class.
* @return list of data types in the vector reference
*/
- virtual void GetInputDataTypes( vector<AliHLTComponentDataType>& ) = 0;
+ virtual void GetInputDataTypes( AliHLTComponentDataTypeList& ) = 0;
/**
* Get the output data type of the component.
* @param tgtList list to receive the data types
* @return no of output data types, data types in the target list
*/
- virtual int GetOutputDataTypes(vector<AliHLTComponentDataType>& tgtList);
+ virtual int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
/**
* Get a ratio by how much the data volume is shrinked or enhanced.
* @param tgtList reference to a vector list to receive the matching data types.
* @return >= 0 success, neg. error code if failed
*/
- int FindMatchingDataTypes(AliHLTComponent* pConsumer, vector<AliHLTComponentDataType>* tgtList);
+ int FindMatchingDataTypes(AliHLTComponent* pConsumer, AliHLTComponentDataTypeList* tgtList);
/**
* Set the global component handler.
* framework. Function pointers are transferred via the @ref
* AliHLTComponentEnvironment structure.
*/
- int MakeOutputDataBlockList( const vector<AliHLTComponentBlockData>& blocks, AliHLTUInt32_t* blockCount,
+ int MakeOutputDataBlockList( const AliHLTComponentBlockDataList& blocks, AliHLTUInt32_t* blockCount,
AliHLTComponentBlockData** outputBlocks );
/**
AliHLTUInt32_t fOutputBufferFilled; // see above
/** list of ouput block data descriptors */
- vector<AliHLTComponentBlockData> fOutputBlocks; // see above
+ AliHLTComponentBlockDataList fOutputBlocks; // see above
/** stopwatch array */
TObjArray* fpStopwatches; //! transient
/** array of memory files AliHLTMemoryFile */
- vector<AliHLTMemoryFile*> fMemFiles; //! transient
+ AliHLTMemoryFilePList fMemFiles; //! transient
/** descriptor of the current run */
AliHLTRunDesc* fpRunDesc; //! transient
//#include <string>
//#include "AliHLTSystem.h"
+typedef vector<AliHLTDataBuffer::AliHLTDataSegment> AliHLTDataSegmentList;
+typedef vector<AliHLTDataBuffer::AliHLTRawBuffer*> AliHLTRawBufferPList;
+
/** ROOT macro for the implementation of ROOT specific class methods */
ClassImp(AliHLTDataBuffer)
}
int AliHLTDataBuffer::fgNofInstances=0;
-vector<AliHLTDataBuffer::AliHLTRawBuffer*> AliHLTDataBuffer::fgFreeBuffers;
-vector<AliHLTDataBuffer::AliHLTRawBuffer*> AliHLTDataBuffer::fgActiveBuffers;
+AliHLTRawBufferPList AliHLTDataBuffer::fgFreeBuffers;
+AliHLTRawBufferPList AliHLTDataBuffer::fgActiveBuffers;
AliHLTUInt32_t AliHLTDataBuffer::fgMargin=1024;
AliHLTLogging AliHLTDataBuffer::fgLogging;
const Int_t AliHLTDataBuffer::fgkSafetyPatternSize=16;
return iResult;
}
-int AliHLTDataBuffer::FindMatchingDataBlocks(const AliHLTComponent* pConsumer, vector<AliHLTComponentDataType>* tgtList)
+int AliHLTDataBuffer::FindMatchingDataBlocks(const AliHLTComponent* pConsumer, AliHLTComponentDataTypeList* tgtList)
{
// see header file for function documentation
int iResult=0;
if (pConsumer) {
- vector<AliHLTDataBuffer::AliHLTDataSegment> segments;
+ AliHLTDataSegmentList segments;
if ((iResult=FindMatchingDataSegments(pConsumer, segments))>=0) {
if (tgtList) {
- vector<AliHLTDataBuffer::AliHLTDataSegment>::iterator segment=segments.begin();
+ AliHLTDataSegmentList::iterator segment=segments.begin();
while (segment!=segments.end()) {
tgtList->push_back((*segment).fDataType);
segment++;
return iResult;
if (pConsumer) {
- vector<AliHLTComponentDataType> dtlist;
+ AliHLTComponentDataTypeList dtlist;
((AliHLTComponent*)pConsumer)->GetInputDataTypes(dtlist);
- vector<AliHLTDataBuffer::AliHLTDataSegment>::iterator segment=fSegments.begin();
+ AliHLTDataSegmentList::iterator segment=fSegments.begin();
while (segment!=fSegments.end()) {
- vector<AliHLTComponentDataType>::iterator type=dtlist.begin();
+ AliHLTComponentDataTypeList::iterator type=dtlist.begin();
while (type!=dtlist.end()) {
if ((*segment).fDataType==(*type) ||
(*type)==kAliHLTAnyDataType) {
if (fpBuffer) {
AliHLTConsumerDescriptor* pDesc=FindConsumer(pConsumer, fConsumers);
if (pDesc) {
- vector<AliHLTDataBuffer::AliHLTDataSegment> tgtList;
+ AliHLTDataSegmentList tgtList;
// Matthias 26.07.2007 AliHLTSystem should behave the same way as PubSub
// so it does not matter if there are matching data types or not, unless
// we implement such a check in PubSub
if ((iResult=FindMatchingDataSegments(pConsumer, tgtList))>=0) {
int i =0;
- vector<AliHLTDataBuffer::AliHLTDataSegment>::iterator segment=tgtList.begin();
+ AliHLTDataSegmentList::iterator segment=tgtList.begin();
while (segment!=tgtList.end() && i<iArraySize) {
// fill the block data descriptor
arrayBlockDesc[i].fStructSize=sizeof(AliHLTComponentBlockData);
// see header file for function documentation
AliHLTRawBuffer* pRawBuffer=NULL;
unsigned int reqSize=size+fgkSafetyPatternSize;
- vector<AliHLTRawBuffer*>::iterator buffer=fgFreeBuffers.begin();
+ AliHLTRawBufferPList::iterator buffer=fgFreeBuffers.begin();
while (buffer!=fgFreeBuffers.end() && pRawBuffer==NULL) {
if ((*buffer)->CheckSize(reqSize)) {
// assign this element
// see header file for function documentation
int iResult=0;
if (pBuffer) {
- vector<AliHLTRawBuffer*>::iterator buffer=fgActiveBuffers.begin();
+ AliHLTRawBufferPList::iterator buffer=fgActiveBuffers.begin();
while (buffer!=fgActiveBuffers.end() && (*buffer)!=pBuffer) {
buffer++;
}
{
// see header file for function documentation
int iResult=0;
- vector<AliHLTRawBuffer*>::iterator buffer=fgFreeBuffers.begin();
+ AliHLTRawBufferPList::iterator buffer=fgFreeBuffers.begin();
while (buffer!=fgFreeBuffers.end()) {
delete *buffer;
fgFreeBuffers.erase(buffer);
return iResult;
}
-AliHLTConsumerDescriptor* AliHLTDataBuffer::FindConsumer(const AliHLTComponent* pConsumer, vector<AliHLTConsumerDescriptor*> &list) const
+AliHLTConsumerDescriptor* AliHLTDataBuffer::FindConsumer(const AliHLTComponent* pConsumer, AliHLTConsumerDescriptorPList &list) const
{
// see header file for function documentation
AliHLTConsumerDescriptor* pDesc=NULL;
- vector<AliHLTConsumerDescriptor*>::iterator desc=list.begin();
+ AliHLTConsumerDescriptorPList::iterator desc=list.begin();
while (desc!=list.end() && pDesc==NULL) {
if ((pConsumer==NULL || (*desc)->GetComponent()==pConsumer)) {
pDesc=*desc;
fpBuffer=NULL;
// cleanup consumer states
- vector<AliHLTConsumerDescriptor*>::iterator desc;
+ AliHLTConsumerDescriptorPList::iterator desc;
// if (GetNofPendingConsumers()>0) {
// desc=fConsumers.begin();
// while (desc!=fConsumers.end()) {
}
// cleanup segments
- vector<AliHLTDataBuffer::AliHLTDataSegment>::iterator segment=fSegments.begin();
+ AliHLTDataSegmentList::iterator segment=fSegments.begin();
while (segment!=fSegments.end()) {
fSegments.erase(segment);
segment=fSegments.begin();
}
// this is the version which works on lists of components instead of consumer descriptors
-// int AliHLTDataBuffer::ChangeConsumerState(AliHLTComponent* pConsumer, vector<AliHLTComponent*> &srcList, vector<AliHLTComponent*> &tgtList)
+// int AliHLTDataBuffer::ChangeConsumerState(AliHLTComponent* pConsumer, AliHLTComponentPList &srcList, AliHLTComponentPList &tgtList)
// {
// int iResult=0;
// if (pDesc) {
-// vector<AliHLTComponent*>::iterator desc=srcList.begin();
+// AliHLTComponentPList::iterator desc=srcList.begin();
// while (desc!=srcList.end()) {
// if ((*desc)==pConsumer) {
// srcList.erase(desc);
// return iResult;
// }
-int AliHLTDataBuffer::ChangeConsumerState(AliHLTConsumerDescriptor* pDesc, vector<AliHLTConsumerDescriptor*> &srcList, vector<AliHLTConsumerDescriptor*> &tgtList)
+int AliHLTDataBuffer::ChangeConsumerState(AliHLTConsumerDescriptor* pDesc, AliHLTConsumerDescriptorPList &srcList, AliHLTConsumerDescriptorPList &tgtList)
{
// see header file for function documentation
int iResult=-ENOENT;
if (pDesc) {
- vector<AliHLTConsumerDescriptor*>::iterator desc=srcList.begin();
+ AliHLTConsumerDescriptorPList::iterator desc=srcList.begin();
while (desc!=srcList.end()) {
if ((*desc)==pDesc) {
srcList.erase(desc);
// see header file for function documentation
int iResult=0;
ResetDataBuffer();
- vector<AliHLTConsumerDescriptor*>::iterator desc=fConsumers.begin();
+ AliHLTConsumerDescriptorPList::iterator desc=fConsumers.begin();
while (desc!=fConsumers.end()) {
delete *desc;
fConsumers.erase(desc);
int AliHLTDataBuffer::FindConsumer(AliHLTComponent* pConsumer, int bAllLists)
{
// see header file for function documentation
- vector<AliHLTConsumerDescriptor*>::iterator desc=fConsumers.begin();
+ AliHLTConsumerDescriptorPList::iterator desc=fConsumers.begin();
while (desc!=fConsumers.end()) {
if ((*desc)->GetComponent()==pConsumer)
return 1;
{
// see header file for function documentation
fSize=0;
+ return 0;
}
int AliHLTDataBuffer::AliHLTRawBuffer::WritePattern(const char* pattern, int size)
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
#include <vector>
+#include "TObject.h"
#include "AliHLTLogging.h"
#include "AliHLTDataTypes.h"
-#include "TObject.h"
+#include "AliHLTComponent.h"
-class AliHLTComponent;
class AliHLTConsumerDescriptor;
+/** list of AliHLTConsumerDescriptor pointers */
+typedef vector<AliHLTConsumerDescriptor*> AliHLTConsumerDescriptorPList;
+
/**
* @class AliHLTDataBuffer
* @brief Handling of data buffers for the HLT.
* -EINVAL invalid parameter <br>
*/
int FindMatchingDataBlocks(const AliHLTComponent* pConsumer,
- vector<AliHLTComponentDataType>* tgtList=NULL);
+ AliHLTComponentDataTypeList* tgtList=NULL);
/**
* Subscribe to a segment of the data buffer.
{
memset(&fDataType, 0, sizeof(AliHLTComponentDataType));
}
+
private:
/** the data type of this segment */
AliHLTComponentDataType fDataType; // see above
vector<AliHLTDataSegment> fSegments; // see above
// the list of all consumers which are going to subscribe to the buffer
- vector<AliHLTConsumerDescriptor*> fConsumers; // see above
+ AliHLTConsumerDescriptorPList fConsumers; // see above
// the list of all consumers which are currently subscribed to the buffer
- vector<AliHLTConsumerDescriptor*> fActiveConsumers; // see above
+ AliHLTConsumerDescriptorPList fActiveConsumers; // see above
// the list of all consumers which are already released for the current event
- vector<AliHLTConsumerDescriptor*> fReleasedConsumers; // see above
+ AliHLTConsumerDescriptorPList fReleasedConsumers; // see above
// the buffer instance
AliHLTRawBuffer* fpBuffer; //! transient
* @param list list where to search for the consumer
*/
AliHLTConsumerDescriptor* FindConsumer(const AliHLTComponent* pConsumer,
- vector<AliHLTConsumerDescriptor*> &list) const;
+ AliHLTConsumerDescriptorPList &list) const;
/**
* Change the state of a consumer.
* @param tgtList list where to move the consumer
*/
int ChangeConsumerState(AliHLTConsumerDescriptor* pDesc,
- vector<AliHLTConsumerDescriptor*> &srcList,
- vector<AliHLTConsumerDescriptor*> &tgtList);
+ AliHLTConsumerDescriptorPList &srcList,
+ AliHLTConsumerDescriptorPList &tgtList);
/**
* Cleanup a consumer list.