|
| | resource_cache () |
| | Default constructor.
|
| |
| | resource_cache (const allocator_type &allocator) |
| | Constructs an empty cache with a given allocator.
|
| |
| | resource_cache (const loader_type &callable, const allocator_type &allocator=allocator_type{}) |
| | Constructs an empty cache with a given allocator and loader.
|
| |
|
| resource_cache (const resource_cache &)=default |
| | Default copy constructor.
|
| |
| | resource_cache (const resource_cache &other, const allocator_type &allocator) |
| | Allocator-extended copy constructor.
|
| |
|
| resource_cache (resource_cache &&)=default |
| | Default move constructor.
|
| |
| | resource_cache (resource_cache &&other, const allocator_type &allocator) |
| | Allocator-extended move constructor.
|
| |
| resource_cache & | operator= (const resource_cache &)=default |
| | Default copy assignment operator.
|
| |
| resource_cache & | operator= (resource_cache &&)=default |
| | Default move assignment operator.
|
| |
| constexpr allocator_type | get_allocator () const noexcept |
| | Returns the associated allocator.
|
| |
| const_iterator | cbegin () const noexcept |
| | Returns an iterator to the beginning.
|
| |
| const_iterator | begin () const noexcept |
| | Returns an iterator to the beginning.
|
| |
| iterator | begin () noexcept |
| | Returns an iterator to the beginning.
|
| |
| const_iterator | cend () const noexcept |
| | Returns an iterator to the end.
|
| |
| const_iterator | end () const noexcept |
| | Returns an iterator to the end.
|
| |
| iterator | end () noexcept |
| | Returns an iterator to the end.
|
| |
| bool | empty () const noexcept |
| | Returns true if a cache contains no resources, false otherwise.
|
| |
| size_type | size () const noexcept |
| | Number of resources managed by a cache.
|
| |
| void | clear () noexcept |
| | Clears a cache.
|
| |
| template<typename... Args> |
| std::pair< iterator, bool > | load (const id_type id, Args &&...args) |
| | Loads a resource, if its identifier does not exist.
|
| |
| template<typename... Args> |
| std::pair< iterator, bool > | force_load (const id_type id, Args &&...args) |
| | Force loads a resource, if its identifier does not exist.
|
| |
| resource< const value_type > | operator[] (const id_type id) const |
| | Returns a handle for a given resource identifier.
|
| |
| resource< value_type > | operator[] (const id_type id) |
| | Returns a handle for a given resource identifier.
|
| |
| bool | contains (const id_type id) const |
| | Checks if a cache contains a given identifier.
|
| |
| iterator | erase (const_iterator pos) |
| | Removes an element from a given position.
|
| |
| iterator | erase (const_iterator first, const_iterator last) |
| | Removes the given elements from a cache.
|
| |
| size_type | erase (const id_type id) |
| | Removes the given elements from a cache.
|
| |
| loader_type | loader () const |
| | Returns the loader used to create resources.
|
| |
Basic cache for resources of any type.
- Template Parameters
-
| Type | Type of resources managed by a cache. |
| Loader | Type of loader used to create the resources. |
| Allocator | Type of allocator used to manage memory and elements. |
Definition at line 153 of file cache.hpp.