|
OpenLexocad
27.0
|
Shared resource handle. More...
#include <entt.hpp>
Public Member Functions | |
| handle () ENTT_NOEXCEPT=default | |
| Default constructor. More... | |
| const Resource & | get () const ENTT_NOEXCEPT |
| Gets a reference to the managed resource. More... | |
| Resource & | get () ENTT_NOEXCEPT |
| Gets a reference to the managed resource. More... | |
| operator const Resource & () const ENTT_NOEXCEPT | |
| Gets a reference to the managed resource. More... | |
| operator Resource & () ENTT_NOEXCEPT | |
| Gets a reference to the managed resource. More... | |
| const Resource & | operator * () const ENTT_NOEXCEPT |
| Gets a reference to the managed resource. More... | |
| Resource & | operator * () ENTT_NOEXCEPT |
| Gets a reference to the managed resource. More... | |
| const Resource * | operator-> () const ENTT_NOEXCEPT |
| Gets a pointer to the managed resource. More... | |
| Resource * | operator-> () ENTT_NOEXCEPT |
| Gets a pointer to the managed resource. More... | |
| operator bool () const | |
| Returns true if a handle contains a resource, false otherwise. More... | |
Friends | |
| struct | cache< Resource > |
| Resource handles are friends of their caches. More... | |
Shared resource handle.
A shared resource handle is a small class that wraps a resource and keeps it alive even if it's deleted from the cache. It can be either copied or moved. A handle shares a reference to the same resource with all the other handles constructed for the same identifier.
As a rule of thumb, resources should never be copied nor moved. Handles are the way to go to keep references to them.
| Resource | Type of resource managed by a handle. |
|
default |
Default constructor.
|
inline |
Gets a reference to the managed resource.
|
inline |
Gets a reference to the managed resource.
|
inline |
Gets a reference to the managed resource.
|
inline |
Gets a reference to the managed resource.
|
inlineexplicit |
Returns true if a handle contains a resource, false otherwise.
|
inline |
Gets a reference to the managed resource.
|
inline |
Gets a reference to the managed resource.
|
inline |
Gets a pointer to the managed resource.
nullptr if the handle contains no resource at all.
|
inline |
Gets a pointer to the managed resource.
nullptr if the handle contains no resource at all.
|
friend |
Resource handles are friends of their caches.