OnUpdateItemFn#
Fully qualified name: carb::dictionary::OnUpdateItemFn
Defined in carb/dictionary/IDictionary.h
-
typedef UpdateAction (*carb::dictionary::OnUpdateItemFn)(const Item *dstItem, ItemType dstItemType, const Item *srcItem, ItemType srcItemType, void *userData)#
Callback function that will tell whether and how the merger in IDictionary::update() operations should overwrite the destination item with the source item.
This callback is called once for each proposed merge operation that occurs during the update. Note that this callback will be performed for both leaf and intermediate items in the existing dictionary (ie: the dictionary being merged into). If the existing dictionary contains an item that is not also present in the source dictionary (ie: the one being merged into the existing dictionary), this callback will not be performed and the walk of the dictionary will continue.
- Param dstItem:
[in] The target item in the existing dictionary that is being updated. This may be
nullptrif no matching item exists in the existing dictionary.- Param dstItemType:
[in] The item type for
dstItem. This will be ItemType::eCount ifdstItemisnullptr. This can be used to make merging decisions based on the source and destination item types. This is also provided as a convenience so that the type of each item doesn’t need to be explicitly retrieved for each call.- Param srcItem:
[in] The source item from the dictionary being merged into the existing dictionary. This is potentially a new item to be added or one that exists in both dictionaries under the same name or path. It is the responsibility of this callback to decide if and how to merge this item into the existing dictionary by returning the appropriate update action. This will not be
nullptr.- Param srcItemType:
[in] The item type for
srcItem. This can be used to make merging decisions based on the source and destination item types. This is also provided as a convenience so that the type of each item doesn’t need to be explicitly retrieved for each call.- Param userData:
[in] An opaque user data pointer that is provided in the original call to IDictionary::update(). The callback implementation must know how to properly interpret this data.
- Return:
The action that the dictionary update merger should take to handle the merging of this particular pair of items.