AutoSlot Class Reference

Subclass of SafeSlot for convenience when the observer and invalidator are the same object. More...

#include <SafeSlot.h>

Inheritance diagram for AutoSlot:

Inheritance graph

List of all members.

Public Member Functions

template<class T, typename Method>
 AutoSlot (T *pObserver, Method pMethod)


Detailed Description

Subclass of SafeSlot for convenience when the observer and invalidator are the same object.

See also:
SafeSlot

Definition at line 276 of file SafeSlot.h.


Constructor & Destructor Documentation

template<class T, typename Method>
AutoSlot::AutoSlot ( T *  pObserver,
Method  pMethod 
)

Creates an auto-detaching slot.

Creates a slot. Assuming neither of the input arguments is NULL, the slot will return true from isValid() and will test equal to other slots created with the same arguments. This slot will automatically detach from the subject it is attached to when the observer is destroyed.

Parameters:
pObserver The object to call in Slot::update. It must inherit from SlotInvalidator.
pMethod The method to call on the object in Slot::update. The method should not be virtual. Virtual slot methods may cause Subject::detach to fail. If a virtual slot is needed, make the slot method non-virtual and have it call a virtual method. On notify, the slot method will be called as follows:
           (pT->*pMethod)(subject, signal, v);
pMethod needs to have the following signature:
           T::method(Subject &subject, const std::string &signal, const boost::any &v);

Definition at line 306 of file SafeSlot.h.


Software Development Kit - Opticks 4.9.0 Build 16218