1
1

Cleanup: Asset Catalogs, add type alias for asset catalog maps

Add alias for `Map<CatalogID, std::unique_ptr<AssetCatalog>>` to make the
rest of the code a bit simpler.

No functional changes.
This commit is contained in:
2021-10-11 17:59:42 +02:00
parent ecedef09e7
commit 3de76a067a

View File

@@ -40,16 +40,18 @@
namespace blender::bke {
class AssetCatalog;
class AssetCatalogCollection;
class AssetCatalogDefinitionFile;
class AssetCatalogFilter;
class AssetCatalogTree;
using CatalogID = bUUID;
using CatalogPathComponent = std::string;
/* Would be nice to be able to use `std::filesystem::path` for this, but it's currently not
* available on the minimum macOS target version. */
using CatalogFilePath = std::string;
class AssetCatalog;
class AssetCatalogDefinitionFile;
class AssetCatalogFilter;
class AssetCatalogTree;
using OwningAssetCatalogMap = Map<CatalogID, std::unique_ptr<AssetCatalog>>;
/* Manages the asset catalogs of a single asset library (i.e. of catalogs defined in a single
* directory hierarchy). */
@@ -131,8 +133,8 @@ class AssetCatalogService {
protected:
/* These pointers are owned by this AssetCatalogService. */
Map<CatalogID, std::unique_ptr<AssetCatalog>> catalogs_;
Map<CatalogID, std::unique_ptr<AssetCatalog>> deleted_catalogs_;
OwningAssetCatalogMap catalogs_;
OwningAssetCatalogMap deleted_catalogs_;
std::unique_ptr<AssetCatalogDefinitionFile> catalog_definition_file_;
std::unique_ptr<AssetCatalogTree> catalog_tree_ = std::make_unique<AssetCatalogTree>();
CatalogFilePath asset_library_root_;