Merge "Changed WeakHandle::GetHandle() method to use a DownCast<T> instead of a reint...
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Fri, 9 Oct 2015 15:31:22 +0000 (08:31 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Fri, 9 Oct 2015 15:31:23 +0000 (08:31 -0700)
dali/devel-api/object/weak-handle.h

index 2e24758..81613f5 100644 (file)
@@ -99,38 +99,6 @@ protected:
   Impl* mImpl;
 };
 
-/**
- * @brief Type CustomActors support
- */
-template <typename Type>
-struct CustomActors
-{
-  /**
-   * This flag tells Dali if a class is derived from CustomActor.
-   */
-  enum { IS_CUSTOM_ACTOR = __is_base_of(Dali::CustomActor, Type) };
-};
-
-template <typename Type>
-struct TypeCustomActors : public CustomActors< Type >
-{
-};
-
-template < bool CustomActorType >
-class InternalTypeName
-{
-public: // Typedefs
-
-  typedef Dali::Internal::CustomActor InternalObjectType;
-};
-
-template <>
-class InternalTypeName< false >
-{
-public: // Typedefs
-
-  typedef Dali::Internal::Actor InternalObjectType;
-};
 
 /**
  * @brief Weak handle for the given type of Dali object.
@@ -138,10 +106,6 @@ public: // Typedefs
 template < class T >
 class WeakHandle : public WeakHandleBase
 {
-public: // Typedefs
-
-  typedef typename InternalTypeName< TypeCustomActors<T>::IS_CUSTOM_ACTOR >::InternalObjectType InternalObjectType;
-
 public:
 
   /**
@@ -201,12 +165,12 @@ public:
   /**
    * @copydoc Dali::WeakHandleBase::GetHandle()
    */
-  T GetHandle()
+  T GetHandle() const
   {
     Handle handle( GetBaseHandle() );
     if( handle )
     {
-      return T( reinterpret_cast< InternalObjectType* >( handle.GetObjectPtr() ) );
+      return DownCast< T >( handle );
     }
     else
     {