Tizen Native API
5.5
|
SlotDelegates can be used to connect member functions to signals, without inheriting from SlotDelegateInterface. More...
Public Member Functions | |
SlotDelegate (Slot *slot) | |
Constructor. | |
~SlotDelegate () | |
Non-virtual destructor. | |
void | DisconnectAll () |
Disconnects all signals from this object. | |
std::size_t | GetConnectionCount () const |
Slot * | GetSlot () |
Retrieves the slot object. | |
ConnectionTracker * | GetConnectionTracker () |
Retrieves the connection tracker component. |
SlotDelegates can be used to connect member functions to signals, without inheriting from SlotDelegateInterface.
Note that the object providing the member function is expected to own the SlotDelegate; therefore when the object is destroyed, the SlotDelegate destructor will automatically disconnect.
class Example // This does not inherit from SlotDelegateInterface! { public: Example() : mSlotDelegate( this ) { } ~Example() { // mSlotDelegate disconnects automatically here } void Animate() { Animation animation = Animation::New( 1.0f ); animation.FinishedSignal().Connect( mSlotDelegate, &Example::OnAnimationFinished ); animation.Play(); // fire & forget } void OnAnimationFinished( Animation& animation ) { std::cout << "Animation Finished!" << std::endl; } private: SlotDelegate<Example> mSlotDelegate; };
Dali::SlotDelegate< Slot >::SlotDelegate | ( | Slot * | slot | ) |
Constructor.
[in] | slot | The object with a callback |
Dali::SlotDelegate< Slot >::~SlotDelegate | ( | ) |
Non-virtual destructor.
void Dali::SlotDelegate< Slot >::DisconnectAll | ( | ) |
Disconnects all signals from this object.
std::size_t Dali::SlotDelegate< Slot >::GetConnectionCount | ( | ) | const |
Returns the connection count.
ConnectionTracker* Dali::SlotDelegate< Slot >::GetConnectionTracker | ( | ) |
Retrieves the connection tracker component.
Slot* Dali::SlotDelegate< Slot >::GetSlot | ( | ) |
Retrieves the slot object.