@@ -35,11 +35,9 @@ using DataHeader = o2::header::DataHeader;
3535using DataDescription = o2::header::DataDescription;
3636using DataProcessingHeader = o2::framework::DataProcessingHeader;
3737
38- DataAllocator::DataAllocator (TimingInfo* timingInfo,
39- ServiceRegistry* contextRegistry,
38+ DataAllocator::DataAllocator (ServiceRegistry* contextRegistry,
4039 const AllowedOutputRoutes& routes)
4140 : mAllowedOutputRoutes {routes},
42- mTimingInfo {timingInfo},
4341 mRegistry {contextRegistry}
4442{
4543}
@@ -62,7 +60,8 @@ std::string const& DataAllocator::matchDataHeader(const Output& spec, size_t tim
6260
6361DataChunk& DataAllocator::newChunk (const Output& spec, size_t size)
6462{
65- std::string const & channel = matchDataHeader (spec, mTimingInfo ->timeslice );
63+ auto & timingInfo = mRegistry ->get <TimingInfo>();
64+ std::string const & channel = matchDataHeader (spec, timingInfo.timeslice );
6665 auto & context = mRegistry ->get <MessageContext>();
6766
6867 FairMQMessagePtr headerMessage = headerMessageFromOutput (spec, channel, //
@@ -77,7 +76,7 @@ void DataAllocator::adoptChunk(const Output& spec, char* buffer, size_t size, fa
7776{
7877 // Find a matching channel, create a new message for it and put it in the
7978 // queue to be sent at the end of the processing
80- std::string const & channel = matchDataHeader (spec, mTimingInfo -> timeslice );
79+ std::string const & channel = matchDataHeader (spec, mRegistry -> get <TimingInfo>(). timeslice );
8180
8281 FairMQMessagePtr headerMessage = headerMessageFromOutput (spec, channel, //
8382 o2::header::gSerializationMethodNone , //
@@ -94,17 +93,18 @@ FairMQMessagePtr DataAllocator::headerMessageFromOutput(Output const& spec,
9493 o2::header::SerializationMethod method, //
9594 size_t payloadSize) //
9695{
96+ auto & timingInfo = mRegistry ->get <TimingInfo>();
9797 DataHeader dh;
9898 dh.dataOrigin = spec.origin ;
9999 dh.dataDescription = spec.description ;
100100 dh.subSpecification = spec.subSpec ;
101101 dh.payloadSize = payloadSize;
102102 dh.payloadSerializationMethod = method;
103- dh.tfCounter = mTimingInfo -> tfCounter ;
104- dh.firstTForbit = mTimingInfo -> firstTFOrbit ;
105- dh.runNumber = mTimingInfo -> runNumber ;
103+ dh.tfCounter = timingInfo. tfCounter ;
104+ dh.firstTForbit = timingInfo. firstTFOrbit ;
105+ dh.runNumber = timingInfo. runNumber ;
106106
107- DataProcessingHeader dph{mTimingInfo -> timeslice , 1 };
107+ DataProcessingHeader dph{timingInfo. timeslice , 1 };
108108 auto & context = mRegistry ->get <MessageContext>();
109109
110110 auto channelAlloc = o2::pmr::getTransportAllocator (context.proxy ().getTransport (channel, 0 ));
@@ -114,7 +114,8 @@ FairMQMessagePtr DataAllocator::headerMessageFromOutput(Output const& spec,
114114void DataAllocator::addPartToContext (FairMQMessagePtr&& payloadMessage, const Output& spec,
115115 o2::header::SerializationMethod serializationMethod)
116116{
117- std::string const & channel = matchDataHeader (spec, mTimingInfo ->timeslice );
117+ auto & timingInfo = mRegistry ->get <TimingInfo>();
118+ std::string const & channel = matchDataHeader (spec, timingInfo.timeslice );
118119 auto headerMessage = headerMessageFromOutput (spec, channel, serializationMethod, 0 );
119120
120121 // FIXME: this is kind of ugly, we know that we can change the content of the
@@ -132,7 +133,8 @@ void DataAllocator::addPartToContext(FairMQMessagePtr&& payloadMessage, const Ou
132133void DataAllocator::adopt (const Output& spec, std::string* ptr)
133134{
134135 std::unique_ptr<std::string> payload (ptr);
135- std::string const & channel = matchDataHeader (spec, mTimingInfo ->timeslice );
136+ auto & timingInfo = mRegistry ->get <TimingInfo>();
137+ std::string const & channel = matchDataHeader (spec, timingInfo.timeslice );
136138 // the correct payload size is set later when sending the
137139 // StringContext, see DataProcessor::doSend
138140 auto header = headerMessageFromOutput (spec, channel, o2::header::gSerializationMethodNone , 0 );
@@ -189,7 +191,8 @@ void doWriteTable(std::shared_ptr<FairMQResizableBuffer> b, arrow::Table* table)
189191
190192void DataAllocator::adopt (const Output& spec, TableBuilder* tb)
191193{
192- std::string const & channel = matchDataHeader (spec, mTimingInfo ->timeslice );
194+ auto & timingInfo = mRegistry ->get <TimingInfo>();
195+ std::string const & channel = matchDataHeader (spec, timingInfo.timeslice );
193196 auto header = headerMessageFromOutput (spec, channel, o2::header::gSerializationMethodArrow , 0 );
194197 auto & context = mRegistry ->get <ArrowContext>();
195198
@@ -210,7 +213,8 @@ void DataAllocator::adopt(const Output& spec, TableBuilder* tb)
210213
211214void DataAllocator::adopt (const Output& spec, TreeToTable* t2t)
212215{
213- std::string const & channel = matchDataHeader (spec, mTimingInfo ->timeslice );
216+ auto & timingInfo = mRegistry ->get <TimingInfo>();
217+ std::string const & channel = matchDataHeader (spec, timingInfo.timeslice );
214218
215219 auto header = headerMessageFromOutput (spec, channel, o2::header::gSerializationMethodArrow , 0 );
216220 auto & context = mRegistry ->get <ArrowContext>();
@@ -234,7 +238,8 @@ void DataAllocator::adopt(const Output& spec, TreeToTable* t2t)
234238
235239void DataAllocator::adopt (const Output& spec, std::shared_ptr<arrow::Table> ptr)
236240{
237- std::string const & channel = matchDataHeader (spec, mTimingInfo ->timeslice );
241+ auto & timingInfo = mRegistry ->get <TimingInfo>();
242+ std::string const & channel = matchDataHeader (spec, timingInfo.timeslice );
238243 auto header = headerMessageFromOutput (spec, channel, o2::header::gSerializationMethodArrow , 0 );
239244 auto & context = mRegistry ->get <ArrowContext>();
240245
0 commit comments