|
Toast Engine
|
Base class for type-erased asset handles. More...
#include <core_types.hpp>


Public Member Functions | |
| HandleBase (Asset *asset) | |
| HandleBase (Asset *asset, toast::UID uid, std::string_view uri) | |
| Constructs a handle that stores its source UID. | |
| HandleBase (const HandleBase &other) | |
| auto | operator= (const HandleBase &other) -> HandleBase & |
| HandleBase (HandleBase &&other) noexcept | |
| auto | operator= (HandleBase &&other) noexcept -> HandleBase & |
| void | onChangeCallback (std::function< void()> &&callback) |
| auto | hasValue () const noexcept -> bool |
| auto | uid () const noexcept -> toast::UID |
| auto | path () const noexcept -> std::string_view |
| auto | get () noexcept -> Asset & |
| auto | get () const noexcept -> const Asset & |
| auto | operator-> () noexcept -> Asset * |
| auto | operator-> () const noexcept -> const Asset * |
| auto | operator== (const HandleBase &other) const -> bool |
| auto | operator< (const HandleBase &other) const -> bool |
Protected Attributes | |
| Asset * | m_asset = nullptr |
| toast::UID | m_uid |
| std::string | m_uri |
Base class for type-erased asset handles.
| assets::HandleBase::HandleBase | ( | Asset * | asset, |
| toast::UID | uid, | ||
| std::string_view | uri ) |
Constructs a handle that stores its source UID.
If the pointer is null (unresolved handle), the Handle will still have a uid so serialization won't explode the engine. It also will make handling missing assets easier
| void assets::HandleBase::onChangeCallback | ( | std::function< void()> && | callback | ) |
Registers a function that will be called whenever a change on the handle's asset happens