Project
Loading...
Searching...
No Matches
RawPageTestData.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
16
17
#ifndef FRAMEWORK_UTILS_RAWPAGETESTDATA_H
18
#define FRAMEWORK_UTILS_RAWPAGETESTDATA_H
19
20
#include "
Framework/InputRecord.h
"
21
#include "
Framework/InputSpan.h
"
22
#include "
Headers/RAWDataHeader.h
"
23
#include "
Headers/DataHeader.h
"
24
#include <vector>
25
#include <memory>
26
27
using
DataHeader
=
o2::header::DataHeader
;
28
using
Stack
=
o2::header::Stack
;
29
using
RAWDataHeaderV6
=
o2::header::RAWDataHeaderV6
;
30
31
namespace
o2::framework::test
32
{
33
using
RAWDataHeader
=
RAWDataHeaderV6
;
34
static
const
size_t
PAGESIZE
= 8192;
35
39
struct
DataSet
{
40
// not nice with the double vector but for quick unit test ok
41
using
Messages
= std::vector<std::vector<std::unique_ptr<std::vector<char>>>>;
42
DataSet
(std::vector<InputRoute>&& s,
Messages
&&
m
, std::vector<int>&&
v
,
ServiceRegistryRef
registry)
43
:
schema
{
std
::move(s)},
44
messages
{
std
::move(
m
)},
45
span
{[this](size_t
i
) {
return
i
< this->
messages
.
size
() ?
messages
[
i
].size() / 2 : 0; },
46
nullptr
,
47
[
this
](
size_t
i
,
DataRefIndices
idx) {
48
auto
header =
static_cast<
char
const*
>
(this->
messages
[
i
].at(idx.headerIdx)->data());
49
auto
payload =
static_cast<
char
const*
>
(this->
messages
[
i
].at(idx.payloadIdx)->data());
50
return
DataRef
{
nullptr
, header, payload};
51
},
52
[
this
](
size_t
i
,
DataRefIndices
current) ->
DataRefIndices
{
53
size_t
next = current.
headerIdx
+ 2;
54
return
next < this->
messages
[
i
].size() ?
DataRefIndices
{next, next + 1} : DataRefIndices{size_t(-1), size_t(-1)};
55
},
56
this->
messages
.size()},
57
record{
schema
, span, registry},
58
values
{std::move(
v
)}
59
{
60
}
61
62
std::vector<InputRoute>
schema
;
63
Messages
messages
;
64
InputSpan
span
;
65
InputRecord
record
;
66
std::vector<int>
values
;
67
};
68
69
using
AmendRawDataHeader
= std::function<
void
(
RAWDataHeader
&)>;
70
DataSet
createData
(std::vector<InputSpec>
const
& inputspecs, std::vector<DataHeader>
const
& dataheaders,
AmendRawDataHeader
amendRdh =
nullptr
);
71
72
}
// namespace o2::framework::test
73
#endif
// FRAMEWORK_UTILS_RAWPAGETESTDATA_H
DataHeader.h
schema
std::shared_ptr< arrow::Schema > schema
Definition
ExpressionJSONHelpers.cxx:666
i
int32_t i
Definition
GPUCommonAlgorithm.h:436
InputRecord.h
InputSpan.h
RAWDataHeader.h
Definition of the RAW Data Header.
RAWDataHeaderV6
o2::header::RAWDataHeaderV6 RAWDataHeaderV6
Definition
RawPageTestData.h:29
PAGESIZE
auto const PAGESIZE
Definition
benchmark_DPLRawPageSequencer.cxx:25
o2::framework::InputRecord
The input API of the Data Processing Layer This class holds the inputs which are valid for processing...
Definition
InputRecord.h:103
o2::framework::InputSpan
Definition
InputSpan.h:29
o2::framework::InputSpan::size
size_t size() const
Number of elements in the InputSpan.
Definition
InputSpan.h:93
o2::framework::ServiceRegistryRef
Definition
ServiceRegistryRef.h:21
m
const GLfloat * m
Definition
glcorearb.h:4066
v
const GLdouble * v
Definition
glcorearb.h:832
values
GLenum GLsizei GLsizei GLint * values
Definition
glcorearb.h:1576
void
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
o2::framework::test
Definition
RawPageTestData.cxx:22
o2::framework::test::AmendRawDataHeader
std::function< void(RAWDataHeader &)> AmendRawDataHeader
Definition
RawPageTestData.h:69
std
Definition
CcdbObjectInfo.h:121
o2::framework::DataRefIndices
Definition
DataRef.h:35
o2::framework::DataRefIndices::headerIdx
size_t headerIdx
Definition
DataRef.h:36
o2::framework::DataRef
Definition
DataRef.h:24
o2::framework::test::DataSet
Simple helper struct to keep the InputRecord and ownership of messages together with some test data.
Definition
RawPageTestData.h:39
o2::framework::test::DataSet::Messages
std::vector< std::vector< std::unique_ptr< std::vector< char > > > > Messages
Definition
RawPageTestData.h:41
o2::framework::test::DataSet::messages
Messages messages
Definition
RawPageTestData.h:63
o2::framework::test::DataSet::schema
std::vector< InputRoute > schema
Definition
RawPageTestData.h:62
o2::framework::test::DataSet::span
InputSpan span
Definition
RawPageTestData.h:64
o2::framework::test::DataSet::DataSet
DataSet(std::vector< InputRoute > &&s, Messages &&m, std::vector< int > &&v, ServiceRegistryRef registry)
Definition
RawPageTestData.h:42
o2::framework::test::DataSet::values
std::vector< int > values
Definition
RawPageTestData.h:66
o2::framework::test::DataSet::record
InputRecord record
Definition
RawPageTestData.h:65
o2::header::DataHeader
the main header struct
Definition
DataHeader.h:620
o2::header::RAWDataHeaderV6
Definition
RAWDataHeader.h:166
o2::header::Stack
a move-only header stack with serialized headers This is the flat buffer where all the headers in a m...
Definition
Stack.h:33
createData
DataSet createData()
Definition
test_InputRecordWalker.cxx:55
Framework
Utils
test
RawPageTestData.h
Generated on Sun Apr 26 2026 06:43:35 for Project by
1.9.8