|
3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
|
Manages the lifetimes of all loaded assets. More...
#include <ContentManager.hpp>


Public Member Functions | |
| uint | Load (ref UUID uuid, string path) |
| void | Remove (uint id) |
| void | Clear () |
| ulong | Count () |
| ContentManager (IGame *owner) | |
| Constructs an instance of ContentManager. | |
| ContentManager (const ContentManager &)=delete | |
| ContentManager (ContentManager &&) noexcept=default | |
| ContentManager & | operator= (const ContentManager &)=delete |
| ContentManager & | operator= (ContentManager &&) noexcept=default |
| template<AssetType T> | |
| void | RegisterType (Tag< T > dummy) |
| Registers an type T into this ContentManager. | |
| template<AssetType T> | |
| T * | Load (const std::filesystem::path &path, AssetID< T > *refID=nullptr) |
| Loads an asset of type T from the specified path. | |
| template<AssetType T, typename ... Args> | |
| T * | Load (const std::filesystem::path &path, AssetID< T > *refID, Args &&...params) |
| Loads an asset of type T with additional constructor parameters. | |
| IAsset * | Load (const Reflection::UUID &uuid, const std::filesystem::path &path, unsigned *refID=nullptr) |
| Type erased asset loading function. | |
| void | Reload (unsigned ref) |
| Reloads an asset by its reference ID. | |
| template<AssetType T> | |
| T * | operator[] (AssetID< T > ref) const |
| Returns an pointer to the asset of type T associated with the given reference ID. | |
| IAsset * | At (unsigned ref) const |
| Returns an pointer to the asset associated with the given reference ID. | |
| std::filesystem::path | GetAssetPath (unsigned id) const noexcept |
| Returns the path an asset with the specified ID was loaded from. | |
| Reflection::UUID | GetAssetType (unsigned id) const noexcept |
| Returns the type UUID of the specified asset ID. | |
| std::string | GetAssetName (unsigned id) const noexcept |
| Returns the name of the specified asset ID. | |
| std::vector< AssetEntry >::iterator | begin () |
| std::vector< AssetEntry >::iterator | end () |
| void | RemoveAsset (unsigned id) |
| Frees an asset from the ContentManager by its ID. | |
| void | Clear () |
| Removes all assets from the ContentManager. | |
| Graphics::IGraphicsDevice * | GetDevice () const noexcept |
| Returns the graphics device associated with this ContentManager. | |
| size_t | Count () const noexcept |
| Returns the number of loaded assets in the ContentManager. | |
| ~ContentManager () override=default | |
| Public Member Functions inherited from Engine3DRadSpace.NatPtrWrapper | |
| virtual void | Dispose () |
| Public Member Functions inherited from Engine3DRadSpace.IService | |
| IGame * | GetOwner () const noexcept |
| Gets the owner of this instance. | |
| virtual | ~IService ()=default |
Public Attributes | |
| IAsset | |
Additional Inherited Members | |
| Protected Member Functions inherited from Engine3DRadSpace.InstIService | |
| InstIService (IntPtr handle) | |
| InstIService (IntPtr handle, bool ownsHandle) | |
| Protected Member Functions inherited from Engine3DRadSpace.NatPtrWrapper | |
| NatPtrWrapper (IntPtr handle, Action< IntPtr > fnDestroy) | |
| NatPtrWrapper (Action< IntPtr > fnDestroy) | |
| void | Reset (IntPtr newObj) |
| void | Dispose (bool disposing) |
| Protected Member Functions inherited from Engine3DRadSpace.IService | |
| IService () | |
| IService (IGame *owner) | |
| IService (const IService &)=delete | |
| IService & | operator= (const IService &)=delete |
| IService (IService &&) noexcept=default | |
| IService & | operator= (IService &&) noexcept=default |
| Protected Attributes inherited from Engine3DRadSpace.NatPtrWrapper | |
| IntPtr | _handle |
| bool | _disposed |
| Protected Attributes inherited from Engine3DRadSpace.IService | |
| IGame * | _owner = nullptr |
| Properties inherited from Engine3DRadSpace.InstIService | |
| IGame | Owner [get] |
| Properties inherited from Engine3DRadSpace.NatPtrWrapper | |
| IntPtr | Handle [get] |
| Properties inherited from Engine3DRadSpace.IService | |
| IGame | Owner [get] |
Manages the lifetimes of all loaded assets.
| ContentManager::ContentManager | ( | IGame * | owner | ) |
Constructs an instance of ContentManager.
| owner | Owner of this ContentManager. |
|
delete |
|
defaultnoexcept |
|
overridedefault |
| IAsset * ContentManager::At | ( | unsigned | ref | ) | const |
Returns an pointer to the asset associated with the given reference ID.
| ref | Asset reference ID |
| std::vector< ContentManager::AssetEntry >::iterator ContentManager::begin | ( | ) |
|
inline |
Removes all assets from the ContentManager.
|
inline |
|
noexcept |
Returns the number of loaded assets in the ContentManager.
| std::vector< ContentManager::AssetEntry >::iterator ContentManager::end | ( | ) |
|
noexcept |
Returns the name of the specified asset ID.
| id | Asset ID |
|
noexcept |
Returns the path an asset with the specified ID was loaded from.
| id | Asset ID |
|
noexcept |
Returns the type UUID of the specified asset ID.
| id | Asset ID |
|
noexcept |
Returns the graphics device associated with this ContentManager.
|
inline |
| IAsset * ContentManager::Load | ( | const Reflection::UUID & | uuid, |
| const std::filesystem::path & | path, | ||
| unsigned * | refID = nullptr ) |
Type erased asset loading function.
| uuid | UUID of the asset type. |
| path | Path on disk to the asset. |
| refID | Optional reference ID to store the asset's ID. |
|
inline |
Loads an asset of type T with additional constructor parameters.
| ...Args | Extra type arguments |
| T | Asset type |
| path | Path on disk to the asset. |
| refID | Optional reference ID to store the asset's ID. |
| ...params | Additional constructor parameters. |
|
inline |
Loads an asset of type T from the specified path.
| T | Asset type. |
| path | Path on disk to the asset. |
| refID | Optional reference ID to store the asset's ID. |
IMPLEMENTATION FOR ContentManager TEMPLATE METHODS
|
delete |
|
defaultnoexcept |
|
inline |
Returns an pointer to the asset of type T associated with the given reference ID.
| T | Asset type |
| ref | Asset reference ID |
|
inline |
Registers an type T into this ContentManager.
| T | Type that must satisfy the AssetType concept |
| dummy | Type dummy used for operator overloading |
| void ContentManager::Reload | ( | unsigned | ref | ) |
Reloads an asset by its reference ID.
| ref | Asset reference ID |
|
inline |
| void ContentManager::RemoveAsset | ( | unsigned | id | ) |
Frees an asset from the ContentManager by its ID.
| id | Asset ID |
| Engine3DRadSpace.Content.ContentManager.IAsset |