Project
Loading...
Searching...
No Matches
Decoder.h
Go to the documentation of this file.
1// Copyright 2019-2026 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_FRAMEWORK_AODNATIVE_DECODER_H_
13#define O2_FRAMEWORK_AODNATIVE_DECODER_H_
14
16#include "AODNative/Objects.h"
17#include <cstdint>
18#include <span>
19#include <vector>
20
21namespace o2::aod::native
22{
23
25void byteswapInPlace(uint8_t* data, size_t count, size_t typeSize);
26
32{
33 public:
35 static constexpr size_t kBooleanWindow = 64 * 1024;
36
37 BranchDecoder(ByteSource& source, Options const& options);
38 std::string const& url() const { return mUrl; }
39
42 void decodeValues(BranchInfo const& branch, uint8_t* dst, size_t nbytes);
45 void decodeVLAValues(BranchInfo const& branch, std::span<const int32_t> offsets, uint8_t* dst, size_t nbytes);
48 void decodeBooleans(BranchInfo const& branch, uint8_t* bitmap, size_t nbytes);
50 std::vector<int32_t> decodeOffsets(BranchInfo const& sizeBranch);
51
52 private:
53 struct BasketValues;
57 template <typename F>
58 void forEachBasket(BranchInfo const& branch, bool parallel, F&& fn);
59 void checkBaskets(BranchInfo const& branch) const;
60
61 ByteSource& mSource;
62 Options mOptions;
63 std::string mUrl;
64};
65
66} // namespace o2::aod::native
67
68#endif // O2_FRAMEWORK_AODNATIVE_DECODER_H_
void decodeVLAValues(BranchInfo const &branch, std::span< const int32_t > offsets, uint8_t *dst, size_t nbytes)
Definition Decoder.cxx:226
std::string const & url() const
Definition Decoder.h:38
std::vector< int32_t > decodeOffsets(BranchInfo const &sizeBranch)
Decodes a <col>_size branch into entries + 1 int32 offsets.
Definition Decoder.cxx:276
void decodeValues(BranchInfo const &branch, uint8_t *dst, size_t nbytes)
Definition Decoder.cxx:209
static constexpr size_t kBooleanWindow
Size of the boolean window, the only decode-side scratch memory.
Definition Decoder.h:35
void decodeBooleans(BranchInfo const &branch, uint8_t *bitmap, size_t nbytes)
Definition Decoder.cxx:250
GLint GLsizei count
Definition glcorearb.h:399
GLuint GLsizei const GLuint const GLintptr * offsets
Definition glcorearb.h:2595
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
GLenum GLenum dst
Definition glcorearb.h:1767
GLboolean * data
Definition glcorearb.h:298
void byteswapInPlace(uint8_t *data, size_t count, size_t typeSize)
Byteswaps count big-endian values of typeSize bytes in place.
Definition Decoder.cxx:46
WorkflowSpec parallel(DataProcessorSpec original, size_t maxIndex, std::function< void(DataProcessorSpec &, size_t id)> amendCallback)