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
, size_t part) {
46
auto
header =
static_cast<
char
const*
>
(this->
messages
[
i
].at(2 * part)->data());
47
auto
payload =
static_cast<
char
const*
>
(this->
messages
[
i
].at(2 * part + 1)->data());
48
return
DataRef
{
nullptr
, header, payload};
49
},
50
[
this
](
size_t
i
) {
return
i
< this->
messages
.size() ?
messages
[
i
].size() / 2 : 0; }, this->
messages
.size()},
51
record{schema, span, registry},
52
values
{std::move(
v
)}
53
{
54
}
55
56
std::vector<InputRoute>
schema
;
57
Messages
messages
;
58
InputSpan
span
;
59
InputRecord
record
;
60
std::vector<int>
values
;
61
};
62
63
using
AmendRawDataHeader
= std::function<
void
(
RAWDataHeader
&)>;
64
DataSet
createData
(std::vector<InputSpec>
const
& inputspecs, std::vector<DataHeader>
const
& dataheaders,
AmendRawDataHeader
amendRdh =
nullptr
);
65
66
}
// namespace o2::framework
67
#endif
// FRAMEWORK_UTILS_RAWPAGETESTDATA_H
DataHeader.h
i
int32_t i
Definition
GPUCommonAlgorithm.h:443
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:102
o2::framework::InputSpan
Definition
InputSpan.h:29
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:63
std
Defining DataPointCompositeObject explicitly as copiable.
Definition
CcdbObjectInfo.h:121
o2::framework::DataRef
Definition
DataRef.h:23
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:57
o2::framework::test::DataSet::schema
std::vector< InputRoute > schema
Definition
RawPageTestData.h:56
o2::framework::test::DataSet::span
InputSpan span
Definition
RawPageTestData.h:58
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:60
o2::framework::test::DataSet::record
InputRecord record
Definition
RawPageTestData.h:59
o2::header::DataHeader
the main header struct
Definition
DataHeader.h:618
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:36
createData
DataSet createData()
Definition
test_InputRecordWalker.cxx:59
Framework
Utils
test
RawPageTestData.h
Generated on Tue Feb 25 2025 23:16:42 for Project by
1.9.8