|
The Vish Visualization Shell 0.3
Vish
|
The callback functions are invoked once the underlying parameter is changed, for instance during some GUI event. More...
Functions | |
| template<class SlotType , class VObjectClass , void(VObjectClass::*)(const SlotType &, const ValuePoolPtr &Context) const callback> | |
| RefPtr< ValueNotifier > | Wizt::addNotifier (TypedSlot< SlotType > &theSlot, VObjectClass *That) |
| A global function that allows to add a notifier callback to a given TypedSlot. | |
| template<class VObjectClass , void(VObjectClass::*)(const T &, const ValuePoolPtr &Context) const callback> | |
| RefPtr< ValueNotifier > | Wizt::TypedSlot< T >::addNotifier (VObjectClass *That) |
| Install a notifier callback function that is a member function of the provided class. | |
| template<class VObjectClass , void(VObjectClass::*)(const T &, const ValuePoolPtr &Context) const callback, class VObjectClassPtr > | |
| RefPtr< ValueNotifier > | Wizt::TypedSlot< T >::addNotifier (VObjectClass *That) |
| Similar to the former function addNotifier, but allows to explicitly specify the type of the pointer to the owning object. | |
| template<class VObjectClass , class VObjectClassPtr > | |
| RefPtr< ValueNotifier > | Wizt::TypedSlot< T >::addNotifier (VObjectClass *That, void(VObjectClass::*callback)(const T &, const ValuePoolPtr &Context) const) |
| Another version of the addNotifier function where the callback function is specified at runtime as function argument, instead of compile-time as template argument. | |
| template<class VObjectClass > | |
| RefPtr< ValueNotifier > | Wizt::TypedSlot< T >::addNotifier (VObjectClass *That, void(VObjectClass::*callback)(const T &, const ValuePoolPtr &Context) const) |
| A version of the addNotifier function where the callback function is specified at runtime as function argument, instead of compile-time as template argument. | |
The callback functions are invoked once the underlying parameter is changed, for instance during some GUI event.
Be cautious as these functions are invoked synchroneously, i.e. immediately at a GUI event. They may also be invoked from the same thread, which may be different from the thread where the main object holding the respective VSlot lives and is evaluated.
Note that header file
must be included for these functions (they are complex inline functions).
|
inline |
A global function that allows to add a notifier callback to a given TypedSlot.
| RefPtr< ValueNotifier > Wizt::TypedSlot< T >::addNotifier | ( | VObjectClass * | That | ) |
Install a notifier callback function that is a member function of the provided class.
Usage:
where
is a member function of class CameraNavigator (used here as example) with two function arguments and LeftView is a TypedSlot<T>. The type T used in this slot LeftView must be idental to the first function argument of the doOrthographicProjection() callback function. (In the actual implementation of class CameraNavigator the type T is an Action ).
| VObjectClass | An arbitrary class that provides a member function that shall be invoked as callback when the TypedSlot is changed. |
| That | Pointer to an instance of an object from which the specified member function shall be called. |
| callback | Pointer to a member function of the specified VObjectClass, given as template function argument, thus is constant at compile-time. A variant of the addNotifier() function exists that allows to specify this pointer at runtime alternatively. Use the compile-time version unless needed otherwise. |
| RefPtr< ValueNotifier > Wizt::TypedSlot< T >::addNotifier | ( | VObjectClass * | That | ) |
Similar to the former function addNotifier, but allows to explicitly specify the type of the pointer to the owning object.
By default, a reference is stored in the Notifier instance. This is appropriate for as long as the owning class lives longer than the notifier and its callback function, but in other case, a refcounting pointer needs to be used.
| RefPtr< ValueNotifier > Wizt::TypedSlot< T >::addNotifier | ( | VObjectClass * | That, |
| void(VObjectClass::*)(const T &, const ValuePoolPtr &Context) const | callback | ||
| ) |
Another version of the addNotifier function where the callback function is specified at runtime as function argument, instead of compile-time as template argument.
The type of the class pointer to the given VObjectClass is explicitly given here.