(ControlRenderer) Added copy constructor and assignment operator 62/48062/1
authorXiangyin Ma <x1.ma@samsung.com>
Fri, 11 Sep 2015 16:57:14 +0000 (17:57 +0100)
committerXiangyin Ma <x1.ma@samsung.com>
Fri, 11 Sep 2015 16:57:14 +0000 (17:57 +0100)
Change-Id: I1f0a514c2adaeeb13e37500b329951d3d241d48b

dali-toolkit/devel-api/controls/renderer-factory/control-renderer.cpp
dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h
dali-toolkit/internal/controls/renderers/gradient/linear-gradient.h
dali-toolkit/internal/controls/renderers/gradient/radial-gradient.h
dali-toolkit/internal/controls/renderers/renderer-factory-cache.h
dali-toolkit/internal/controls/renderers/renderer-factory-impl.h

index 2c8aa07..687949c 100644 (file)
@@ -35,6 +35,17 @@ ControlRenderer::~ControlRenderer()
 {
 }
 
+ControlRenderer::ControlRenderer( const ControlRenderer& handle )
+: BaseHandle( handle )
+{
+}
+
+ControlRenderer& ControlRenderer::operator=( const ControlRenderer& handle )
+{
+  BaseHandle::operator=( handle );
+  return *this;
+}
+
 ControlRenderer::ControlRenderer(Internal::ControlRenderer *impl)
 : BaseHandle(impl)
 {
index 57626d4..8d47e36 100644 (file)
@@ -42,11 +42,34 @@ class DALI_IMPORT_API ControlRenderer : public BaseHandle
 {
 public:
 
+  /**
+   * @brief Create an empty ControlRenderer Handle
+   */
   ControlRenderer();
-  ControlRenderer(Internal::ControlRenderer *impl);
+
+  /**
+   * @brief Destructor
+   *
+   * This is non-virtual since derived Handle types must not contain data or virtual methods.
+   */
   ~ControlRenderer();
 
   /**
+   * @brief This copy constructor is required for (smart) pointer semantics.
+   *
+   * @param[in] handle A reference to the copied handle.
+   */
+  ControlRenderer( const ControlRenderer& handle );
+
+  /**
+   * @brief This assignment operator is required for (smart) pointer semantics.
+   *
+   * @param [in] handle  A reference to the copied handle.
+   * @return A reference to this.
+   */
+  ControlRenderer& operator=( const ControlRenderer& handle );
+
+  /**
    * Set the size of the painting area.
    *
    * @param[in] size The size of the painting area.
@@ -93,6 +116,10 @@ public:
    */
   void SetOffStage( Actor& actor );
 
+public: // Not intended for application developers
+
+  explicit DALI_INTERNAL ControlRenderer(Internal::ControlRenderer *impl);
+
 };
 
 } // namespace Toolkit
index df7fade..099e9bf 100644 (file)
@@ -72,6 +72,14 @@ public:
 
 private:
 
+  // Undefined
+  LinearGradient( const LinearGradient& gradient );
+
+  // Undefined
+  LinearGradient& operator=( const LinearGradient& handle );
+
+private:
+
   Vector2 mStartPosition;
   Vector2 mEndPosition;
 };
index 3e90f5f..f2f2135 100644 (file)
@@ -72,6 +72,14 @@ public:
 
 private:
 
+  // Undefined
+  RadialGradient( const RadialGradient& gradient );
+
+  // Undefined
+  RadialGradient& operator=( const RadialGradient& handle );
+
+private:
+
   Vector2 mCenter;
   float   mRadius;
 };
index 4797c54..e6c8d88 100644 (file)
@@ -109,6 +109,16 @@ protected:
    */
   virtual ~RendererFactoryCache();
 
+  /**
+   * Undefined copy constructor.
+   */
+  RendererFactoryCache(const RendererFactoryCache&);
+
+  /**
+   * Undefined assignment operator.
+   */
+  RendererFactoryCache& operator=(const RendererFactoryCache& rhs);
+
 private:
 
   // ToDo: test whether using the WeakHandle could improve the performance
index c153c53..44af828 100644 (file)
@@ -63,6 +63,18 @@ protected:
 
 private:
 
+  /**
+   * Undefined copy constructor.
+   */
+  RendererFactory(const RendererFactory&);
+
+  /**
+   * Undefined assignment operator.
+   */
+  RendererFactory& operator=(const RendererFactory& rhs);
+
+private:
+
   RendererFactoryCachePtr mFactoryCache;
 };