Blender V5.0
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
bool is_empty () const
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
friend AssetLibraryService

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 22 of file asset_catalog_collection.hh.

Member Typedef Documentation

◆ OnDuplicateCatalogIdFn

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 54 of file asset_catalog_collection.cc.

References AssetCatalogCollection(), 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()

◆ is_empty()

bool blender::asset_system::AssetCatalogCollection::is_empty ( ) const

Check if this contains any catalogs or deleted catalogs. Doesn't check if a CDF is present.

Definition at line 15 of file asset_catalog_collection.cc.

References catalogs_, and deleted_catalogs_.

Member Data Documentation

◆ AssetCatalogService

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

Definition at line 39 of file asset_catalog_collection.hh.

◆ AssetLibraryService

friend blender::asset_system::AssetCatalogCollection::AssetLibraryService
protected

Definition at line 40 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 25 of file asset_catalog_collection.hh.

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

◆ 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 30 of file asset_catalog_collection.hh.

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

◆ has_unsaved_changes_

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

Whether any of the catalogs have unsaved changes.

Definition at line 37 of file asset_catalog_collection.hh.

Referenced by deep_copy().


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