Skip to content

Commit d170034

Browse files
committed
Rework DCS point classes to have default assign operators
1 parent dc8859b commit d170034

File tree

2 files changed

+11
-28
lines changed

2 files changed

+11
-28
lines changed

Detectors/DCS/include/DetectorsDCS/DataPointCompositeObject.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct DataPointCompositeObject final {
4747
*
4848
* @see ADAPRO::ADAPOS::DataPointIdentifier
4949
*/
50-
const DataPointIdentifier id;
50+
DataPointIdentifier id;
5151

5252
/**
5353
* The DataPointValue object, which occupies the last 64 bytes of the
@@ -85,13 +85,7 @@ struct DataPointCompositeObject final {
8585
*/
8686
DataPointCompositeObject(const DataPointCompositeObject& src) noexcept = default;
8787

88-
DataPointCompositeObject& operator=(const DataPointCompositeObject& src) noexcept
89-
{
90-
if (&src != this) {
91-
memcpy(this, &src, sizeof(DataPointCompositeObject));
92-
}
93-
return *this;
94-
}
88+
DataPointCompositeObject& operator=(const DataPointCompositeObject& src) noexcept = default;
9589

9690
/**
9791
* Bit-by bit equality comparison of DataPointCompositeObjects.

Detectors/DCS/include/DetectorsDCS/DataPointIdentifier.h

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,14 @@ namespace dcs
4141
*/
4242
class DataPointIdentifier final
4343
{
44-
const uint64_t pt1;
45-
const uint64_t pt2;
46-
const uint64_t pt3;
47-
const uint64_t pt4;
48-
const uint64_t pt5;
49-
const uint64_t pt6;
50-
const uint64_t pt7;
51-
const uint64_t pt8; // Contains the last 6 chars of alias and the type.
52-
53-
DataPointIdentifier(
54-
const uint64_t pt1, const uint64_t pt2, const uint64_t pt3,
55-
const uint64_t pt4, const uint64_t pt5, const uint64_t pt6,
56-
const uint64_t pt7, const uint64_t pt8) noexcept : pt1(pt1), pt2(pt2), pt3(pt3), pt4(pt4), pt5(pt5), pt6(pt6), pt7(pt7), pt8(pt8) {}
44+
uint64_t pt1;
45+
uint64_t pt2;
46+
uint64_t pt3;
47+
uint64_t pt4;
48+
uint64_t pt5;
49+
uint64_t pt6;
50+
uint64_t pt7;
51+
uint64_t pt8; // Contains the last 6 chars of alias and the type.
5752

5853
public:
5954
/**
@@ -87,13 +82,7 @@ class DataPointIdentifier final
8782
*/
8883
DataPointIdentifier(const DataPointIdentifier& src) noexcept = default;
8984

90-
DataPointIdentifier& operator=(const DataPointIdentifier& src) noexcept
91-
{
92-
if (&src != this) {
93-
memcpy(this, &src, sizeof(DataPointIdentifier));
94-
}
95-
return *this;
96-
}
85+
DataPointIdentifier& operator=(const DataPointIdentifier& src) noexcept = default;
9786

9887
/**
9988
* This stati procedure fills the given DataPointIdentifier object with

0 commit comments

Comments
 (0)