*
*/
+// EXTERNAL INCLUDES
+#include <cstddef> // NULL
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
*/
OwnerPointer()
{
- mObject = 0;
+ mObject = NULL;
}
/**
*/
T& operator*()
{
- DALI_ASSERT_DEBUG( mObject != 0 );
+ DALI_ASSERT_DEBUG( mObject != NULL );
return *mObject;
}
*/
T& operator*() const
{
- DALI_ASSERT_DEBUG( mObject != 0 );
+ DALI_ASSERT_DEBUG( mObject != NULL );
// Pointer semantics: A const pointer does not mean const data.
return const_cast< T& >( *mObject );
*/
void Reset()
{
- if ( mObject != 0 )
+ if ( mObject != NULL )
{
delete mObject;
- mObject = 0;
+ mObject = NULL;
}
}
T* Release()
{
T* tmp = mObject;
- mObject = 0;
+ mObject = NULL;
return tmp;
}
/**
* Converts an object handle to a BooleanType.
- * This is useful for checking whether the handle is null.
+ * This is useful for checking whether the handle is NULL.
*/
operator BooleanType() const
{
- return (mObject != 0) ? &OwnerPointer::ThisIsSaferThanReturningVoidStar : 0;
+ return (mObject != NULL) ? &OwnerPointer::ThisIsSaferThanReturningVoidStar : NULL;
}
private:
void Init( OwnerPointer& ownerPointer )
{
mObject = ownerPointer.mObject;
- ownerPointer.mObject = 0;
+ ownerPointer.mObject = NULL;
}
// data
*
*/
+// EXTERNAL INCLUDES
+#include <cstddef> // NULL
+
// INTERNAL INCLUDES
#include <dali/internal/common/message.h>
/**
* Retrieve the parent node of a NodeAttachment.
- * @return The parent node, or null if the NodeAttachment has not been added to the scene-graph.
+ * @return The parent node, or NULL if the NodeAttachment has not been added to the scene-graph.
*/
Node& GetParent()
{
- DALI_ASSERT_DEBUG( mParent != 0 );
+ DALI_ASSERT_DEBUG( mParent != NULL );
return *mParent;
}
/**
* Retrieve the parent node of a NodeAttachment.
- * @return The parent node, or null if the NodeAttachment has not been added to the scene-graph.
+ * @return The parent node, or NULL if the NodeAttachment has not been added to the scene-graph.
*/
Node& GetParent() const
{
- DALI_ASSERT_DEBUG( mParent != 0 );
+ DALI_ASSERT_DEBUG( mParent != NULL );
return *mParent;
}
*/
bool IsRenderable()
{
- return (GetRenderable() != 0);
+ return (GetRenderable() != NULL);
}
/**
* Convert an attachment to a renderable attachment.
- * @return A pointer to the renderable attachment, or null.
+ * @return A pointer to the renderable attachment, or NULL.
*/
virtual RenderableAttachment* GetRenderable() = 0;
// EXTERNAL INCLUDES
#include <typeinfo> // operator typeid
+#include <cstddef> // NULL
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
Any( const Any& any )
{
// If container isn't empty then copy the container?
- if ( 0 != any.mContainer )
+ if ( NULL != any.mContainer )
{
mContainer = any.mContainer->mCloneFunc( *any.mContainer );
}
else
{
// Otherwise mark new container as empty
- mContainer = 0;
+ mContainer = NULL;
}
}
Any& operator=( const Type& value )
{
// If the container is empty then assign the new value
- if ( 0 == mContainer )
+ if ( NULL == mContainer )
{
mContainer = new AnyContainerImpl< Type >( value );
}
const Type& Get() const
{
- if ( 0 == mContainer )
+ if ( NULL == mContainer )
{
- AssertAlways( "Any::Get(). mContainer is null" );
+ AssertAlways( "Any::Get(). mContainer is NULL" );
}
// Check if the value has the same value than the Any type.
/**
* @brief Return pointer of Type to the value stored
*
- * @return pointer to the value or null if no value is contained
+ * @return pointer to the value or NULL if no value is contained
*/
template<typename Type>
Type* GetPointer()
{
- if( 0 == mContainer )
+ if( NULL == mContainer )
{
- return 0;
+ return NULL;
}
// Check if the value has the same value than the Any type.
if( mContainer->GetType() != typeid( Type ) )
/**
* @brief Return pointer of Type to the value stored
*
- * @return pointer to the value or null if no value is contained
+ * @return pointer to the value or NULL if no value is contained
*/
template<typename Type>
const Type* GetPointer() const
{
- if( 0 == mContainer )
+ if( NULL == mContainer )
{
- return 0;
+ return NULL;
}
// Check if the value has the same value than the Any type.
if( mContainer->GetType() != typeid( Type ) )
*/
bool Empty() const
{
- return ( 0 == mContainer ) ? true : false;
+ return ( NULL == mContainer ) ? true : false;
}
struct AnyContainerBase; // Forward declaration for typedef
*/
/**
- * @brief Extract a pointer to the held type of an Any object from a pointer to that Any object (null if empty )
+ * @brief Extract a pointer to the held type of an Any object from a pointer to that Any object (NULL if empty )
*
* @param any Pointer to an Any object
*
}
/**
- * @brief Extract a const pointer to the held type of an Any object from a pointer to that Any object (null if empty )
+ * @brief Extract a const pointer to the held type of an Any object from a pointer to that Any object (NULL if empty )
*
* @param any const Pointer to an Any object
*
// CallbackBase
CallbackBase::CallbackBase()
-: mImpl( 0 ),
- mFunction( 0 )
+: mImpl( NULL ),
+ mFunction( NULL )
{
}
}
CallbackBase::CallbackBase( Function function )
-: mImpl( 0 ),
+: mImpl( NULL ),
mFunction( function )
{
}
mImpl = new CallbackBase::Impl;
mImpl->mObjectPointer = object;
mImpl->mMemberFunctionDispatcher = dispatcher;
- mImpl->mDestructorDispatcher = 0; // object is not owned
+ mImpl->mDestructorDispatcher = NULL; // object is not owned
}
CallbackBase::CallbackBase( void* object, MemberFunction function, Dispatcher dispatcher, Destructor destructor )
}
delete mImpl;
- mImpl = 0;
+ mImpl = NULL;
}
- mFunction = 0;
+ mFunction = NULL;
}
// CallbackBase::Impl
CallbackBase::Impl::Impl()
-: mObjectPointer( 0 ),
- mMemberFunctionDispatcher( 0 ),
- mDestructorDispatcher( 0 )
+: mObjectPointer( NULL ),
+ mMemberFunctionDispatcher( NULL ),
+ mDestructorDispatcher( NULL )
{
}
*
*/
+// EXTERNAL INCLUDES
+#include <cstddef>
+
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/signals/functor-delegate.h>
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 ) ) { }
};
// CLASS HEADER
#include <dali/public-api/signals/signal-slot-connections.h>
+// EXTERNAL INCLUDES
+#include <cstddef>
+
// INTERNAL INCLUDES
#include <dali/public-api/signals/callback.h>
}
SignalConnection::SignalConnection( CallbackBase* callback )
-: mSignalObserver( 0 ),
+: mSignalObserver( NULL ),
mCallback( callback )
{
}
{
// tell the slot the signal wants to disconnect
mSignalObserver->SignalDisconnected( slotObserver, mCallback );
- mSignalObserver = 0;
+ mSignalObserver = NULL;
}
// we own the callback, SignalObserver is expected to delete the SlotConnection on Disconnected so its pointer to our mCallback is no longer used
delete mCallback;
- mCallback = 0;
+ mCallback = NULL;
}
CallbackBase* SignalConnection::GetCallback()