otsdaq  v2_05_02_indev
CircularBufferBase.cc
1 #include "otsdaq/DataManager/CircularBufferBase.h"
2 #include "otsdaq/DataManager/DataConsumer.h"
3 #include "otsdaq/DataManager/DataProducer.h"
4 
5 using namespace ots;
6 
7 //==============================================================================
8 CircularBufferBase::CircularBufferBase(const std::string& bufferID) : dataBufferId_(bufferID), mfSubject_("CircularBuffer:" + dataBufferId_) {}
9 
10 //==============================================================================
11 CircularBufferBase::~CircularBufferBase(void) {}
12 
13 //==============================================================================
14 void CircularBufferBase::registerProducer(DataProcessor* producer, unsigned int numberOfSubBuffers)
15 {
16  registerProducer(producer->getProcessorID(), numberOfSubBuffers);
17  producer->setCircularBuffer(this);
18 }
19 
20 //==============================================================================
21 void CircularBufferBase::registerConsumer(DataProcessor* consumer)
22 {
23  registerConsumer(consumer->getProcessorID(), HighConsumerPriority);
24  consumer->setCircularBuffer(this);
25 }
26 //
28 // void CircularBufferBase::unregisterProducer(DataProcessor* producer)
29 //{
30 // unregisterProducer(producer->getProcessorID());
31 // producer->setCircularBuffer(0);
32 //}
33 //
35 // void CircularBufferBase::unregisterConsumer(DataProcessor* consumer)
36 //{
37 // unregisterConsumer(consumer->getProcessorID());
38 // consumer->setCircularBuffer(0);
39 //}