Project
Loading...
Searching...
No Matches
RDHAny.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
// @brief placeholder class for arbitraty-version 64B-lonh RDH
13
// @author ruben.shahoyan@cern.ch
14
15
#ifndef ALICEO2_HEADER_RDHANY_H
16
#define ALICEO2_HEADER_RDHANY_H
17
#include "
GPUCommonDef.h
"
18
#include "
Headers/RAWDataHeader.h
"
19
#ifndef GPUCA_GPUCODE_DEVICE
20
#include <type_traits>
21
#include <stdexcept>
22
#endif
23
24
namespace
o2
25
{
26
namespace
header
27
{
28
29
struct
RDHAny
{
30
uint64_t
word0
= 0x0;
31
uint64_t
word1
= 0x0;
32
uint64_t
word2
= 0x0;
33
uint64_t
word3
= 0x0;
34
uint64_t
word4
= 0x0;
35
uint64_t
word5
= 0x0;
36
uint64_t
word6
= 0x0;
37
uint64_t
word7
= 0x0;
38
39
RDHAny
(
int
v
= 0);
// 0 for default version
40
41
template
<
typename
H>
42
RDHAny
(
const
H& rdh);
43
44
template
<
typename
H>
45
RDHAny
&
operator=
(
const
H& rdh);
46
47
//------------------ service methods
48
using
RDHv4
=
o2::header::RAWDataHeaderV4
;
// V3 == V4
49
using
RDHv5
=
o2::header::RAWDataHeaderV5
;
50
using
RDHv6
=
o2::header::RAWDataHeaderV6
;
51
using
RDHv7
=
o2::header::RAWDataHeaderV7
;
// update this for every new version
52
54
template
<
typename
RDH>
55
GPUhdi
() static constexpr
void
sanityCheckStrict()
56
{
57
#ifndef GPUCA_GPUCODE_DEVICE
58
static_assert
(std::is_same<RDH, RDHv4>::value || std::is_same<RDH, RDHv5>::value ||
59
std::is_same<RDH, RDHv6>::value || std::is_same<RDH, RDHv7>::value,
60
"not an RDH"
);
61
#endif
62
}
63
65
template
<
typename
RDH>
66
GPUhdi
() static constexpr
void
sanityCheckLoose()
67
{
68
#ifndef GPUCA_GPUCODE_DEVICE
69
static_assert
(std::is_same<RDH, RDHv4>::value || std::is_same<RDH, RDHv5>::value ||
70
std::is_same<RDH, RDHv6>::value || std::is_same<RDH, RDHv7>::value || std::is_same<RDHAny, RDH>::value,
71
"not an RDH or RDHAny"
);
72
#endif
73
}
74
75
template
<
typename
H>
76
GPUhdi
() static const
void
* voidify(const H& rdh)
77
{
78
sanityCheckLoose<H>();
79
return
reinterpret_cast<
const
void
*
>
(&rdh);
80
}
81
82
template
<
typename
H>
83
GPUhdi
() static
void
* voidify(H& rdh)
84
{
85
sanityCheckLoose<H>();
86
return
reinterpret_cast<
void
*
>
(&rdh);
87
}
88
89
GPUhdi
() const
void
* voidify()
const
{
return
voidify(*
this
); }
90
GPUhdi
()
void
* voidify() {
return
voidify(*
this
); }
91
92
template
<
typename
H>
93
GPUhdi
() H* as_ptr()
94
{
95
sanityCheckLoose<H>();
96
return
reinterpret_cast<
H*
>
(
this
);
97
}
98
99
template
<
typename
H>
100
GPUhdi
() H& as_ref()
101
{
102
sanityCheckLoose<H>();
103
return
reinterpret_cast<
H&
>
(
this
);
104
}
105
106
protected
:
107
void
copyFrom
(
const
void
* rdh);
108
};
109
112
template
<
typename
H>
113
inline
RDHAny::RDHAny
(
const
H& rdh)
114
{
115
sanityCheckLoose<H>();
116
copyFrom
(&rdh);
117
}
118
121
template
<
typename
H>
122
inline
RDHAny
&
RDHAny::operator=
(
const
H& rdh)
123
{
124
sanityCheckLoose<H>();
125
if
(
this
!= voidify(rdh)) {
126
copyFrom
(&rdh);
127
}
128
return
*
this
;
129
}
130
131
}
// namespace header
132
}
// namespace o2
133
134
#endif
GPUCommonDef.h
RAWDataHeader.h
Definition of the RAW Data Header.
v
const GLdouble * v
Definition
glcorearb.h:832
void
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
o2::header::RAWDataHeaderV4
Definition
RAWDataHeader.h:382
o2::header::RAWDataHeaderV5
Definition
RAWDataHeader.h:259
o2::header::RAWDataHeaderV6
Definition
RAWDataHeader.h:166
o2::header::RAWDataHeaderV7
Definition
RAWDataHeader.h:71
o2::header::RDHAny
Definition
RDHAny.h:29
o2::header::RDHAny::operator=
RDHAny & operator=(const H &rdh)
Definition
RDHAny.h:122
o2::header::RDHAny::copyFrom
void copyFrom(const void *rdh)
Definition
RDHAny.cxx:39
o2::header::RDHAny::word7
uint64_t word7
Definition
RDHAny.h:37
o2::header::RDHAny::GPUhdi
GPUhdi() H &as_ref()
Definition
RDHAny.h:100
o2::header::RDHAny::GPUhdi
GPUhdi() H *as_ptr()
Definition
RDHAny.h:93
o2::header::RDHAny::GPUhdi
GPUhdi() void *voidify()
Definition
RDHAny.h:90
o2::header::RDHAny::RDHAny
RDHAny(int v=0)
placeholder copied from specific version
Definition
RDHAny.cxx:23
o2::header::RDHAny::GPUhdi
GPUhdi() static void *voidify(H &rdh)
Definition
RDHAny.h:83
o2::header::RDHAny::word6
uint64_t word6
Definition
RDHAny.h:36
o2::header::RDHAny::GPUhdi
GPUhdi() static const expr void sanityCheckLoose()
make sure we RDH is a legitimate RAWDataHeader or generic RDHAny placeholder
Definition
RDHAny.h:66
o2::header::RDHAny::word0
uint64_t word0
Definition
RDHAny.h:30
o2::header::RDHAny::GPUhdi
GPUhdi() static const void *voidify(const H &rdh)
Definition
RDHAny.h:76
o2::header::RDHAny::word1
uint64_t word1
Definition
RDHAny.h:31
o2::header::RDHAny::GPUhdi
GPUhdi() const void *voidify() const
Definition
RDHAny.h:89
o2::header::RDHAny::word3
uint64_t word3
Definition
RDHAny.h:33
o2::header::RDHAny::word2
uint64_t word2
Definition
RDHAny.h:32
o2::header::RDHAny::GPUhdi
GPUhdi() static const expr void sanityCheckStrict()
make sure we RDH is a legitimate RAWDataHeader
Definition
RDHAny.h:55
o2::header::RDHAny::word4
uint64_t word4
Definition
RDHAny.h:34
o2::header::RDHAny::word5
uint64_t word5
Definition
RDHAny.h:35
DataFormats
Headers
include
Headers
RDHAny.h
Generated on Tue Feb 25 2025 17:02:53 for Project by
1.9.8