/*
- * 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.
// CLASS HEADER
#include <dali/public-api/signals/functor-delegate.h>
-// INTERNAL INCLUDES
-#include <dali/public-api/common/compile-time-assert.h>
+// EXTERNAL INCLUDES
+#include <type_traits>
namespace Dali
{
* functions and regular functions.
* If this assert fails, please implement the template specialisation for C functions.
*/
-#if !defined(EMSCRIPTEN)
-DALI_COMPILE_TIME_ASSERT( sizeof(void*) == sizeof( &FunctorDispatcher<void>::Dispatch ) );
-#endif
-}
+static_assert(sizeof(void*) == sizeof(&FunctorDispatcher<void>::Dispatch), "Need to implement template specialisation for C functions");
+} // namespace
FunctorDelegate::~FunctorDelegate()
{
- if( mFunctorPointer )
+ if(mFunctorPointer)
{
- (*mDestructorDispatcher)( mFunctorPointer );
+ (*mDestructorDispatcher)(mFunctorPointer);
}
}
void FunctorDelegate::Execute()
{
- if( mFunctorPointer )
+ if(mFunctorPointer)
{
Dispatcher dispatcher = mMemberFunctionDispatcher;
- (*dispatcher)( mFunctorPointer );
+ (*dispatcher)(mFunctorPointer);
}
}
-FunctorDelegate::FunctorDelegate( void* objectPtr, Dispatcher dispatcher, Destructor destructor )
-: mFunctorPointer( objectPtr ),
- mMemberFunctionDispatcher( dispatcher ),
- mDestructorDispatcher( destructor )
+FunctorDelegate::FunctorDelegate(void* objectPtr, Dispatcher dispatcher, Destructor destructor)
+: mFunctorPointer(objectPtr),
+ mMemberFunctionDispatcher(dispatcher),
+ mDestructorDispatcher(destructor)
{
}