X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fsignals%2Fbase-signal.h;h=159cc6ed7accd59685b210548228df4b9c38e7e7;hb=4d75040ab200bd306ec5a48f2a617480062eef4c;hp=0fd75ffae26a8393495f8dbc5bfed1911791e536;hpb=07d00b695a47b884599de3a9aaf36eba21a3f827;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/signals/base-signal.h b/dali/public-api/signals/base-signal.h old mode 100644 new mode 100755 index 0fd75ff..159cc6e --- a/dali/public-api/signals/base-signal.h +++ b/dali/public-api/signals/base-signal.h @@ -2,7 +2,7 @@ #define __DALI_BASE_SIGNAL_H__ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -69,36 +69,41 @@ namespace Dali * %Callback 2 Slot Observer 2 * * - * When the connection tracker is destroyed, SlotDisconnected() is called on every slot observer ( signal ) - * Signals implement the Slot Observer interface, to be told when a slot has disconnected - * Connection tracker implements the Signal Observer interface, to be told when a signal has disconnected (died) + * When the connection tracker is destroyed, SlotDisconnected() is called on every slot observer ( signal ). + * Signals implement the Slot Observer interface, to be told when a slot has disconnected. + * Connection tracker implements the Signal Observer interface, to be told when a signal has disconnected (died). * + * @SINCE_1_0.0 */ -class DALI_IMPORT_API BaseSignal : public SlotObserver +class DALI_CORE_API BaseSignal : public SlotObserver { public: /** * @brief Constructor. + * @SINCE_1_0.0 */ BaseSignal(); /** * @brief Virtual destructor. + * @SINCE_1_0.0 */ virtual ~BaseSignal(); /** - * @brief Query whether there are any connected slots. + * @brief Queries whether there are any connected slots. * + * @SINCE_1_0.0 * @return True if there are any slots connected to the signal. */ bool Empty() const; /** - * @brief Query the number of slots. + * @brief Queries the number of slots. * - * @return The number of slots connected to this signal. + * @SINCE_1_0.0 + * @return The number of slots connected to this signal */ std::size_t GetConnectionCount() const; @@ -106,25 +111,29 @@ public: /** * @brief Used to guard against nested Emit() calls. + * @SINCE_1_0.0 */ - struct EmitGuard + struct DALI_CORE_API EmitGuard { /** - * @brief Create the guard. + * @brief Creates the guard. * - * @param[in,out] flag This flag will be set to true during Emit() calls. + * @SINCE_1_0.0 + * @param[in,out] flag This flag will be set to true during Emit() calls */ EmitGuard( bool& flag ); /** * @brief Non-virtual destructor. * + * @SINCE_1_0.0 */ ~EmitGuard(); /** - * @brief Determine if an error occured. + * @brief Determines if an error occurred. * + * @SINCE_1_0.0 * @return True if an error occurred i.e. if Emit() was called during Emit() */ bool ErrorOccurred(); @@ -133,17 +142,19 @@ public: }; /** - * @brief Emit a signal with no parameters. + * @brief Emits a signal with no parameters. * + * @SINCE_1_0.0 * @pre Cannot be called from inside the same Signal's Emit methods. */ void Emit(); /** - * @brief Emit a signal with no parameters. + * @brief Emits a signal with no parameters. * + * @SINCE_1_0.0 + * @return The value returned by the last callback * @pre Cannot be called from inside the same Signal's Emit methods. - * @return The value returned by the last callback. */ template< typename Ret > Ret EmitReturn() @@ -180,10 +191,11 @@ public: } /** - * @brief Emit a signal with 1 parameter. + * @brief Emits a signal with 1 parameter. * + * @SINCE_1_0.0 + * @param[in] arg0 The first parameter * @pre Cannot be called from inside the same Signal's Emit methods. - * @param[in] arg0 The first parameter. */ template< typename Arg0 > void Emit( Arg0 arg0 ) @@ -216,11 +228,12 @@ public: } /** - * @brief Emit a signal with 1 parameter. + * @brief Emits a signal with 1 parameter. * + * @SINCE_1_0.0 + * @param[in] arg0 The first parameter + * @return The value returned by the last callback * @pre Cannot be called from inside the same Signal's Emit methods. - * @param[in] arg0 The first parameter. - * @return The value returned by the last callback. */ template< typename Ret, typename Arg0 > Ret EmitReturn( Arg0 arg0 ) @@ -257,11 +270,12 @@ public: } /** - * @brief Emit a signal with 2 parameters. + * @brief Emits a signal with 2 parameters. * + * @SINCE_1_0.0 + * @param[in] arg0 The first parameter + * @param[in] arg1 The second parameter * @pre Cannot be called from inside the same Signal's Emit methods. - * @param[in] arg0 The first parameter. - * @param[in] arg1 The second parameter. */ template< typename Arg0, typename Arg1 > void Emit( Arg0 arg0, Arg1 arg1 ) @@ -294,12 +308,13 @@ public: } /** - * @brief Emit a signal with 2 parameters. + * @brief Emits a signal with 2 parameters. * + * @SINCE_1_0.0 + * @param[in] arg0 The first parameter + * @param[in] arg1 The second parameter + * @return The value returned by the last callback * @pre Cannot be called from inside the same Signal's Emit methods. - * @param[in] arg0 The first parameter. - * @param[in] arg1 The second parameter. - * @return The value returned by the last callback. */ template< typename Ret, typename Arg0, typename Arg1 > Ret EmitReturn( Arg0 arg0, Arg1 arg1 ) @@ -336,12 +351,13 @@ public: } /** - * @brief Emit a signal with 3 parameters. + * @brief Emits a signal with 3 parameters. * + * @SINCE_1_0.0 + * @param[in] arg0 The first parameter + * @param[in] arg1 The second parameter + * @param[in] arg2 The third parameter * @pre Cannot be called from inside the same Signal's Emit methods. - * @param[in] arg0 The first parameter. - * @param[in] arg1 The second parameter. - * @param[in] arg2 The third parameter. */ template< typename Arg0, typename Arg1, typename Arg2 > void Emit( Arg0 arg0, Arg1 arg1, Arg2 arg2 ) @@ -374,13 +390,14 @@ public: } /** - * @brief Emit a signal with 3 parameters. + * @brief Emits a signal with 3 parameters. * + * @SINCE_1_0.0 + * @param[in] arg0 The first parameter + * @param[in] arg1 The second parameter + * @param[in] arg2 The third parameter + * @return The value returned by the last callback * @pre Cannot be called from inside the same Signal's Emit methods. - * @param[in] arg0 The first parameter. - * @param[in] arg1 The second parameter. - * @param[in] arg2 The third parameter. - * @return The value returned by the last callback. */ template< typename Ret, typename Arg0, typename Arg1, typename Arg2 > Ret EmitReturn( Arg0 arg0, Arg1 arg1, Arg2 arg2 ) @@ -419,32 +436,36 @@ public: // Connect / Disconnect function for use by Signal implementations /** - * @brief Called by Signal implementations, when the user calls Signal.Connect( ... ) + * @brief Called by Signal implementations, when the user calls Signal.Connect( ... ). * - * @param[in] callback A newly allocated callback object (takes ownership). + * @SINCE_1_0.0 + * @param[in] callback A newly allocated callback object (takes ownership) */ void OnConnect( CallbackBase* callback ); /** - * @brief Called by Signal implementations, when the user calls Signal.Disconnect( ... ) + * @brief Called by Signal implementations, when the user calls Signal.Disconnect( ... ). * - * @param[in] callback A newly allocated callback object (takes ownership). + * @SINCE_1_0.0 + * @param[in] callback A newly allocated callback object (takes ownership) */ void OnDisconnect( CallbackBase* callback ); /** - * @brief Called by Signal implementations, when the user calls Signal.Connect( ... ) + * @brief Called by Signal implementations, when the user calls Signal.Connect( ... ). * - * @param[in] tracker The connection tracker. - * @param[in] callback A newly allocated callback object (takes ownership). + * @SINCE_1_0.0 + * @param[in] tracker The connection tracker + * @param[in] callback A newly allocated callback object (takes ownership) */ void OnConnect( ConnectionTrackerInterface* tracker, CallbackBase* callback ); /** - * @brief Called by Signal implementations, when the user calls Signal.Disconnect( ... ) + * @brief Called by Signal implementations, when the user calls Signal.Disconnect( ... ). * - * @param[in] tracker The connection tracker. - * @param[in] callback A newly allocated callback object (takes ownership). + * @SINCE_1_0.0 + * @param[in] tracker The connection tracker + * @param[in] callback A newly allocated callback object (takes ownership) */ void OnDisconnect( ConnectionTrackerInterface* tracker, CallbackBase* callback ); @@ -460,34 +481,38 @@ private: /** * @brief Returns a callback given an index in to the connection array. * - * @param[in] connectionIndex The index of the callback. - * @return The callback, or NULL if the connection has been deleted. + * @SINCE_1_0.0 + * @param[in] connectionIndex The index of the callback + * @return The callback, or NULL if the connection has been deleted */ CallbackBase* GetCallback( std::size_t connectionIndex ) const; /** * @brief Helper to find whether a callback is connected. * - * @param[in] callback The call back object. - * @return A valid index if the callback is connected. + * @SINCE_1_0.0 + * @param[in] callback The call back object + * @return A valid index if the callback is connected */ int FindCallback( CallbackBase* callback ); /** * @brief Deletes a connection object from the list of connections. * - * @param[in] connectionIndex The index of the callback. + * @SINCE_1_0.0 + * @param[in] connectionIndex The index of the callback */ void DeleteConnection( std::size_t connectionIndex ); /** * @brief Helper to remove NULL items from mSignalConnections, which is only safe at the end of Emit() * i.e. not from methods which can be called during a signal Emit(), such as Disconnect(). + * @SINCE_1_0.0 */ void CleanupConnections(); - BaseSignal( const BaseSignal& ); ///< undefined copy constructor, signals don't support copying. - BaseSignal& operator=( const BaseSignal& ); ///< undefined assignment operator + BaseSignal( const BaseSignal& ); ///< undefined copy constructor, signals don't support copying. @SINCE_1_0.0 + BaseSignal& operator=( const BaseSignal& ); ///< undefined assignment operator @SINCE_1_0.0 private: