Blender V4.3
deg_builder_map.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2018 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include "DNA_ID.h"
12
13namespace blender::deg {
14
15bool BuilderMap::checkIsBuilt(ID *id, int tag) const
16{
17 return (getIDTag(id) & tag) == tag;
18}
19
20void BuilderMap::tagBuild(ID *id, int tag)
21{
22 id_tags_.lookup_or_add(id, 0) |= tag;
23}
24
26{
27 int &id_tag = id_tags_.lookup_or_add(id, 0);
28 const bool result = (id_tag & tag) == tag;
29 id_tag |= tag;
30 return result;
31}
32
34{
35 return id_tags_.lookup_default(id, 0);
36}
37
38} // namespace blender::deg
ID and Library types, which are fundamental for SDNA.
Value lookup_default(const Key &key, const Value &default_value) const
Definition BLI_map.hh:531
Value & lookup_or_add(const Key &key, const Value &value)
Definition BLI_map.hh:551
int getIDTag(ID *id) const
void tagBuild(ID *id, int tag=TAG_COMPLETE)
bool checkIsBuiltAndTag(ID *id, int tag=TAG_COMPLETE)
Map< ID *, int > id_tags_
bool checkIsBuilt(ID *id, int tag=TAG_COMPLETE) const
Definition DNA_ID.h:413