Changeset View
Changeset View
Standalone View
Standalone View
source/blender/asset_system/intern/asset_library_service.hh
- This file was moved from source/blender/blenkernel/intern/asset_library_service.hh.
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| /** \file | /** \file | ||||
| * \ingroup bke | * \ingroup asset_system | ||||
| */ | */ | ||||
| #pragma once | #pragma once | ||||
| #ifndef __cplusplus | #include "AS_asset_library.hh" | ||||
| # error This is a C++-only header file. | |||||
| #endif | |||||
| #include "BKE_asset_library.hh" | |||||
| #include "BLI_function_ref.hh" | #include "BLI_function_ref.hh" | ||||
| #include "BLI_map.hh" | #include "BLI_map.hh" | ||||
| #include <memory> | #include <memory> | ||||
| struct AssetLibraryReference; | struct AssetLibraryReference; | ||||
| namespace blender::bke { | namespace blender::asset_system { | ||||
| /** | /** | ||||
| * Global singleton-ish that provides access to individual #AssetLibrary instances. | * Global singleton-ish that provides access to individual #AssetLibrary instances. | ||||
| * | * | ||||
| * Whenever a blend file is loaded, the existing instance of AssetLibraryService is destructed, and | * Whenever a blend file is loaded, the existing instance of AssetLibraryService is destructed, and | ||||
| * a new one is created -- hence the "singleton-ish". This ensures only information about relevant | * a new one is created -- hence the "singleton-ish". This ensures only information about relevant | ||||
| * asset libraries is loaded. | * asset libraries is loaded. | ||||
| * | * | ||||
| ▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | protected: | ||||
| /** | /** | ||||
| * Ensure the AssetLibraryService instance is destroyed before a new blend file is loaded. | * Ensure the AssetLibraryService instance is destroyed before a new blend file is loaded. | ||||
| * This makes memory management simple, and ensures a fresh start for every blend file. */ | * This makes memory management simple, and ensures a fresh start for every blend file. */ | ||||
| void app_handler_register(); | void app_handler_register(); | ||||
| void app_handler_unregister(); | void app_handler_unregister(); | ||||
| }; | }; | ||||
| } // namespace blender::bke | } // namespace blender::asset_system | ||||