Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2021-10-11 18:59:42 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-10-11 19:00:11 +0300
commit3de76a067a157b8fafc18809e629fdd4aa1816c0 (patch)
treed9b53c9f70242a3d8e6690434e60c1598a1cca65 /source/blender/blenkernel/BKE_asset_catalog.hh
parentecedef09e7fde9c032b746137211f02acfb6160a (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/BKE_asset_catalog.hh')
-rw-r--r--source/blender/blenkernel/BKE_asset_catalog.hh16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_asset_catalog.hh b/source/blender/blenkernel/BKE_asset_catalog.hh
index e9f0aa6311c..bd18fdf1d6e 100644
--- a/source/blender/blenkernel/BKE_asset_catalog.hh
+++ b/source/blender/blenkernel/BKE_asset_catalog.hh
@@ -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_;