#include "AliHLTSystem.h"
AliHLTConsumerDescriptor::AliHLTConsumerDescriptor()
+ :
+ fpConsumer(NULL),
+ fSegments()
{
- fpConsumer=NULL;
fSegments.clear();
}
AliHLTConsumerDescriptor::AliHLTConsumerDescriptor(AliHLTComponent* pConsumer)
+ :
+ fpConsumer(pConsumer),
+ fSegments()
{
- fpConsumer=pConsumer;
fSegments.clear();
}
+AliHLTConsumerDescriptor::AliHLTConsumerDescriptor(const AliHLTConsumerDescriptor& desc)
+ :
+ TObject(),
+ AliHLTLogging(),
+ fpConsumer(desc.fpConsumer),
+ fSegments()
+{
+ // we can simply transfer the pointer to th new object since there are no
+ // release actions in the destructor
+}
+
+AliHLTConsumerDescriptor& AliHLTConsumerDescriptor::operator=(const AliHLTConsumerDescriptor& desc)
+{
+ // we can simply transfer the pointer to th new object since there are no
+ // release actions in the destructor
+ fpConsumer=desc.fpConsumer;
+ return *this;
+}
+
AliHLTConsumerDescriptor::~AliHLTConsumerDescriptor()
{
if (fSegments.size()>0) {
ClassImp(AliHLTDataBuffer)
AliHLTDataBuffer::AliHLTDataBuffer()
+ :
+ fSegments(),
+ fConsumers(),
+ fActiveConsumers(),
+ fReleasedConsumers(),
+ fpBuffer(NULL),
+ fFlags(0)
{
- // TODO: do the right initialization
- //fSegments.empty();
- //fConsumers.empty;
- //fActiveConsumers.empty;
- //fReleasedConsumers.empty;
- fpBuffer=NULL;
- fFlags=0;
+ fSegments.empty();
+ fConsumers.empty();
+ fActiveConsumers.empty();
+ fReleasedConsumers.empty();
fNofInstances++;
}
+AliHLTDataBuffer::AliHLTDataBuffer(const AliHLTDataBuffer&)
+ :
+ TObject(),
+ AliHLTLogging(),
+ fSegments(),
+ fConsumers(),
+ fActiveConsumers(),
+ fReleasedConsumers(),
+ fpBuffer(NULL),
+ fFlags(0)
+{
+ HLTFatal("copy constructor untested");
+}
+
+AliHLTDataBuffer& AliHLTDataBuffer::operator=(const AliHLTDataBuffer&)
+{
+ HLTFatal("assignment operator untested");
+ return *this;
+}
+
int AliHLTDataBuffer::fNofInstances=0;
vector<AliHLTRawBuffer*> AliHLTDataBuffer::fFreeBuffers;
vector<AliHLTRawBuffer*> AliHLTDataBuffer::fActiveBuffers;
return iResult;
}
-int AliHLTDataBuffer::FindMatchingDataBlocks(const AliHLTComponent* pConsumer, vector<AliHLTComponent_DataType>* tgtList)
+int AliHLTDataBuffer::FindMatchingDataBlocks(const AliHLTComponent* pConsumer, vector<AliHLTComponentDataType>* tgtList)
{
int iResult=0;
if (pConsumer) {
{
int iResult=0;
if (pConsumer) {
- vector<AliHLTComponent_DataType> dtlist;
+ vector<AliHLTComponentDataType> dtlist;
((AliHLTComponent*)pConsumer)->GetInputDataTypes(dtlist);
vector<AliHLTDataSegment>::iterator segment=fSegments.begin();
while (segment!=fSegments.end()) {
- vector<AliHLTComponent_DataType>::iterator type=dtlist.begin();
+ vector<AliHLTComponentDataType>::iterator type=dtlist.begin();
while (type!=dtlist.end()) {
if ((*segment).fDataType==(*type)) {
tgtList.push_back(*segment);
return iResult;
}
-int AliHLTDataBuffer::Subscribe(const AliHLTComponent* pConsumer, AliHLTComponent_BlockData* arrayBlockDesc, int iArraySize)
+int AliHLTDataBuffer::Subscribe(const AliHLTComponent* pConsumer, AliHLTComponentBlockData* arrayBlockDesc, int iArraySize)
{
int iResult=0;
if (pConsumer && arrayBlockDesc) {
vector<AliHLTDataSegment>::iterator segment=tgtList.begin();
while (segment!=tgtList.end() && i<iArraySize) {
// fill the block data descriptor
- arrayBlockDesc[i].fStructSize=sizeof(AliHLTComponent_BlockData);
+ arrayBlockDesc[i].fStructSize=sizeof(AliHLTComponentBlockData);
// the shared memory key is not used in AliRoot
- arrayBlockDesc[i].fShmKey.fStructSize=sizeof(AliHLTComponent_ShmData);
- arrayBlockDesc[i].fShmKey.fShmType=gkAliHLTComponent_InvalidShmType;
- arrayBlockDesc[i].fShmKey.fShmID=gkAliHLTComponent_InvalidShmID;
+ arrayBlockDesc[i].fShmKey.fStructSize=sizeof(AliHLTComponentShmData);
+ arrayBlockDesc[i].fShmKey.fShmType=gkAliHLTComponentInvalidShmType;
+ arrayBlockDesc[i].fShmKey.fShmID=gkAliHLTComponentInvalidShmID;
arrayBlockDesc[i].fOffset=(*segment).fSegmentOffset;
arrayBlockDesc[i].fPtr=fpBuffer->fPtr;
arrayBlockDesc[i].fSize=(*segment).fSegmentSize;
HLTDebug("component %p (%s) subscribed to data buffer %p", pConsumer, ((AliHLTComponent*)pConsumer)->GetComponentID(), this);
} else {
// TODO: cleanup the consumer descriptor correctly
- memset(arrayBlockDesc, 0, iArraySize*sizeof(AliHLTComponent_BlockData));
+ memset(arrayBlockDesc, 0, iArraySize*sizeof(AliHLTComponentBlockData));
HLTError("can not activate consumer %p for data buffer %p", pConsumer, this);
iResult=-EACCES;
}
return iResult;
}
-int AliHLTDataBuffer::Release(AliHLTComponent_BlockData* pBlockDesc, const AliHLTComponent* pConsumer)
+int AliHLTDataBuffer::Release(AliHLTComponentBlockData* pBlockDesc, const AliHLTComponent* pConsumer)
{
int iResult=0;
if (pBlockDesc && pConsumer) {
return pTargetBuffer;
}
-int AliHLTDataBuffer::SetSegments(AliHLTUInt8_t* pTgt, AliHLTComponent_BlockData* arrayBlockData, int iSize)
+int AliHLTDataBuffer::SetSegments(AliHLTUInt8_t* pTgt, AliHLTComponentBlockData* arrayBlockData, int iSize)
{
int iResult=0;
if (pTgt && arrayBlockData && iSize>=0) {