Blender V4.5
deg_builder_map.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2018 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_map.hh"
12
13struct ID;
14
15namespace blender::deg {
16
18 public:
19 enum {
20 TAG_ANIMATION = (1 << 0),
21 TAG_PARAMETERS = (1 << 1),
22 TAG_TRANSFORM = (1 << 2),
23 TAG_GEOMETRY = (1 << 3),
24
27 TAG_SCENE_AUDIO = (1 << 6),
28
35
37
38 /* All ID components has been built. */
42 };
43
44 /* Check whether given ID is already handled by builder (or if it's being handled). */
45 bool check_is_built(ID *id, int tag = TAG_COMPLETE) const;
46
47 /* Tag given ID as handled/built. */
48 void tag_built(ID *id, int tag = TAG_COMPLETE);
49
50 /* Combination of previous two functions, returns truth if ID was already handled, or tags is
51 * handled otherwise and return false. */
52 bool check_is_built_and_tag(ID *id, int tag = TAG_COMPLETE);
53
54 template<typename T> bool check_is_built(T *datablock, int tag = TAG_COMPLETE) const
55 {
56 return this->check_is_built(&datablock->id, tag);
57 }
58 template<typename T> void tag_built(T *datablock, int tag = TAG_COMPLETE)
59 {
60 this->tag_built(&datablock->id, tag);
61 }
62 template<typename T> bool check_is_built_and_tag(T *datablock, int tag = TAG_COMPLETE)
63 {
64 return this->check_is_built_and_tag(&datablock->id, tag);
65 }
66
67 protected:
68 int get_ID_tag(ID *id) const;
69
71};
72
73} // namespace blender::deg
int get_ID_tag(ID *id) const
bool check_is_built_and_tag(T *datablock, int tag=TAG_COMPLETE)
bool check_is_built(ID *id, int tag=TAG_COMPLETE) const
bool check_is_built(T *datablock, int tag=TAG_COMPLETE) const
Map< ID *, int > id_tags_
bool check_is_built_and_tag(ID *id, int tag=TAG_COMPLETE)
void tag_built(T *datablock, int tag=TAG_COMPLETE)
void tag_built(ID *id, int tag=TAG_COMPLETE)
#define T
Definition DNA_ID.h:404