Merge "Fix an issue where TapGesture Events are not being received." into devel/master
[platform/core/uifw/dali-core.git] / dali / public-api / object / base-object.h
index 01e5a27..07be7d8 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_BASE_OBJECT_H__
-#define __DALI_BASE_OBJECT_H__
+#ifndef DALI_BASE_OBJECT_H
+#define DALI_BASE_OBJECT_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  *
  */
 
+// EXTERNAL INCLUDES
+#include <memory>
+
 // INTERNAL INCLUDES
-#include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/object/property.h>
+#include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/signals/functor-delegate.h>
 
 namespace Dali
@@ -37,10 +40,9 @@ class BaseHandle;
  * @brief A base class for objects.
  * @SINCE_1_0.0
  */
-class DALI_IMPORT_API BaseObject : public Dali::RefObject
+class DALI_CORE_API BaseObject : public Dali::RefObject
 {
 public:
-
   /**
    * @brief Connects a void() functor to a specified signal.
    *
@@ -51,10 +53,10 @@ public:
    * @return True if the signal was available
    * @pre The signal must be available in this object.
    */
-  template <class T>
-  bool ConnectSignal( ConnectionTrackerInterface* connectionTracker, const std::string& signalName, const T& functor )
+  template<class T>
+  bool ConnectSignal(ConnectionTrackerInterface* connectionTracker, const std::string& signalName, const T& functor)
   {
-    return DoConnectSignal( connectionTracker, signalName, FunctorDelegate::New( functor ) );
+    return DoConnectSignal(connectionTracker, signalName, FunctorDelegate::New(functor));
   }
 
   /**
@@ -73,7 +75,6 @@ public:
   bool GetTypeInfo(Dali::TypeInfo& info) const;
 
 public: // Not intended for application developers
-
   /**
    * @brief Not intended for application developers.
    *
@@ -83,10 +84,9 @@ public: // Not intended for application developers
    * @param[in] functorDelegate A newly allocated functor delegate (takes ownership)
    * @return True if the signal was available
    */
-  bool DoConnectSignal( ConnectionTrackerInterface* connectionTracker, const std::string& signalName, FunctorDelegate* functorDelegate );
+  bool DoConnectSignal(ConnectionTrackerInterface* connectionTracker, const std::string& signalName, FunctorDelegate* functorDelegate);
 
 protected:
-
   /**
    * @brief Default constructor.
    * @SINCE_1_0.0
@@ -97,7 +97,7 @@ protected:
    * @brief A reference counted object may only be deleted by calling Unreference().
    * @SINCE_1_0.0
    */
-  virtual ~BaseObject();
+  ~BaseObject() override;
 
   /**
    * @brief Registers the object as created with the Object registry.
@@ -111,13 +111,18 @@ protected:
    */
   void UnregisterObject();
 
-private:
+  // Not copyable or movable
 
-  // Not implemented
-  DALI_INTERNAL BaseObject(const BaseObject& rhs);
+  BaseObject(const BaseObject& rhs) = delete;            ///< Deleted copy constructor
+  BaseObject(BaseObject&& rhs)      = delete;            ///< Deleted move constructor
+  BaseObject& operator=(const BaseObject& rhs) = delete; ///< Deleted copy assignment operator
+  BaseObject& operator=(BaseObject&& rhs) = delete;      ///< Deleted move assignment operator
 
-  // Not implemented
-  DALI_INTERNAL BaseObject& operator=(const BaseObject& rhs);
+public:
+  class DALI_INTERNAL Impl;
+
+private:
+  std::unique_ptr<Impl> mImpl;
 };
 
 // Helpers for public-api forwarding methods
@@ -131,7 +136,7 @@ private:
  */
 inline BaseObject& GetImplementation(Dali::BaseHandle& handle)
 {
-  DALI_ASSERT_ALWAYS( handle && "BaseObject handle is empty" );
+  DALI_ASSERT_ALWAYS(handle && "BaseObject handle is empty");
 
   return handle.GetBaseObject();
 }
@@ -145,7 +150,7 @@ inline BaseObject& GetImplementation(Dali::BaseHandle& handle)
  */
 inline const BaseObject& GetImplementation(const Dali::BaseHandle& handle)
 {
-  DALI_ASSERT_ALWAYS( handle && "BaseObject handle is empty" );
+  DALI_ASSERT_ALWAYS(handle && "BaseObject handle is empty");
 
   return handle.GetBaseObject();
 }
@@ -155,4 +160,4 @@ inline const BaseObject& GetImplementation(const Dali::BaseHandle& handle)
  */
 } // namespace Dali
 
-# endif // __DALI_BASE_OBJECT_H__
+#endif // __DALI_BASE_OBJECT_H__