GL Studio C++ Runtime API
AttributeChangedEventEmitter< T > Class Template Reference

#include <callback_caller.h>

Public Member Functions

 AttributeChangedEventEmitter (AttributeChangedNotifier *container, T &val, const AttributeName &attribName, bool emitEvent=false)
 
 ~AttributeChangedEventEmitter ()
 

Protected Member Functions

void EmitAttributeChangedEventProperty ()
 

Protected Attributes

AttributeChangedNotifier_container
 
_prevVal
 
T & _curVal
 
const AttributeName_attribName
 

Detailed Description

template<class T>
class disti::AttributeChangedEventEmitter< T >

helper for class for emitting attribute changed events in generated code this class does two things: 1) It calls NotifyAttributeChanged if the attribute changed 2) It emits an event if EmitEvent() was set to true and if the Container type is DisplayObject. It can't emit events for top level display frames since they don't have a handle() method.

Constructor & Destructor Documentation

AttributeChangedEventEmitter ( AttributeChangedNotifier container,
T &  val,
const AttributeName attribName,
bool  emitEvent = false 
)
inline

ctor

Parameters
containercontainer that has attribute
valcurrent value of attribute. Lifetime must extend pass the life of this class
attribNamename of attribute. Lifetime must extend pass the life of this class
emitEventwhether or not to emit an event. The container must be a DisplayObject, and the event will be passed to the object's handle() method.

dtor - emit attribute changed event if container is a DisplayObject and the value has changed

Member Function Documentation

void EmitAttributeChangedEventProperty ( )
inlineprotected

whether or not to emit an event

Member Data Documentation

const AttributeName& _attribName
protected

attribute name

AttributeChangedNotifier* _container
protected

container

T& _curVal
protected

ref to current value for attribute

T _prevVal
protected

previous value for attribute


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