Blender V4.3
blender::asset_system::AssetCatalogCollection Class Reference

#include <asset_catalog_collection.hh>

Inherited by blender::asset_system::tests::TestableAssetCatalogCollection.

Public Types

using OnDuplicateCatalogIdFn
 

Public Member Functions

 AssetCatalogCollection ()=default
 
 AssetCatalogCollection (const AssetCatalogCollection &other)=delete
 
 AssetCatalogCollection (AssetCatalogCollection &&other) noexcept=default
 
std::unique_ptr< AssetCatalogCollectiondeep_copy () const
 
void add_catalogs_from_existing (const AssetCatalogCollection &other, OnDuplicateCatalogIdFn on_duplicate_items)
 

Static Protected Member Functions

static OwningAssetCatalogMap copy_catalog_map (const OwningAssetCatalogMap &orig)
 

Protected Attributes

OwningAssetCatalogMap catalogs_
 
OwningAssetCatalogMap deleted_catalogs_
 
std::unique_ptr< AssetCatalogDefinitionFilecatalog_definition_file_
 
bool has_unsaved_changes_ = false
 
friend AssetCatalogService
 

Detailed Description

All catalogs that are owned by a single asset library, and managed by a single instance of AssetCatalogService. The undo system for asset catalog edits contains historical copies of this struct.

Definition at line 20 of file asset_catalog_collection.hh.

Member Typedef Documentation

◆ OnDuplicateCatalogIdFn

Initial value:
FunctionRef<void(const AssetCatalog &existing, const AssetCatalog &to_be_ignored)>

Definition at line 45 of file asset_catalog_collection.hh.

Constructor & Destructor Documentation

◆ AssetCatalogCollection() [1/3]

blender::asset_system::AssetCatalogCollection::AssetCatalogCollection ( )
default

◆ AssetCatalogCollection() [2/3]

blender::asset_system::AssetCatalogCollection::AssetCatalogCollection ( const AssetCatalogCollection & other)
delete

◆ AssetCatalogCollection() [3/3]

blender::asset_system::AssetCatalogCollection::AssetCatalogCollection ( AssetCatalogCollection && other)
defaultnoexcept

Member Function Documentation

◆ add_catalogs_from_existing()

void blender::asset_system::AssetCatalogCollection::add_catalogs_from_existing ( const AssetCatalogCollection & other,
AssetCatalogCollection::OnDuplicateCatalogIdFn on_duplicate_items )

Copy the catalogs from other and append them to this collection. Copies no other data otherwise.

Note
If a catalog from other already exists in this collection (identified by catalog ID), it will be skipped and on_duplicate_items will be called.

Definition at line 49 of file asset_catalog_collection.cc.

References catalogs_, and blender::asset_system::copy_catalog_map_into_existing().

◆ copy_catalog_map()

OwningAssetCatalogMap blender::asset_system::AssetCatalogCollection::copy_catalog_map ( const OwningAssetCatalogMap & orig)
staticprotected

◆ deep_copy()

Member Data Documentation

◆ AssetCatalogService

friend blender::asset_system::AssetCatalogCollection::AssetCatalogService
protected

Definition at line 37 of file asset_catalog_collection.hh.

◆ catalog_definition_file_

◆ catalogs_

OwningAssetCatalogMap blender::asset_system::AssetCatalogCollection::catalogs_
protected

All catalogs known, except the known-but-deleted ones.

Definition at line 23 of file asset_catalog_collection.hh.

Referenced by add_catalogs_from_existing(), deep_copy(), and blender::asset_system::tests::TestableAssetCatalogCollection::get_catalogs().

◆ deleted_catalogs_

OwningAssetCatalogMap blender::asset_system::AssetCatalogCollection::deleted_catalogs_
protected

Catalogs that have been deleted. They are kept around so that the load-merge-save of catalog definition files can actually delete them if they already existed on disk (instead of the merge operation resurrecting them).

Definition at line 28 of file asset_catalog_collection.hh.

Referenced by deep_copy(), and blender::asset_system::tests::TestableAssetCatalogCollection::get_deleted_catalogs().

◆ has_unsaved_changes_

bool blender::asset_system::AssetCatalogCollection::has_unsaved_changes_ = false
protected

Whether any of the catalogs have unsaved changes.

Definition at line 35 of file asset_catalog_collection.hh.

Referenced by deep_copy().


The documentation for this class was generated from the following files: