//SetLocalLoggingLevel(kHLTLogDefault);
}
-AliHLTComponent::AliHLTComponent(const AliHLTComponent&)
- :
- AliHLTLogging(),
- fEnvironment(),
- fCurrentEvent(0),
- fEventCount(-1),
- fFailedEvents(0),
- fCurrentEventData(),
- fpInputBlocks(NULL),
- fCurrentInputBlock(-1),
- fSearchDataType(kAliHLTVoidDataType),
- fClassName(),
- fpInputObjects(NULL),
- fpOutputBuffer(NULL),
- fOutputBufferSize(0),
- fOutputBufferFilled(0),
- fOutputBlocks(),
- fpStopwatches(NULL),
- fMemFiles(),
- fpRunDesc(NULL),
- fpDDLList(NULL)
-{
- // see header file for class documentation
-}
-
-AliHLTComponent& AliHLTComponent::operator=(const AliHLTComponent&)
-{
- // see header file for class documentation
- return *this;
-}
-
AliHLTComponent::~AliHLTComponent()
{
// see header file for function documentation
* framework will allocate a buffer of appropriate size and call the processing
* again.
*
+ * @subsection alihltcomponent-error-codes Data processing
+ * For return codes, the following scheme applies:
+ * - The data processing methods have to indicate error conditions by a negative
+ * error/return code. Preferably the system error codes are used like
+ * e.g. -EINVAL. This requires to include the header
+ * <pre>
+ * #include <cerrno>
+ * </pre>
+ * - If no suitable input block could be found (e.g. no clusters for the TPC cluster
+ * finder) set size to 0, block list is empty, return 0
+ * - If no ususable or significant signal could be found in the input blocks
+ * return an empty output block, set size accordingly, and return 0. An empty output
+ * block here could be either a real empty one of size 0 (in which case size also
+ * would have to be set to zero) or a block filled with just the minimum necessary
+ * accounting/meta-structures. E.g. in the TPC
+ *
* @subsection alihltcomponent-high-level-interface High-level interface
* The high-level component interface provides functionality to exchange ROOT
* structures between components. In contrast to the
const char* structname="", const char* eventname="");
private:
- /** not a valid copy constructor, defined according to effective C++ style */
+ /** copy constructor prohibited */
AliHLTComponent(const AliHLTComponent&);
- /** not a valid assignment op, but defined according to effective C++ style */
+ /** assignment operator prohibited */
AliHLTComponent& operator=(const AliHLTComponent&);
/**
fSegments.clear();
}
-AliHLTConsumerDescriptor::AliHLTConsumerDescriptor(const AliHLTConsumerDescriptor& desc)
- :
- TObject(),
- AliHLTLogging(),
- fpConsumer(desc.fpConsumer),
- fSegments()
-{
- // see header file for function documentation
-
- // 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)
-{
- // see header file for function documentation
-
- // 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()
{
// see header file for function documentation
* @param pConsumer pointer to the consumer component
*/
AliHLTConsumerDescriptor(AliHLTComponent* pConsumer);
- /** not a valid copy constructor, defined according to effective C++ style */
- AliHLTConsumerDescriptor(const AliHLTConsumerDescriptor&);
- /** not a valid assignment op, but defined according to effective C++ style */
- AliHLTConsumerDescriptor& operator=(const AliHLTConsumerDescriptor&);
/** destructor */
~AliHLTConsumerDescriptor();
int ReleaseActiveDataSegment(AliHLTUInt32_t offset, AliHLTUInt32_t size);
private:
+ /** copy constructor prohibited */
+ AliHLTConsumerDescriptor(const AliHLTConsumerDescriptor&);
+ /** assignment operator prohibited */
+ AliHLTConsumerDescriptor& operator=(const AliHLTConsumerDescriptor&);
+
/** consumer object */
AliHLTComponent* fpConsumer; //! transient
fgNofInstances++;
}
-AliHLTDataBuffer::AliHLTDataBuffer(const AliHLTDataBuffer&)
- :
- TObject(),
- AliHLTLogging(),
- fSegments(),
- fConsumers(),
- fActiveConsumers(),
- fReleasedConsumers(),
- fpBuffer(NULL),
- fFlags(0)
-{
- // see header file for function documentation
- HLTFatal("copy constructor untested");
-}
-
-AliHLTDataBuffer& AliHLTDataBuffer::operator=(const AliHLTDataBuffer&)
-{
- // see header file for function documentation
- HLTFatal("assignment operator untested");
- return *this;
-}
-
int AliHLTDataBuffer::fgNofInstances=0;
vector<AliHLTDataBuffer::AliHLTRawBuffer*> AliHLTDataBuffer::fgFreeBuffers;
vector<AliHLTDataBuffer::AliHLTRawBuffer*> AliHLTDataBuffer::fgActiveBuffers;
}
if (pDesc->GetNofActiveSegments()==0) {
if ((iResult=ChangeConsumerState(pDesc, fActiveConsumers, fReleasedConsumers))>=0) {
- if (GetNofActiveConsumers()==0) {
+ if (GetNofActiveConsumers()==0 && GetNofPendingConsumers()==0) {
// this is the last consumer, reset the consumer list and release the raw buffer
ResetDataBuffer();
}
return iResult;
}
+int AliHLTDataBuffer::GetNofPendingConsumers()
+{
+ // see header file for function documentation
+ int iResult=fConsumers.size();
+ return iResult;
+}
+
int AliHLTDataBuffer::GetNofActiveConsumers()
{
// see header file for function documentation
fpBuffer=NULL;
// cleanup consumer states
- vector<AliHLTConsumerDescriptor*>::iterator desc=fReleasedConsumers.begin();
+ vector<AliHLTConsumerDescriptor*>::iterator desc;
+// if (GetNofPendingConsumers()>0) {
+// desc=fConsumers.begin();
+// while (desc!=fConsumers.end()) {
+// AliHLTComponent* pComp=(*desc)->GetComponent();
+// HLTError("internal error: consumer %p (%s %p) did not get data from data buffer %p", *desc, pComp?pComp->GetComponentID():"", pComp, this);
+// desc++;
+// }
+// }
+ desc=fReleasedConsumers.begin();
while (desc!=fReleasedConsumers.end()) {
AliHLTConsumerDescriptor* pDesc=*desc;
fReleasedConsumers.erase(desc);
/* standard constructor
*/
AliHLTDataBuffer();
- /** not a valid copy constructor, defined according to effective C++ style */
- AliHLTDataBuffer(const AliHLTDataBuffer&);
- /** not a valid assignment op, but defined according to effective C++ style */
- AliHLTDataBuffer& operator=(const AliHLTDataBuffer&);
/** destructor */
virtual ~AliHLTDataBuffer();
int GetNofSegments();
/**
- * Get the number of consumers
+ * Get the total number of consumers.
+ * This gives the number of consumers regardless of their state.
* @return number of consumers
*/
int GetNofConsumers();
/**
- * Get the number of active consumers
+ * Get the number of consumers which still need to be processed during
+ * the current event.
+ * @return number of consumers
+ */
+ int GetNofPendingConsumers();
+
+ /**
+ * Get the number of consumers currently under processing.
* @return number of active consumers
*/
int GetNofActiveConsumers();
};
private:
+ /** copy constructor prohibited */
+ AliHLTDataBuffer(const AliHLTDataBuffer&);
+ /** assignment operator prohibited */
+ AliHLTDataBuffer& operator=(const AliHLTDataBuffer&);
+
/* lets see if this is needed
AliHLTDataSegment* FindDataSegment(AliHLTComponentDataType datatype);
*/