OnNodeChangeEventFn#

Fully qualified name: carb::dictionary::OnNodeChangeEventFn

Defined in carb/dictionary/IDictionary.h

using carb::dictionary::OnNodeChangeEventFn = void (*)(const Item *changedItem, ChangeEventType eventType, void *userData)#

A callback that, once registered with IDictionary::subscribeToNodeChangeEvents(), receives notifications when an item at a specific path changes state or value.

This can include being created or destroyed, or its value being changed.

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 function itself. For ChangeEventType::eCreated and ChangeEventType::eChanged types, no internal locks are held during the callback. For ChangeEventType::eDestroyed types, internal locks are held which can cause thread-synchronization issues with locking order.

Param changedItem:

The item being changed. This will never be nullptr. The item’s value should not be changed inside the callback since that could result in an endless callback loop. Its value, type, or flag may be safely queried though.

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.