OnTreeChangeEventFn#
Fully qualified name: carb::dictionary::OnTreeChangeEventFn
Defined in carb/dictionary/IDictionary.h
-
using carb::dictionary::OnTreeChangeEventFn = void (*)(const Item *treeItem, const Item *changedItem, ChangeEventType eventType, void *userData)#
A callback that, once registered with IDictionary::subscribeToTreeChangeEvents(), receives notifications when Items in a given tree change state or value.
This can include being created or destroyed, or the value of an item in the watched tree changes.
Note
The callbacks happen in the context of the thread performing the change. It is safe to call back into the IDictionary interface and unsubscribe or otherwise make changes from the callback itself. For ChangeEventType::eCreated and ChangeEventType::eChanged types, no internal locks are held during the callback. For ChangeEventType::eDestroyed, internal locks are held which can cause thread-synchronization issues with locking order.
- Param treeItem:
The root of the tree given to the tree being watched for changes. This is passed to IDictionary::subscribeToTreeChangeEvents() when the callback is originally registered. The item
changedItemwill be a descendent of this item.- Param changedItem:
The item that is being changed. This will never be
nullptr. This may be eithertreeItemor one of its descendants.- Param eventType:
The type of event that is occurring on
changedItem.- Param userData:
An opaque user data object. This value is stored at the time the change subscription is created with IDictionary::subscribeToNodeChangeEvents() but is never accessed or interpreted internally. It is the callback implementation’s responsibility to know how to correctly interpret this value.