#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>
{
(*(callback.mFunction))();
}
+ else
+ {
+ DALI_ASSERT_ALWAYS( 0 && "no function to execute" );
+ }
}
/**
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);
{
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
*/
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 ) ) { }
};
*/
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 ) ) { }
};
*/
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 ) ) { }
};
*/
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 ) ) { }
};
*/
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 ) ) { }
};
*/
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 ) ) { }
};
*/
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 ) ) { }
};
*/
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 ) ) { }
};