diff options
author | Bastien Montagne <bastien@blender.org> | 2020-07-03 12:15:40 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-07-03 13:56:21 +0300 |
commit | 6cb796e98e63aa859f5de762e4d542debfd932eb (patch) | |
tree | c88a76d588fad6dedaeb68e7fa1bc093680eb03b /source/blender/blenkernel/BKE_idtype.h | |
parent | 5dda6cefb64e4ff1205cbeda96010fd9bb0f057c (diff) |
IDTypeInfo: add new callback to loop over all cache pointers of an ID.
Part of D8183, refactoring how we preserve caches across undo steps in
readfile code.
Diffstat (limited to 'source/blender/blenkernel/BKE_idtype.h')
-rw-r--r-- | source/blender/blenkernel/BKE_idtype.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h index 56e788ccfe8..a823693e126 100644 --- a/source/blender/blenkernel/BKE_idtype.h +++ b/source/blender/blenkernel/BKE_idtype.h @@ -76,6 +76,14 @@ typedef void (*IDTypeMakeLocalFunction)(struct Main *bmain, struct ID *id, const typedef void (*IDTypeForeachIDFunction)(struct ID *id, struct LibraryForeachIDData *data); +typedef void (*IDTypeForeachCacheFunctionCallback)(struct ID *id, + const struct IDCacheKey *cache_key, + void **cache_p, + void *user_data); +typedef void (*IDTypeForeachCacheFunction)(struct ID *id, + IDTypeForeachCacheFunctionCallback function_callback, + void *user_data); + typedef struct IDTypeInfo { /* ********** General IDType data. ********** */ @@ -143,6 +151,11 @@ typedef struct IDTypeInfo { * pointers) of given data-block. */ IDTypeForeachIDFunction foreach_id; + + /** + * Iterator over all cache pointers of given ID. + */ + IDTypeForeachCacheFunction foreach_cache; } IDTypeInfo; /* ********** Declaration of each IDTypeInfo. ********** */ |