Blender  V3.3
asset_library_service.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #pragma once
8 
9 #ifndef __cplusplus
10 # error This is a C++-only header file.
11 #endif
12 
13 #include "BKE_asset_library.hh"
14 
15 #include "BLI_map.hh"
16 
17 #include <memory>
18 
19 namespace blender::bke {
20 
35  public:
36  using AssetLibraryPtr = std::unique_ptr<AssetLibrary>;
37 
38  AssetLibraryService() = default;
39  ~AssetLibraryService() = default;
40 
42  static AssetLibraryService *get();
43 
45  static void destroy();
46 
51 
54 
56  bool has_any_unsaved_catalogs() const;
57 
58  protected:
59  static std::unique_ptr<AssetLibraryService> instance_;
60 
61  /* Mapping absolute path of the library's top-level directory to the AssetLibrary instance. */
64 
65  /* Handlers for managing the life cycle of the AssetLibraryService instance. */
68 
70  static void allocate_service_instance();
71 
75  void app_handler_register();
77 };
78 
79 } // namespace blender::bke
static AssetLibraryService * get()
AssetLibrary * get_asset_library_on_disk(StringRefNull top_level_directory)
static std::unique_ptr< AssetLibraryService > instance_
std::unique_ptr< AssetLibrary > AssetLibraryPtr
Map< std::string, AssetLibraryPtr > on_disk_libraries_