Classes¶
Assets
Brief descriptions¶
Structures |
|
Provides an interface for granting access to the loaded assets. |
|
Provides an interface for loading assets into containers. |
|
Provides interface for retrieving asset views. |
|
API to receive assets system events. |
|
Classes |
|
Provides asset reference generic functionality. |
|
Encapsulates a reference to an asset. |
|
Detailed information¶
IAssetContainer¶
engine/core/modules/assets/include/nau/assets/asset_container.h
-
struct IAssetContainer : public virtual IRefCounted¶
Provides an interface for granting access to the loaded assets.
Public Types
-
using Ptr = nau::Ptr<IAssetContainer>¶
-
using Ptr = nau::Ptr<IAssetContainer>¶
IAssetContainerLoader¶
engine/core/modules/assets/include/nau/assets/asset_container.h
-
struct IAssetContainerLoader¶
Public Functions
-
virtual ~IAssetContainerLoader() = default¶
Destructor.
-
virtual eastl::vector<eastl::string_view> getSupportedAssetKind() const¶
Retrieves a collection of asset kinds supported by the implementation.
- Returns:
A collection of asset kind names supported by the interface implementation.
-
virtual async::Task<IAssetContainer::Ptr> loadFromStream(io::IStreamReader::Ptr, AssetContentInfo info) = 0¶
Schedules asset load from a byte stream into a container.
- Parameters:
stream – [in] A pointer to the byte stream to load the asset from.
info – [in] Additional asset information.
- Returns:
Task object providing access to the operation status as well as the resulted asset container.
-
virtual RuntimeReadonlyDictionary::Ptr getDefaultImportSettings() const = 0¶
Retrieves the default settings applied when loading an asset.
- Returns:
A pointer to the retrieved object.
-
virtual ~IAssetContainerLoader() = default¶
IAssetContainerBuilder¶
engine/core/modules/assets/include/nau/assets/asset_container_builder.h
-
struct IAssetContainerBuilder¶
IAssetDB¶
engine/core/modules/assets/include/nau/assets/asset_db.h
-
struct IAssetDB¶
Public Functions
-
virtual void addAssetDB(io::FsPath dbPath) = 0¶
-
virtual void reloadAssetDB(io::FsPath dbPath) = 0¶
-
virtual AssetMetaInfoBase findAssetMetaInfoByUid(const Uid &uid) const = 0¶
-
virtual eastl::vector<AssetMetaInfoBase> findAssetMetaInfoByKind(const eastl::string &kind) const = 0¶
-
virtual eastl::string getNausdPathFromUid(const Uid &uid) const = 0¶
-
virtual Uid getUidFromNausdPath(const eastl::string &nausdPath) const = 0¶
-
virtual eastl::string getSourcePathFromUid(const Uid &uid) const = 0¶
-
virtual Uid getUidFromSourcePath(const eastl::string &sourcePath) const = 0¶
-
virtual eastl::string getSourcePathFromNausdPath(const eastl::string &nausdPath) const = 0¶
-
virtual eastl::string getNausdPathFromSourcePath(const eastl::string &sourcePath) const = 0¶
-
virtual void addAssetDB(io::FsPath dbPath) = 0¶
AssetViewDescription¶
engine/core/modules/assets/include/nau/assets/asset_descriptor.h
IAssetDescriptor¶
engine/core/modules/assets/include/nau/assets/asset_descriptor.h
-
struct IAssetDescriptor : public virtual IRefCounted¶
Provides interface for retrieving asset views.
Public Functions
-
virtual async::Task<IAssetView::Ptr> getAssetView(const AssetViewDescription& = {}) = 0¶
Schedules asset view retrieval.
- Parameters:
assetViewDesc – [in] Description of the asset view to retrieve (first of all, its type).
- Returns:
Task object providing the operation status as well as a pointer to the retrieved view.
-
virtual async::Task<ReloadableAssetView::Ptr> getReloadableAssetView(const AssetViewDescription& = {}) = 0¶
-
virtual async::Task<nau::Ptr<>> getRawAsset() = 0¶
-
virtual void load() = 0¶
Requests asset load.
Current implementation supports asset load at the first getAssetView invokation. However, a ‘pre-load’ can be requested using load method.
-
virtual UnloadResult unload() = 0¶
Clears resource cache.
- Returns:
Unloading result.
-
virtual LoadState getLoadState() const = 0¶
Retrieves asset loading operation status.
- Returns:
Loading status value.
-
template<std::derived_from<IAssetView> ViewType>
async::Task<nau::Ptr<ViewType>> getAssetViewTyped()¶ Schedules asset view retrieval.
- Template Parameters:
ViewType – Type of the asset view to retrieve. It has to be a subclass of IAssetView.
- Returns:
Task object providing the operation status as well as a pointer to the retrieved view.
-
virtual async::Task<IAssetView::Ptr> getAssetView(const AssetViewDescription& = {}) = 0¶
IAssetDescriptorFactory¶
engine/core/modules/assets/include/nau/assets/asset_descriptor_factory.h
-
struct IAssetDescriptorFactory¶
Public Functions
-
virtual IAssetDescriptor::Ptr createAssetDescriptor(IAssetContainer &container, eastl::string_view innerPath) = 0¶
-
virtual void addAssetContainer(const AssetPath &assetPath, nau::Ptr<IAssetContainer> container) = 0¶
-
virtual IAssetDescriptor::Ptr createAssetDescriptor(IAssetContainer &container, eastl::string_view innerPath) = 0¶
IAssetListener¶
engine/core/modules/assets/include/nau/assets/asset_listener.h
-
struct IAssetListener¶
API to receive assets system events.
Public Types
-
using LockAssetFunctor = Functor<async::Task<>()>¶
Public Functions
-
NAU_TYPEID(nau::IAssetListener)¶
-
virtual void onAssetLoad(IAssetDescriptor::AssetId assetId) = 0¶
-
virtual void onAssetUnload(IAssetDescriptor::AssetId assetId) = 0¶
-
virtual async::Task onAssetViewUpdate(IAssetDescriptor::AssetId assetId, IAssetView::Ptr oldAssetView, IAssetView::Ptr newAssetView) = 0¶
Is called by the system when the asset view needs to be updated.
-
using LockAssetFunctor = Functor<async::Task<>()>¶
IAssetManager¶
engine/core/modules/assets/include/nau/assets/asset_manager.h
-
struct IAssetManager¶
Public Functions
-
virtual IAssetDescriptor::Ptr openAsset(const AssetPath &assetPath) = 0¶
-
virtual IAssetDescriptor::Ptr preLoadAsset(const AssetPath &assetPath) = 0¶
-
virtual IAssetDescriptor::Ptr findAssetById(IAssetDescriptor::AssetId) = 0¶
-
virtual IAssetDescriptor::Ptr findAsset(const AssetPath &assetPath) = 0¶
-
virtual void unload(UnloadAssets flag = UnloadAssets::OnlyUnused) = 0¶
-
virtual IAssetDescriptor::Ptr openAsset(const AssetPath &assetPath) = 0¶
AssetMetaInfoBase¶
engine/core/modules/assets/include/nau/assets/asset_meta_info.h
-
struct AssetMetaInfoBase¶
assets::GenericAssetTag¶
engine/core/modules/assets/include/nau/assets/asset_ref.h
-
struct GenericAssetTag¶
Temporary generic asset tags.
RuntimeAssetRefValue¶
engine/core/modules/assets/include/nau/assets/asset_ref.h
-
struct RuntimeAssetRefValue : public virtual RuntimePrimitiveValue¶
Public Functions
- virtual RuntimePrimitiveValue bool isAssignable (const AssetRefBase &assetRef)=0
-
virtual bool setAssetRef(AssetRefBase assetRef) = 0¶
-
virtual AssetRefBase getAssetRef() const = 0¶
IImportSettingsProvider¶
engine/core/modules/assets/include/nau/assets/import_settings_provider.h
-
struct IImportSettingsProvider¶
Public Functions
-
virtual ~IImportSettingsProvider() = default¶
-
virtual RuntimeReadonlyDictionary::Ptr getAssetImportSettings(const io::FsPath &assetPath, const struct IAssetContainerLoader&) = 0¶
-
virtual ~IImportSettingsProvider() = default¶
ReloadableAssetView¶
engine/core/modules/assets/include/nau/assets/reloadable_asset_view.h
-
struct ReloadableAssetView : public virtual IRefCounted¶
Public Types
-
using Ptr = nau::Ptr<nau::ReloadableAssetView>¶
-
using AssetViewPtr = nau::Ptr<IAssetView>¶
Public Functions
-
ReloadableAssetView(nullptr_t)¶
-
ReloadableAssetView(const ReloadableAssetView &reloadableAssetView) = delete¶
-
ReloadableAssetView(ReloadableAssetView &&reloadableAssetView) = delete¶
-
~ReloadableAssetView() = default¶
-
AssetViewPtr get()¶
-
template<std::derived_from<IAssetView> AssetViewType>
inline void getTyped(nau::Ptr<AssetViewType> &ptr)¶
Private Functions
-
ReloadableAssetView() = default¶
-
ReloadableAssetView(AssetViewPtr assetView)¶
-
void reloadAssetView(AssetViewPtr newAssetView)¶
Private Members
-
threading::SpinLock m_mutex¶
-
nau::Ptr<IAssetView> m_assetView = nullptr¶
- friend AssetDescriptorImpl
- friend AssetViewEntry
Friends
- friend struct ::nau::rtti_detail::RttiClassStorage
-
using Ptr = nau::Ptr<nau::ReloadableAssetView>¶
AssetPath¶
engine/core/modules/assets/include/nau/assets/asset_path.h
-
class AssetPath¶
Public Functions
-
AssetPath()¶
-
AssetPath(eastl::string_view fullAssetPath)¶
-
AssetPath(eastl::string_view scheme, eastl::string_view assetContainerPath, eastl::string_view assetInnerPath = {})¶
-
eastl::string_view getScheme() const¶
-
eastl::string_view getContainerPath() const¶
-
eastl::string_view getSchemeAndContainerPath() const¶
-
eastl::string_view getAssetInnerPath() const¶
-
bool isEmpty() const¶
-
bool hasScheme(eastl::string_view scheme) const¶
-
eastl::string toString() const¶
-
explicit operator bool() const¶
-
bool operator==(eastl::string_view right) const¶
Public Static Functions
-
static bool isValid(eastl::string_view fullAssetPath)¶
Private Functions
-
inline size_t getHashCode() const¶
Private Members
-
eastl::string m_assetFullPath¶
-
AssetPath()¶
IAssetPathResolver¶
engine/core/modules/assets/include/nau/assets/asset_path_resolver.h
-
class IAssetPathResolver¶
AssetRefBase¶
engine/core/modules/assets/include/nau/assets/asset_ref.h
-
class AssetRefBase¶
Provides asset reference generic functionality.
Subclassed by nau::AssetRef< assets::AnimationAssetTag >, nau::AssetRef< assets::SkeletonAssetTag >, nau::AssetRef< assets::MaterialAssetTag >, nau::AssetRef< assets::SkinnedMeshAssetTag >, nau::AssetRef< assets::StaticMeshAssetTag >, nau::AssetRef< assets::TextureAssetTag >, nau::AssetRef< assets::UiSceneAssetTag >, nau::AssetRef< T >
Public Functions
-
virtual ~AssetRefBase()¶
Destructor.
-
explicit operator bool() const¶
Checks whether.
- Returns:
-
template<std::derived_from<IAssetView> ViewType>
async::Task<nau::Ptr<ViewType>> getAssetViewTyped()¶ Schedules asset view retrieval.
- Template Parameters:
ViewType – Type of the asset view to retrieve. It has to be a subclass of IAssetView.
- Returns:
Task object that provides operation status info as well as access to the retrieved view.
-
template<std::derived_from<IAssetView> ViewType>
async::Task<ReloadableAssetView::Ptr> getReloadableAssetViewTyped()¶
-
inline virtual bool isAssignable(const AssetRefBase&) const¶
Checks whether an asset reference can be bound to a different asset.
- Parameters:
assetRef – [in] Reference to an asset to bind.
- Returns:
true
if assignment is possible,false
otherwise.
-
AssetRefBase() noexcept = default¶
Default constructor.
-
AssetRefBase(AssetPath assetPath, bool loadOnDemand = false) noexcept¶
Initialization constructor.
- Parameters:
Path – [in] to the asset to bind.
-
AssetRefBase(eastl::string_view assetPathStr, bool loadOnDemand = false) noexcept¶
-
AssetRefBase(IAssetDescriptor::Ptr) noexcept¶
Initialization constructor.
- Parameters:
Description – [in] of the asset to bind.
-
AssetRefBase(const AssetRefBase&) noexcept¶
Copy constructor.
- Parameters:
assetRef – [in] Reference to the asset to bind.
-
AssetRefBase(AssetRefBase&&) noexcept¶
Move constructor.
- Parameters:
assetRef – [in] Reference to the asset to bind.
-
AssetRefBase &operator=(const AssetRefBase&) noexcept¶
Assignment operator.
- Parameters:
assetRef – [in] Reference to the asset to bind.
- Returns:
Resulted reference object.
-
AssetRefBase &operator=(AssetRefBase&&) noexcept¶
Move-assignment operator.
- Parameters:
assetRef – [in] Reference to the asset to bind.
- Returns:
Resulted reference object.
-
AssetRefBase &operator=(std::nullptr_t) noexcept¶
Protected Attributes
-
IAssetDescriptor::Ptr m_assetDescriptor¶
Private Functions
-
async::Task<IAssetView::Ptr> getAssetView(const AssetViewDescription& = {})¶
Schedules asset view retrieval.
- Parameters:
viewDescription – [in] Encapsulates asset information.
- Returns:
Task object that provides operation status info as well as access to the retrieved view.
-
async::Task<ReloadableAssetView::Ptr> getReloadableAssetView(const AssetViewDescription = {})¶
Friends
-
friend Result parse(std::string_view assetPath, AssetRefBase &assetRef)¶
-
friend std::string toString(const AssetRefBase &assetRef)¶
-
virtual ~AssetRefBase()¶
AssetRef¶
engine/core/modules/assets/include/nau/assets/asset_ref.h
-
template<typename T = assets::GenericAssetTag>
class AssetRef : public nau::AssetRefBase¶ Encapsulates a reference to an asset.
- Template Parameters:
T – Type of the asset the reference is bound to.
Public Functions
-
AssetRef(const AssetRef<T>&) noexcept¶
Copy constructor.
- Parameters:
other – [in] Reference to the asset to bind.
-
AssetRef(AssetRef<T>&&) noexcept¶
Move constructor.
- Parameters:
other – [in] Reference to the asset to bind.
-
AssetRef &operator=(const AssetRef&) noexcept¶
Assignment operator.
- Parameters:
assetRef – [in] Reference to the asset to bind.
- Returns:
Resulted reference object.
-
AssetRef &operator=(AssetRef&&) noexcept¶
Move-assignment operator.
- Parameters:
assetRef – [in] Reference to the asset to bind.
- Returns:
Resulted reference object.
-
AssetRef &operator=(const AssetRefBase&) noexcept¶
Assignment operator.
- Parameters:
assetRef – [in] Reference to the asset to bind.
- Returns:
Resulted reference object.
-
AssetRef &operator=(AssetRefBase&&) noexcept¶
Move-assignment operator.
- Parameters:
assetRef – [in] Reference to the asset to bind.
- Returns:
Resulted reference object.
-
inline virtual bool isAssignable(const AssetRefBase&) const override¶
Checks whether an asset reference can be bound to a different asset.
- Parameters:
assetRef – [in] Reference to an asset to bind.
- Returns:
true
if assignment is possible,false
otherwise.
-
AssetRefBase() noexcept = default¶
Default constructor.
-
AssetRefBase(AssetPath assetPath, bool loadOnDemand = false) noexcept¶
Initialization constructor.
- Parameters:
Path – [in] to the asset to bind.
-
AssetRefBase(eastl::string_view assetPathStr, bool loadOnDemand = false) noexcept¶
-
AssetRefBase(IAssetDescriptor::Ptr) noexcept¶
Initialization constructor.
- Parameters:
Description – [in] of the asset to bind.
-
AssetRefBase(const AssetRefBase&) noexcept¶
Copy constructor.
- Parameters:
assetRef – [in] Reference to the asset to bind.
-
AssetRefBase(AssetRefBase&&) noexcept¶
Move constructor.
- Parameters:
assetRef – [in] Reference to the asset to bind.
Public Static Attributes
-
static constexpr bool HasOwnRuntimeValue = true¶
ser_detail::RuntimeAssetRefValueImpl¶
engine/core/modules/assets/include/nau/assets/asset_ref.h
-
template<typename T>
class RuntimeAssetRefValueImpl : public NativePrimitiveRuntimeValueBase<RuntimeAssetRefValue>, public virtual RuntimeStringValue¶ Public Functions
-
inline bool isMutable() const override¶
-
inline bool isAssignable(const AssetRefBase &assetRef) override¶
-
inline bool setAssetRef(AssetRefBase assetRef) override¶
-
inline AssetRefBase getAssetRef() const override¶
-
inline Result setString(std::string_view str) override¶
-
inline std::string getString() const override¶
Private Types
-
using Base = NativePrimitiveRuntimeValueBase<RuntimeAssetRefValue>¶
-
inline bool isMutable() const override¶