Ensure GlAbstraction is not copyable 86/283386/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 25 Oct 2022 14:07:14 +0000 (15:07 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 25 Oct 2022 14:07:14 +0000 (15:07 +0100)
Change-Id: I95f40a776255ebfbba57d9761b3660dd3984b918

dali/integration-api/gl-abstraction.h

index 43ad7df..df82db9 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_GL_ABSTRACTION_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -94,12 +94,17 @@ namespace Integration
 class GlAbstraction
 {
 protected:
-  /**
-   * Virtual protected destructor, no deletion through this interface
-   */
-  virtual ~GlAbstraction() = default;
+  // Protected construction & deletion
+  GlAbstraction()          = default; ///< Protected constructor so an instance of this class cannot be created.
+  virtual ~GlAbstraction() = default; ///< Virtual protected destructor, no deletion through this interface.
 
 public:
+  // Not copyable but movable
+  GlAbstraction(const GlAbstraction&) = delete;            ///< Deleted copy constructor.
+  GlAbstraction(GlAbstraction&&)      = default;           ///< Default move constructor.
+  GlAbstraction& operator=(const GlAbstraction&) = delete; ///< Deleted copy assignment operator.
+  GlAbstraction& operator=(GlAbstraction&&) = default;     ///< Default move assignment operator.
+
   /**
    * Invoked by Render thread before Core::Render.
    */