Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-07-03 12:15:40 +0300
committerBastien Montagne <bastien@blender.org>2020-07-03 13:56:21 +0300
commit6cb796e98e63aa859f5de762e4d542debfd932eb (patch)
treec88a76d588fad6dedaeb68e7fa1bc093680eb03b /source/blender/blenkernel/BKE_idtype.h
parent5dda6cefb64e4ff1205cbeda96010fd9bb0f057c (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.h13
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. ********** */