GL Studio C++ Runtime API
|
#include <callback_caller.h>
Public Member Functions | |
AttributeChangedEventEmitter (AttributeChangedNotifier *container, T &val, const AttributeName &attribName, bool emitEvent=false) | |
~AttributeChangedEventEmitter () | |
Protected Member Functions | |
void | EmitAttributeChangedEventProperty () |
Emits an "AttributeChanged" ObjectEvent, and calls NotifyAttributeChanged to tell subscribers that this property changed. | |
Protected Attributes | |
AttributeChangedNotifier * | _container |
T | _prevVal |
T & | _curVal |
const AttributeName & | _attribName |
bool | _emitEvent |
whether or not to emit an event | |
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.
|
inline |
ctor
container | container that has attribute |
val | current value of attribute. Lifetime must extend pass the life of this class |
attribName | name of attribute. Lifetime must extend pass the life of this class |
emitEvent | whether or not to emit an event. The container must be a DisplayObject, and the event will be passed to the object's handle() method. |
|
inline |
dtor - emit attribute changed event if container is a DisplayObject and the value has changed
|
protected |
attribute name
|
protected |
container
|
protected |
ref to current value for attribute
|
protected |
previous value for attribute