The Vish Visualization Shell 0.3
Vish
Functions
Notifiers

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< ValueNotifierWizt::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< ValueNotifierWizt::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< ValueNotifierWizt::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< ValueNotifierWizt::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< ValueNotifierWizt::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.
 

Detailed Description

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

#include <ocean/plankton/VInputNotifier.hpp>

must be included for these functions (they are complex inline functions).

Function Documentation

◆ addNotifier() [1/4]

template<class SlotType , class VObjectClass , void(VObjectClass::*)(const SlotType &, const ValuePoolPtr &Context) const callback>
RefPtr< ValueNotifier > Wizt::addNotifier ( TypedSlot< SlotType > &  theSlot,
VObjectClass *  That 
)
inline

A global function that allows to add a notifier callback to a given TypedSlot.

See also
TypedSlot<T>::addNotifier()

◆ addNotifier() [2/4]

template<class T >
template<class VObjectClass , void(VObjectClass::*)(const T &, const ValuePoolPtr &Context) callback>
RefPtr< ValueNotifier > Wizt::TypedSlot< T >::addNotifier ( VObjectClass *  That)

Install a notifier callback function that is a member function of the provided class.

Usage:

CameraNavigator*CameraObject = ... ;
LeftView.addNotifier<CameraNavigator, &CameraNavigator::doOrthographicProjection>( CameraObject );

where

doOrthographicProjection<const T&, const ValuePoolPtr&Context );
A set of variable names, with indices associated to each type.
Definition Context.hpp:18

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 ).

Parameters
VObjectClassAn arbitrary class that provides a member function that shall be invoked as callback when the TypedSlot is changed.
ThatPointer to an instance of an object from which the specified member function shall be called.
callbackPointer 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.

◆ addNotifier() [3/4]

template<class T >
template<class VObjectClass , void(VObjectClass::*)(const T &, const ValuePoolPtr &Context) 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.

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.

◆ addNotifier() [4/4]

template<class T >
template<class VObjectClass , class VObjectClassPtr >
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.