Tizen Native API
5.0
|
Base Template class to provide signals. More...
Base Template class to provide signals.
To create a signal for this class, you first have to define a typedef within your handle's scope:
class MyHandle : public Handle { public: // Typedefs typedef Signal< void ()> VoidSignalType; typedef Signal< bool ()> BoolSignalType; typedef Signal< void ( float )> ParamSignalType; ... public: // Signals VoidSignalType& VoidSignal(); BoolSignalType& BoolSignal(); ParamSignalType& ParamSignal(); ... };
The methods are required in the handle class so that the application writer can retrieve the Signal in order to connect/disconnect.
In the implementation class, the members should be defined and the methods should be provided to retrieve the signal itself. These will be called by the equivalent methods in the MyHandle class.
class MyObject : public Object { ... public: MyHandle::VoidSignalType& VoidSignal() { return mVoidSignal; } MyHandle::BoolSignalType& BoolSignal() { return mBoolSignal; } MyHandle::ParamSignalType& ParamSignal() { return mParamSignal; } private: // Signals MyHandle::VoidSignalType mVoidSignal; MyHandle::BoolSignalType mBoolSignal; MyHandle::ParamSignalType mParamSignal; ... };