Project
Loading...
Searching...
No Matches
PayloadPaginator.h
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.
11
12#ifndef O2_MCH_RAW_PAYLOAD_PAGINATOR_H
13#define O2_MCH_RAW_PAYLOAD_PAGINATOR_H
14
15#include <string>
16#include <gsl/span>
17#include <functional>
18#include <optional>
19#include <set>
20#include <iostream>
21#include <cstdint>
22
23namespace o2::raw
24{
25class RawFileWriter;
26}
27
28namespace o2::mch::raw
29{
30
31// helper struct with the smallest information to uniquely identify
32// one data link
33struct LinkInfo {
34 uint16_t feeId;
35 uint16_t cruId;
36 uint8_t linkId;
37 uint8_t endPoint;
38};
39
40bool operator<(const LinkInfo&, const LinkInfo&);
41std::ostream& operator<<(std::ostream& os, const LinkInfo& li);
42
43using Solar2LinkInfo = std::function<std::optional<LinkInfo>(uint16_t)>;
44
46template <typename ELECMAP, typename FORMAT, typename CHARGESUM, int VERSION>
48
49void registerLinks(o2::raw::RawFileWriter& rawFileWriter,
50 std::string outputBase,
51 const std::set<LinkInfo>& links,
52 bool filePerLink,
53 bool filePerCru);
54
55void paginate(o2::raw::RawFileWriter& rawFileWriter,
56 gsl::span<const std::byte> buffer,
57 const std::set<LinkInfo>& links,
58 Solar2LinkInfo solar2LinkInfo);
59
60} // namespace o2::mch::raw
61#endif
GLuint buffer
Definition glcorearb.h:655
Solar2LinkInfo createSolar2LinkInfo()
void paginate(o2::raw::RawFileWriter &rawFileWriter, gsl::span< const std::byte > buffer, const std::set< LinkInfo > &links, Solar2LinkInfo solar2LinkInfo)
void registerLinks(o2::raw::RawFileWriter &rawFileWriter, std::string outputBase, const std::set< LinkInfo > &links, bool filePerLink, bool filePerCru)
std::function< std::optional< LinkInfo >(uint16_t)> Solar2LinkInfo
bool operator<(const observer_ptr< W1 > &p1, const observer_ptr< W2 > &p2)
std::ostream & operator<<(std::ostream &stream, o2::InteractionRecord const &ir)