22 mappings_.
add(old_id, new_id);
39 const ID *id_self)
const
44 const ID *new_id = mappings_.
lookup(
id);
48 if (new_id ==
nullptr) {
62 "ID_REMAP_APPLY_WHEN_REMAPPING_TO_SELF requires a non-null `id_self` parameter.");
64 if (*r_id_ptr ==
nullptr) {
69 if (new_id ==
nullptr) {
81 if (*r_id_ptr ==
nullptr) {
100 return "not_mappable";
102 return "unavailable";
114 this->
iter([](
ID *old_id,
ID *new_id) {
115 if (old_id !=
nullptr && new_id !=
nullptr) {
116 printf(
"Remap %s(%p) to %s(%p)\n", old_id->
name, old_id, new_id->
name, new_id);
118 if (old_id !=
nullptr && new_id ==
nullptr) {
119 printf(
"Unassign %s(%p)\n", old_id->
name, old_id);
uint64_t BKE_idtype_idcode_to_idfilter(short idcode)
void id_us_ensure_real(ID *id)
void id_us_plus_no_lib(ID *id)
@ ID_REMAP_RESULT_SOURCE_REMAPPED
@ ID_REMAP_RESULT_SOURCE_UNASSIGNED
@ ID_REMAP_RESULT_SOURCE_NOT_MAPPABLE
@ ID_REMAP_RESULT_SOURCE_UNAVAILABLE
@ ID_REMAP_APPLY_UPDATE_REFCOUNT
@ ID_REMAP_APPLY_UNMAP_WHEN_REMAPPING_TO_SELF
@ ID_REMAP_APPLY_ENSURE_REAL
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
ID and Library types, which are fundamental for SDNA.
Read Guarded memory(de)allocation.
const Value * lookup_ptr(const Key &key) const
bool add_overwrite(const Key &key, const Value &value)
bool add(const Key &key, const Value &value)
const Value & lookup(const Key &key) const
bool contains(const Key &key) const
IDRemapperApplyResult get_mapping_result(ID *id, IDRemapperApplyOptions options, const ID *id_self) const
bool allow_idtype_mismatch
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
void iter(FunctionRef< void(ID *old_id, ID *new_id)> func) const
static const StringRefNull result_to_string(const IDRemapperApplyResult result)
void add(ID *old_id, ID *new_id)
void add_overwrite(ID *old_id, ID *new_id)
CCL_NAMESPACE_BEGIN struct Options options