Merge branch 'devel/master (1.1.2 ~ 1.1.7)' into tizen
[platform/core/uifw/dali-core.git] / dali / public-api / signals / callback.h
index 5dbb60b..ef13365 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_CALLBACK_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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 <cstddef>
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/signals/functor-delegate.h>
 
 namespace Dali
 {
+/**
+ * @addtogroup dali_core_signals
+ * @{
+ */
 
 class CallbackBase;
 
@@ -71,6 +78,10 @@ public:
     {
       (*(callback.mFunction))();
     }
+    else
+    {
+      DALI_ASSERT_ALWAYS( 0 && "no function to execute" );
+    }
   }
 
   /**
@@ -306,7 +317,7 @@ protected: // Constructors for deriving classes
   typedef void (*Dispatcher)( CallbackBase& base );
 
   /**
-   * @brief Used to destroy mObjectPointer (null if not mObjectPointer is not owned)
+   * @brief Used to destroy mObjectPointer (NULL if not mObjectPointer is not owned)
    */
   typedef void(*Destructor)(void* object);
 
@@ -354,9 +365,9 @@ public: // Data for deriving classes & Dispatchers
   {
     Impl();                               ///< Default constructor
 
-    void* mObjectPointer;                 ///< Object whose member function will be called. Not owned if mDestructorDispatcher is null.
+    void* mObjectPointer;                 ///< Object whose member function will be called. Not owned if mDestructorDispatcher is NULL.
     Dispatcher mMemberFunctionDispatcher; ///< Dispatcher for member functions
-    Destructor mDestructorDispatcher;     ///< Destructor for owned objects. null if mDestructorDispatcher is not owned.
+    Destructor mDestructorDispatcher;     ///< Destructor for owned objects. NULL if mDestructorDispatcher is not owned.
   };
   Impl* mImpl;                            ///< Implementation pointer
 
@@ -1081,7 +1092,7 @@ public:
    */
   CallbackFunctor0( const T& object )
   : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object
-                  0, // uses operator() instead of member function
+                  NULL, // uses operator() instead of member function
                   reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcher0<T>::Dispatch ),
                   reinterpret_cast< CallbackBase::Destructor >( &Destroyer<T>::Delete ) ) { }
 };
@@ -1121,7 +1132,7 @@ public:
    */
   CallbackFunctor1( const T& object )
   : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object
-                  0, // uses operator() instead of member function
+                  NULL, // uses operator() instead of member function
                   reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcher1<T,P1>::Dispatch ),
                   reinterpret_cast< CallbackBase::Destructor >( &Destroyer<T>::Delete ) ) { }
 };
@@ -1162,7 +1173,7 @@ public:
    */
   CallbackFunctor2( const T& object )
   : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object
-                  0, // uses operator() instead of member function
+                  NULL, // uses operator() instead of member function
                   reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcher2<T,P1,P2>::Dispatch ),
                   reinterpret_cast< CallbackBase::Destructor >( &Destroyer<T>::Delete ) ) { }
 };
@@ -1203,7 +1214,7 @@ public:
    */
   CallbackFunctor3( const T& object )
   : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object
-                  0, // uses operator() instead of member function
+                  NULL, // uses operator() instead of member function
                   reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcher3<T,P1,P2,P3>::Dispatch ),
                   reinterpret_cast< CallbackBase::Destructor >( &Destroyer<T>::Delete ) ) { }
 };
@@ -1245,7 +1256,7 @@ public:
    */
   CallbackFunctorReturn0( const T& object )
   : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object
-                  0, // uses operator() instead of member function
+                  NULL, // uses operator() instead of member function
                   reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcherReturn0<T,R>::Dispatch ),
                   reinterpret_cast< CallbackBase::Destructor >( &Destroyer<T>::Delete ) ) { }
 };
@@ -1286,7 +1297,7 @@ public:
    */
   CallbackFunctorReturn1( const T& object )
   : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object
-                  0, // uses operator() instead of member function
+                  NULL, // uses operator() instead of member function
                   reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcherReturn1<T,R,P1>::Dispatch ),
                   reinterpret_cast< CallbackBase::Destructor >( &Destroyer<T>::Delete ) ) { }
 };
@@ -1327,7 +1338,7 @@ public:
    */
   CallbackFunctorReturn2( const T& object )
   : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object
-                  0, // uses operator() instead of member function
+                  NULL, // uses operator() instead of member function
                   reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcherReturn2<T,R,P1,P2>::Dispatch ),
                   reinterpret_cast< CallbackBase::Destructor >( &Destroyer<T>::Delete ) ) { }
 };
@@ -1368,7 +1379,7 @@ public:
    */
   CallbackFunctorReturn3( const T& object )
   : CallbackBase( reinterpret_cast< void* >( new T( object ) ), // copy the object
-                  0, // uses operator() instead of member function
+                  NULL, // uses operator() instead of member function
                   reinterpret_cast< CallbackBase::Dispatcher >( &FunctorDispatcherReturn3<T,R,P1,P2,P3>::Dispatch ),
                   reinterpret_cast< CallbackBase::Destructor >( &Destroyer<T>::Delete ) ) { }
 };
@@ -1630,6 +1641,9 @@ inline CallbackBase* MakeCallback( T& object, void(Base::*function)(void) )
   return new Callback< T >( object, function );
 }
 
+/**
+ * @}
+ */
 } // namespace DALI
 
 #endif // __DALI_CALLBACK_H__