Project
Loading...
Searching...
No Matches
DataPointCreator.cxx
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
#include "
DetectorsDCS/DataPointCreator.h
"
13
14
namespace
15
{
16
o2::dcs::DataPointCompositeObject
createDPCOM(
const
std::string& alias,
const
uint64_t*
val
, uint32_t seconds, uint16_t msec, uint16_t
flags
,
o2::dcs::DeliveryType
dt)
17
{
18
auto
dpid =
o2::dcs::DataPointIdentifier
(alias, dt);
19
auto
dpval =
o2::dcs::DataPointValue
(
20
flags
,
21
msec,
22
seconds,
23
val
,
24
dt);
25
return
o2::dcs::DataPointCompositeObject
(dpid, dpval);
26
}
27
}
// namespace
28
29
namespace
o2::dcs
30
{
31
template
<>
32
DataPointCompositeObject
createDataPointCompositeObject
(
const
std::string& alias,
double
val
, uint32_t seconds, uint16_t msec, uint16_t
flags
)
33
{
34
return
createDPCOM(alias,
reinterpret_cast<
const
uint64_t*
>
(&
val
), seconds, msec,
flags
, DeliveryType::DPVAL_DOUBLE);
35
}
36
37
template
<>
38
DataPointCompositeObject
createDataPointCompositeObject
(
const
std::string& alias,
float
val
, uint32_t seconds, uint16_t msec, uint16_t
flags
)
39
{
40
uint64_t tmp = 0;
41
memcpy(&tmp, &
val
,
sizeof
(
val
));
42
return
createDPCOM(alias, &tmp, seconds, msec,
flags
, DeliveryType::DPVAL_FLOAT);
43
}
44
45
template
<>
46
DataPointCompositeObject
createDataPointCompositeObject
(
const
std::string& alias, int32_t
val
, uint32_t seconds, uint16_t msec, uint16_t
flags
)
47
{
48
int64_t
tmp{
val
};
49
return
createDPCOM(alias,
reinterpret_cast<
const
uint64_t*
>
(&tmp), seconds, msec,
flags
, DeliveryType::DPVAL_INT);
50
}
51
52
template
<>
53
DataPointCompositeObject
createDataPointCompositeObject
(
const
std::string& alias, uint32_t
val
, uint32_t seconds, uint16_t msec, uint16_t
flags
)
54
{
55
uint64_t tmp{
val
};
56
return
createDPCOM(alias, &tmp, seconds, msec,
flags
, DeliveryType::DPVAL_UINT);
57
}
58
59
template
<>
60
DataPointCompositeObject
createDataPointCompositeObject
(
const
std::string& alias,
long
long
val
, uint32_t seconds, uint16_t msec, uint16_t
flags
)
61
{
62
uint64_t tmp{
static_cast<
uint64_t
>
(
val
)};
63
return
createDPCOM(alias, &tmp, seconds, msec,
flags
, DeliveryType::DPVAL_UINT);
64
}
65
66
template
<>
67
DataPointCompositeObject
createDataPointCompositeObject
(
const
std::string& alias,
char
val
, uint32_t seconds, uint16_t msec, uint16_t
flags
)
68
{
69
uint64_t tmp = 0;
70
memcpy(&tmp, &
val
, 1);
71
return
createDPCOM(alias, &tmp, seconds, msec,
flags
, DeliveryType::DPVAL_CHAR);
72
}
73
74
template
<>
75
DataPointCompositeObject
createDataPointCompositeObject
(
const
std::string& alias,
bool
val
, uint32_t seconds, uint16_t msec, uint16_t
flags
)
76
{
77
uint64_t tmp{
val
};
78
return
createDPCOM(alias, &tmp, seconds, msec,
flags
, DeliveryType::DPVAL_BOOL);
79
}
80
81
template
<>
82
DataPointCompositeObject
createDataPointCompositeObject
(
const
std::string& alias, std::string
val
, uint32_t seconds, uint16_t msec, uint16_t
flags
)
83
{
84
constexpr
int
N{56};
85
uint64_t tmp[N /
sizeof
(uint64_t)];
86
strncpy((
char
*)tmp,
val
.c_str(), N);
87
return
createDPCOM(alias, tmp, seconds, msec,
flags
, DeliveryType::DPVAL_STRING);
88
}
89
90
}
// namespace o2::dcs
DataPointCreator.h
int64_t
o2::dcs::DataPointIdentifier
Definition
DataPointIdentifier.h:43
val
GLuint GLfloat * val
Definition
glcorearb.h:1582
flags
GLbitfield flags
Definition
glcorearb.h:1570
o2::dcs
Definition
DCSConfigObject.h:26
o2::dcs::createDataPointCompositeObject
o2::dcs::DataPointCompositeObject createDataPointCompositeObject(const std::string &alias, T val, uint32_t seconds, uint16_t msec, uint16_t flags=0)
o2::dcs::DeliveryType
DeliveryType
Definition
DeliveryType.h:45
o2::dcs::DataPointCompositeObject
Definition
DataPointCompositeObject.h:42
o2::dcs::DataPointValue
Definition
DataPointValue.h:48
Detectors
DCS
src
DataPointCreator.cxx
Generated on Thu Feb 12 2026 10:11:00 for Project by
1.9.8