Project
Loading...
Searching...
No Matches
RawPayload.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 ALICEO2_EMCAL_RAWPAYLOAD_H
13#define ALICEO2_EMCAL_RAWPAYLOAD_H
14
15#include <cstdint>
16#include <vector>
17#include <gsl/span>
18#include "Rtypes.h"
19
20namespace o2
21{
22
23namespace emcal
24{
25
37{
38 public:
40 RawPayload() = default;
41
45 RawPayload(const gsl::span<const uint32_t> payloadwords, int numpages);
46
48 ~RawPayload() = default;
49
52 void setNumberOfPages(int numpages) { mNumberOfPages = numpages; }
53
56 void appendPayloadWords(const gsl::span<const uint32_t> payloadwords);
57
60 void appendPayloadWord(uint32_t payloadword) { mPayloadWords.emplace_back(payloadword); };
61
63 void increasePageCount() { mNumberOfPages++; }
64
67 const std::vector<uint32_t>& getPayloadWords() const { return mPayloadWords; }
68
71 int getNumberOfPages() const { return mNumberOfPages; }
72
74 void reset();
75
78 int getPayloadSize() const { return mPayloadWords.size() * sizeof(uint32_t); }
79
80 private:
81 std::vector<uint32_t> mPayloadWords;
82 int mNumberOfPages;
83
84 ClassDefNV(RawPayload, 1);
85};
86
87} // namespace emcal
88
89} // namespace o2
90#endif
Class for raw payload excluding raw data headers from one or multiple DMA pages.
Definition RawPayload.h:37
void reset()
Resetting payload words and page counter.
void increasePageCount()
Increase the page counter of the current payload.
Definition RawPayload.h:63
void setNumberOfPages(int numpages)
Set the number of pages contributing to the current payload.
Definition RawPayload.h:52
int getPayloadSize() const
Get the size of the payload.
Definition RawPayload.h:78
~RawPayload()=default
Destructor.
const std::vector< uint32_t > & getPayloadWords() const
Get the payload words (as 32 bit words) contributing to the current payload.
Definition RawPayload.h:67
int getNumberOfPages() const
Get the number of pages contributing to the payload.
Definition RawPayload.h:71
void appendPayloadWords(const gsl::span< const uint32_t > payloadwords)
Append many words to the current payload (usually of a given DMA page)
RawPayload()=default
Constructor.
void appendPayloadWord(uint32_t payloadword)
Append single payload word to the current payload.
Definition RawPayload.h:60
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...