1 #ifndef _ots_DataProducerBase_h_
2 #define _ots_DataProducerBase_h_
4 #include "otsdaq/DataManager/CircularBuffer.h"
5 #include "otsdaq/DataManager/DataProcessor.h"
6 #include "otsdaq/Macros/BinaryStringMacros.h"
18 DataProducerBase(
const std::string& supervisorApplicationUID,
const std::string& bufferUID,
const std::string& processorUID,
unsigned int bufferSize = 100);
21 virtual void registerToBuffer(
void);
24 template<
class D,
class H>
25 int attachToEmptySubBuffer(D*& data, H*& header)
27 return static_cast<CircularBuffer<D, H>*
>(theCircularBuffer_)->getBuffer(DataProcessor::processorUID_).attachToEmptySubBuffer(data, header);
30 template<
class D,
class H>
31 int setWrittenSubBuffer(
void)
34 return static_cast<CircularBuffer<D, H>*
>(theCircularBuffer_)->getBuffer(DataProcessor::processorUID_).setWrittenSubBuffer();
37 template<
class D,
class H>
38 int write(
const D& buffer)
40 return static_cast<CircularBuffer<D, H>*
>(theCircularBuffer_)->getBuffer(DataProcessor::processorUID_).write(buffer);
43 template<
class D,
class H>
44 int write(
const D& buffer,
const H& header)
46 return static_cast<CircularBuffer<D, H>*
>(theCircularBuffer_)->getBuffer(DataProcessor::processorUID_).write(buffer, header);
49 unsigned int getBufferSize(
void)
const {
return bufferSize_; }
52 const unsigned int bufferSize_;