GlsAnimation Library  1.0.6
Provides classes and functions to support animating GL Studio objects programmatically or with script files
Classes | Public Member Functions | List of all members
disti::GlsAnimationObserver Class Reference

#include <gls_animation_observer.h>

Inheritance diagram for disti::GlsAnimationObserver:
disti::GlsAnimationObserverBase

Public Member Functions

template<class OnStartedCallback , class OnUpdatedCallback , class OnCompletedCallback , class OnCanceledCallback >
 GlsAnimationObserver (const OnStartedCallback &onStarted, const OnUpdatedCallback &onUpdated, const OnCompletedCallback &onCompleted, const OnCanceledCallback &onCanceled)
 
virtual void OnStarted (ID id)
 Inherited from GlsAnimationObserverBase.
 
virtual void OnUpdated (ID id)
 Inherited from GlsAnimationObserverBase.
 
virtual void OnCompleted (ID id)
 Inherited from GlsAnimationObserverBase.
 
virtual void OnCanceled (ID id)
 Inherited from GlsAnimationObserverBase.
 
- Public Member Functions inherited from disti::GlsAnimationObserverBase
 GlsAnimationObserverBase ()
 Constructor.
 
virtual ~GlsAnimationObserverBase ()
 Destructor.
 

Additional Inherited Members

- Public Types inherited from disti::GlsAnimationObserverBase
typedef stdortr1::shared_ptr< GlsAnimationObserverBasePtr
 Alias for easier reading.
 
typedef Detail::ID ID
 Alias for easier reading.
 

Detailed Description

Wraps a set of function pointers or functors up as an animation observer. (It's a poor man's std::function<void()>.)

See also
CreateOnStartedCallback
CreateOnUpdatedCallback
CreateOnCompletedCallback
auto callbacks = GlsAnimationObserver(
&MyStartedCallback, // Wrap a function pointer to void MyStartedCallback( GlsAnimationJuggler::ID );
[=]( ID id ) { myObj->DoSomething( id ); }, // Wrap a C++11 Lambda
[=]( ID id ) { juggler->Schedule( nextAnimation ); } );

Constructor & Destructor Documentation

template<class OnStartedCallback , class OnUpdatedCallback , class OnCompletedCallback , class OnCanceledCallback >
disti::GlsAnimationObserver::GlsAnimationObserver ( const OnStartedCallback &  onStarted,
const OnUpdatedCallback &  onUpdated,
const OnCompletedCallback &  onCompleted,
const OnCanceledCallback &  onCanceled 
)
inline

Constructor

Parameters
onStartedThe function pointer or functor object called when an animations starts
onUpdatedThe function pointer or functor object called when an animations is updated
onCompletedThe function pointer or functor object called when an animations completes
Note
There is no general check for validity for fn. Invalid values like null function pointers will result in undefined behavior.

The documentation for this class was generated from the following file: