Skip to content

Commit 2fd2782

Browse files
authored
Fix rule of five violation. (#1436)
Added copy and move constructors and operators to classes with virtual destructors. Changed some Impl classes to final. Resolves: OLPEDGE-2838 Signed-off-by: Yevhen Krasilnyk <[email protected]>
1 parent 4438057 commit 2fd2782

30 files changed

+305
-66
lines changed

olp-cpp-sdk-dataservice-read/include/olp/dataservice/read/model/Catalog.h

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 HERE Europe B.V.
2+
* Copyright (C) 2019-2023 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,6 +36,10 @@ namespace model {
3636
class DATASERVICE_READ_API Coverage {
3737
public:
3838
Coverage() = default;
39+
Coverage(const Coverage&) = default;
40+
Coverage(Coverage&&) = default;
41+
Coverage& operator=(const Coverage&) = default;
42+
Coverage& operator=(Coverage&&) = default;
3943
virtual ~Coverage() = default;
4044

4145
private:
@@ -78,6 +82,10 @@ class DATASERVICE_READ_API Coverage {
7882
class DATASERVICE_READ_API IndexDefinition {
7983
public:
8084
IndexDefinition() = default;
85+
IndexDefinition(const IndexDefinition&) = default;
86+
IndexDefinition(IndexDefinition&&) = default;
87+
IndexDefinition& operator=(const IndexDefinition&) = default;
88+
IndexDefinition& operator=(IndexDefinition&&) = default;
8189
virtual ~IndexDefinition() = default;
8290

8391
private:
@@ -183,6 +191,10 @@ class DATASERVICE_READ_API IndexDefinition {
183191
class DATASERVICE_READ_API IndexProperties {
184192
public:
185193
IndexProperties() = default;
194+
IndexProperties(const IndexProperties&) = default;
195+
IndexProperties(IndexProperties&&) = default;
196+
IndexProperties& operator=(const IndexProperties&) = default;
197+
IndexProperties& operator=(IndexProperties&&) = default;
186198
virtual ~IndexProperties() = default;
187199

188200
private:
@@ -250,6 +262,10 @@ class DATASERVICE_READ_API IndexProperties {
250262
class DATASERVICE_READ_API Creator {
251263
public:
252264
Creator() = default;
265+
Creator(const Creator&) = default;
266+
Creator(Creator&&) = default;
267+
Creator& operator=(const Creator&) = default;
268+
Creator& operator=(Creator&&) = default;
253269
virtual ~Creator() = default;
254270

255271
private:
@@ -289,6 +305,10 @@ class DATASERVICE_READ_API Creator {
289305
class DATASERVICE_READ_API Owner {
290306
public:
291307
Owner() = default;
308+
Owner(const Owner&) = default;
309+
Owner(Owner&&) = default;
310+
Owner& operator=(const Owner&) = default;
311+
Owner& operator=(Owner&&) = default;
292312
virtual ~Owner() = default;
293313

294314
private:
@@ -346,6 +366,10 @@ class DATASERVICE_READ_API Owner {
346366
class DATASERVICE_READ_API Partitioning {
347367
public:
348368
Partitioning() = default;
369+
Partitioning(const Partitioning&) = default;
370+
Partitioning(Partitioning&&) = default;
371+
Partitioning& operator=(const Partitioning&) = default;
372+
Partitioning& operator=(Partitioning&&) = default;
349373
virtual ~Partitioning() = default;
350374

351375
private:
@@ -425,6 +449,10 @@ class DATASERVICE_READ_API Partitioning {
425449
class DATASERVICE_READ_API Schema {
426450
public:
427451
Schema() = default;
452+
Schema(const Schema&) = default;
453+
Schema(Schema&&) = default;
454+
Schema& operator=(const Schema&) = default;
455+
Schema& operator=(Schema&&) = default;
428456
virtual ~Schema() = default;
429457

430458
private:
@@ -457,6 +485,10 @@ class DATASERVICE_READ_API Schema {
457485
class DATASERVICE_READ_API StreamProperties {
458486
public:
459487
StreamProperties() = default;
488+
StreamProperties(const StreamProperties&) = default;
489+
StreamProperties(StreamProperties&&) = default;
490+
StreamProperties& operator=(const StreamProperties&) = default;
491+
StreamProperties& operator=(StreamProperties&&) = default;
460492
virtual ~StreamProperties() = default;
461493

462494
private:
@@ -544,6 +576,10 @@ class DATASERVICE_READ_API StreamProperties {
544576
class DATASERVICE_READ_API Encryption {
545577
public:
546578
Encryption() = default;
579+
Encryption(const Encryption&) = default;
580+
Encryption(Encryption&&) = default;
581+
Encryption& operator=(const Encryption&) = default;
582+
Encryption& operator=(Encryption&&) = default;
547583
virtual ~Encryption() = default;
548584

549585
private:
@@ -576,6 +612,10 @@ class DATASERVICE_READ_API Encryption {
576612
class DATASERVICE_READ_API Volume {
577613
public:
578614
Volume() = default;
615+
Volume(const Volume&) = default;
616+
Volume(Volume&&) = default;
617+
Volume& operator=(const Volume&) = default;
618+
Volume& operator=(Volume&&) = default;
579619
virtual ~Volume() = default;
580620

581621
private:
@@ -675,6 +715,10 @@ class DATASERVICE_READ_API Volume {
675715
class DATASERVICE_READ_API Layer {
676716
public:
677717
Layer() = default;
718+
Layer(const Layer&) = default;
719+
Layer(Layer&&) = default;
720+
Layer& operator=(const Layer&) = default;
721+
Layer& operator=(Layer&&) = default;
678722
virtual ~Layer() = default;
679723

680724
private:
@@ -1117,6 +1161,10 @@ class DATASERVICE_READ_API Layer {
11171161
class DATASERVICE_READ_API Notifications {
11181162
public:
11191163
Notifications() = default;
1164+
Notifications(const Notifications&) = default;
1165+
Notifications(Notifications&&) = default;
1166+
Notifications& operator=(const Notifications&) = default;
1167+
Notifications& operator=(Notifications&&) = default;
11201168
virtual ~Notifications() = default;
11211169

11221170
private:
@@ -1155,6 +1203,10 @@ class DATASERVICE_READ_API Notifications {
11551203
class DATASERVICE_READ_API Catalog {
11561204
public:
11571205
Catalog() = default;
1206+
Catalog(const Catalog&) = default;
1207+
Catalog(Catalog&&) = default;
1208+
Catalog& operator=(const Catalog&) = default;
1209+
Catalog& operator=(Catalog&&) = default;
11581210
virtual ~Catalog() = default;
11591211

11601212
private:

olp-cpp-sdk-dataservice-read/include/olp/dataservice/read/model/Partitions.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 HERE Europe B.V.
2+
* Copyright (C) 2019-2023 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,8 +20,8 @@
2020
#pragma once
2121

2222
#include <string>
23-
#include <vector>
2423
#include <utility>
24+
#include <vector>
2525

2626
#include <boost/optional.hpp>
2727

@@ -38,6 +38,10 @@ namespace model {
3838
class DATASERVICE_READ_API Partition {
3939
public:
4040
Partition() = default;
41+
Partition(const Partition&) = default;
42+
Partition(Partition&&) = default;
43+
Partition& operator=(const Partition&) = default;
44+
Partition& operator=(Partition&&) = default;
4145
virtual ~Partition() = default;
4246

4347
private:
@@ -281,6 +285,10 @@ class DATASERVICE_READ_API Partition {
281285
class Partitions {
282286
public:
283287
Partitions() = default;
288+
Partitions(const Partitions&) = default;
289+
Partitions(Partitions&&) = default;
290+
Partitions& operator=(const Partitions&) = default;
291+
Partitions& operator=(Partitions&&) = default;
284292
virtual ~Partitions() = default;
285293

286294
private:

olp-cpp-sdk-dataservice-read/include/olp/dataservice/read/model/VersionResponse.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 HERE Europe B.V.
2+
* Copyright (C) 2019-2023 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,6 +39,10 @@ namespace model {
3939
class DATASERVICE_READ_API VersionResponse {
4040
public:
4141
VersionResponse() = default;
42+
VersionResponse(const VersionResponse&) = default;
43+
VersionResponse(VersionResponse&&) = default;
44+
VersionResponse& operator=(const VersionResponse&) = default;
45+
VersionResponse& operator=(VersionResponse&&) = default;
4246
virtual ~VersionResponse() = default;
4347

4448
private:

olp-cpp-sdk-dataservice-read/src/generated/model/Api.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019 HERE Europe B.V.
2+
* Copyright (C) 2019-2023 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,6 +36,10 @@ namespace model {
3636
class Api {
3737
public:
3838
Api() = default;
39+
Api(const Api&) = default;
40+
Api(Api&&) = default;
41+
Api& operator=(const Api&) = default;
42+
Api& operator=(Api&&) = default;
3943
virtual ~Api() = default;
4044

4145
private:

olp-cpp-sdk-dataservice-read/src/generated/model/Index.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 HERE Europe B.V.
2+
* Copyright (C) 2019-2023 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,6 +32,10 @@ namespace model {
3232
class ParentQuad {
3333
public:
3434
ParentQuad() = default;
35+
ParentQuad(const ParentQuad&) = default;
36+
ParentQuad(ParentQuad&&) = default;
37+
ParentQuad& operator=(const ParentQuad&) = default;
38+
ParentQuad& operator=(ParentQuad&&) = default;
3539
virtual ~ParentQuad() = default;
3640

3741
private:
@@ -119,6 +123,10 @@ class ParentQuad {
119123
class SubQuad {
120124
public:
121125
SubQuad() = default;
126+
SubQuad(const SubQuad&) = default;
127+
SubQuad(SubQuad&&) = default;
128+
SubQuad& operator=(const SubQuad&) = default;
129+
SubQuad& operator=(SubQuad&&) = default;
122130
virtual ~SubQuad() = default;
123131

124132
private:
@@ -220,6 +228,10 @@ class SubQuad {
220228
class Index {
221229
public:
222230
Index() = default;
231+
Index(const Index&) = default;
232+
Index(Index&&) = default;
233+
Index& operator=(const Index&) = default;
234+
Index& operator=(Index&&) = default;
223235
virtual ~Index() = default;
224236

225237
private:

olp-cpp-sdk-dataservice-read/src/generated/model/LayerVersions.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019 HERE Europe B.V.
2+
* Copyright (C) 2019-2023 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,6 +33,10 @@ namespace model {
3333
class LayerVersion {
3434
public:
3535
LayerVersion() = default;
36+
LayerVersion(const LayerVersion&) = default;
37+
LayerVersion(LayerVersion&&) = default;
38+
LayerVersion& operator=(const LayerVersion&) = default;
39+
LayerVersion& operator=(LayerVersion&&) = default;
3640
virtual ~LayerVersion() = default;
3741

3842
private:
@@ -60,6 +64,10 @@ class LayerVersion {
6064
class LayerVersions {
6165
public:
6266
LayerVersions() = default;
67+
LayerVersions(const LayerVersions&) = default;
68+
LayerVersions(LayerVersions&&) = default;
69+
LayerVersions& operator=(const LayerVersions&) = default;
70+
LayerVersions& operator=(LayerVersions&&) = default;
6371
virtual ~LayerVersions() = default;
6472

6573
private:

olp-cpp-sdk-dataservice-write/include/olp/dataservice/write/generated/model/Details.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 HERE Europe B.V.
2+
* Copyright (C) 2019-2023 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,6 +32,10 @@ namespace model {
3232
class DATASERVICE_WRITE_API Details {
3333
public:
3434
Details() = default;
35+
Details(const Details&) = default;
36+
Details(Details&&) = default;
37+
Details& operator=(const Details&) = default;
38+
Details& operator=(Details&&) = default;
3539
virtual ~Details() = default;
3640

3741
private:

olp-cpp-sdk-dataservice-write/include/olp/dataservice/write/generated/model/Index.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 HERE Europe B.V.
2+
* Copyright (C) 2019-2023 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -74,7 +74,6 @@ class DATASERVICE_WRITE_API IndexValue {
7474
* @param type The`IndexType` instance.
7575
*/
7676
explicit IndexValue(IndexType type) : indexType_(type) {}
77-
virtual ~IndexValue() = default;
7877

7978
/// A default copy constructor.
8079
IndexValue(const IndexValue&) = default;
@@ -88,6 +87,9 @@ class DATASERVICE_WRITE_API IndexValue {
8887
/// A default copy assignment operator.
8988
IndexValue& operator=(const IndexValue&) = default;
9089

90+
/// A default virtual destructor.
91+
virtual ~IndexValue() = default;
92+
9193
/**
9294
* @brief Gets the index value type.
9395
*
@@ -152,8 +154,6 @@ class DATASERVICE_WRITE_API IntIndexValue final : public IndexValue {
152154
int64_t intValue_{0};
153155

154156
public:
155-
virtual ~IntIndexValue() = default;
156-
157157
/**
158158
* @brief Creates the `IntIndexValue` instance.
159159
*
@@ -191,8 +191,6 @@ class DATASERVICE_WRITE_API StringIndexValue final : public IndexValue {
191191
std::string stringValue_;
192192

193193
public:
194-
virtual ~StringIndexValue() = default;
195-
196194
/**
197195
* @brief Creates the `StringIndexValue` instance.
198196
*
@@ -229,8 +227,6 @@ class DATASERVICE_WRITE_API TimeWindowIndexValue final : public IndexValue {
229227
int64_t timeWindowValue_{0};
230228

231229
public:
232-
virtual ~TimeWindowIndexValue() = default;
233-
234230
/**
235231
* @brief Creates the `TimeWindowIndexValue` instance.
236232
*
@@ -316,7 +312,6 @@ class DATASERVICE_WRITE_API Index final {
316312
public:
317313
/// A default constructor.
318314
Index() = default;
319-
virtual ~Index() = default;
320315

321316
/**
322317
* @brief Creates the `Index` insatnce.

0 commit comments

Comments
 (0)