Project
Loading...
Searching...
No Matches
DataSamplingReadoutAdapter.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
14#include "Headers/DataHeader.h"
16#include <atomic>
17
18using namespace o2::framework;
19
20namespace o2::utilities
21{
22
24
26{
27 return [spec](TimingInfo&, ServiceRegistryRef const& ref, fair::mq::Parts& parts, ChannelRetriever channelRetriever, size_t newTimesliceId, bool& stop) {
28 auto *device = ref.get<RawDeviceService>().device();
29
30 for (size_t i = 0; i < parts.Size(); ++i) {
31
32 DataHeader dh;
34 dh.dataOrigin = dataType.origin;
35 dh.dataDescription = dataType.description;
37 dh.payloadSize = parts.At(i)->GetSize();
39
40 DataProcessingHeader dph{newTimesliceId, 0};
41 o2::header::Stack headerStack{dh, dph};
42 sendOnChannel(*device, std::move(headerStack), std::move(parts.At(i)), spec, channelRetriever);
43 }
44 return parts.Size() != 0;
45 };
46}
47
48} // namespace o2::utilities
int32_t i
GLint ref
Definition glcorearb.h:291
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::function< bool(TimingInfo &, ServiceRegistryRef const &services, fair::mq::Parts &inputs, ChannelRetriever, size_t newTimesliceId, bool &stop)> InjectorFunction
void sendOnChannel(fair::mq::Device &device, o2::header::Stack &&headerStack, fair::mq::MessagePtr &&payloadMessage, OutputSpec const &spec, ChannelRetriever &channelRetriever)
std::function< std::string const &(OutputSpec const &, DataProcessingHeader::StartTime)> ChannelRetriever
constexpr o2::header::SerializationMethod gSerializationMethodNone
Definition DataHeader.h:327
A header which contains some meta-data generated by Data Sampling.
framework::InjectorFunction dataSamplingReadoutAdapter(framework::OutputSpec const &spec)
static ConcreteDataTypeMatcher asConcreteDataTypeMatcher(OutputSpec const &spec)
static std::optional< header::DataHeader::SubSpecificationType > getOptionalSubSpec(OutputSpec const &spec)
Get the subspec, if available.
the main header struct
Definition DataHeader.h:618
SerializationMethod payloadSerializationMethod
Definition DataHeader.h:651
DataDescription dataDescription
Definition DataHeader.h:636
SubSpecificationType subSpecification
Definition DataHeader.h:656
PayloadSizeType payloadSize
Definition DataHeader.h:666
a move-only header stack with serialized headers This is the flat buffer where all the headers in a m...
Definition Stack.h:36