Skip to content

Commit 078a3c9

Browse files
committed
Change the way the Delegate and Instance classes are stopped from being copyabel.
1 parent 113b80f commit 078a3c9

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

src/app/clusters/service-area-server/service-area-delegate.h

+7-16
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,22 @@ constexpr size_t kMaxNumProgressElements = 255;
3838

3939
constexpr size_t kMaxSizeStatusText = 256;
4040

41-
/**
42-
* Uncopyable is a helper to ensure that Service Area cluster instances and delegates
43-
* are unique and cannot be copied.
44-
*/
45-
class Uncopyable
46-
{
47-
protected:
48-
Uncopyable() {}
49-
~Uncopyable() = default;
50-
51-
private:
52-
Uncopyable(const Uncopyable &) = delete;
53-
Uncopyable & operator=(const Uncopyable &) = delete;
54-
};
55-
5641
/**
5742
* ServiceArea::Delegate Defines methods for implementing application-specific
5843
* logic for the Service Area Cluster.
5944
*/
60-
class Delegate : public Uncopyable
45+
class Delegate
6146
{
6247
public:
6348
Delegate() = default;
6449
virtual ~Delegate() = default;
6550

51+
/**
52+
* Stop this class objects from being copied.
53+
*/
54+
Delegate(const Delegate &) = delete;
55+
Delegate & operator=(const Delegate &) = delete;
56+
6657
friend class Instance;
6758

6859
protected:

src/app/clusters/service-area-server/service-area-server.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace ServiceArea {
4444
* Custom implementations of the Service Area cluster override functions in the Delegate class
4545
* must be provided to operate with specific devices.
4646
*/
47-
class Instance : public AttributeAccessInterface, public CommandHandlerInterface, public Uncopyable
47+
class Instance : public AttributeAccessInterface, public CommandHandlerInterface
4848
{
4949
public:
5050
/**
@@ -60,6 +60,13 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface
6060

6161
~Instance() override;
6262

63+
/**
64+
* Stop this class objects from being copied.
65+
*/
66+
Instance(const Instance &) = delete;
67+
Instance & operator=(const Instance &) = delete;
68+
69+
6370
/**
6471
* @brief Initialise the Service Area server instance.
6572
* @return an error if the given endpoint and cluster Id have not been enabled in zap or if the

0 commit comments

Comments
 (0)