22 auto copy = std::make_unique<AssetCatalogCollection>();
30 copy->catalogs_, copy->deleted_catalogs_);
41 for (
const auto &orig_catalog_uptr : source.
values()) {
42 if (dest.
contains(orig_catalog_uptr->catalog_id)) {
43 if (on_duplicate_items) {
44 on_duplicate_items(*dest.
lookup(orig_catalog_uptr->catalog_id), *orig_catalog_uptr);
49 auto copy_catalog_uptr = std::make_unique<AssetCatalog>(*orig_catalog_uptr);
50 dest.
add_new(copy_catalog_uptr->catalog_id, std::move(copy_catalog_uptr));
#define BLI_assert_unreachable()
ValueIterator values() const &
const Value & lookup(const Key &key) const
void add_new(const Key &key, const Value &value)
bool contains(const Key &key) const
void add_catalogs_from_existing(const AssetCatalogCollection &other, OnDuplicateCatalogIdFn on_duplicate_items)
OwningAssetCatalogMap catalogs_
AssetCatalogCollection()=default
FunctionRef< void(const AssetCatalog &existing, const AssetCatalog &to_be_ignored)> OnDuplicateCatalogIdFn
std::unique_ptr< AssetCatalogDefinitionFile > catalog_definition_file_
OwningAssetCatalogMap deleted_catalogs_
std::unique_ptr< AssetCatalogCollection > deep_copy() const
static OwningAssetCatalogMap copy_catalog_map(const OwningAssetCatalogMap &orig)
bool has_unsaved_changes_
static void copy_catalog_map_into_existing(const OwningAssetCatalogMap &source, OwningAssetCatalogMap &dest, AssetCatalogCollection::OnDuplicateCatalogIdFn on_duplicate_items)
Map< CatalogID, std::unique_ptr< AssetCatalog > > OwningAssetCatalogMap