#include <ResourceAccess.hpp>
Public Member Functions | |
ResourceAccess (Instance *inst) | |
Instance * | instance () const |
template<class TResource > | |
bool | has_path (ResourcePath const &path) |
template<class TResource > | |
const TResource * | get (ResourcePath const &path) |
template<class TResource > | |
void | each_resource (std::function< void(ResourcePath const &path) > const &) |
Public Attributes | |
ClientMarker | cm |
Detailed Description
When a resource is created, it is bound (Instance::bind) to one proxy Instance owned by ResourceManagementSystem (so the resource is effectively bound to the system). Users of ResourceAccess should not bind returned Instances to anything (might be changed in future). Currently, resources are never deallocated, but it is encouraged to use weak pointers to resources (will be useful in future). Some deallocation mechanisms should be done later, when the need arises.
Definition at line 15 of file ResourceAccess.hpp.
Constructor & Destructor Documentation
◆ ResourceAccess()
iv::ResourceAccess::ResourceAccess | ( | Instance * | inst | ) |
Definition at line 6 of file ResourceAccess.cpp.
Member Function Documentation
◆ instance()
Instance * iv::ResourceAccess::instance | ( | ) | const |
Definition at line 13 of file ResourceAccess.cpp.
◆ has_path()
bool iv::ResourceAccess::has_path | ( | ResourcePath const & | path | ) |
Definition at line 5 of file ResourceAccess.inl.
◆ get()
const TResource * iv::ResourceAccess::get | ( | ResourcePath const & | path | ) |
Definition at line 14 of file ResourceAccess.inl.
◆ each_resource()
void iv::ResourceAccess::each_resource | ( | std::function< void(ResourcePath const &path) > const & | ) |
Single ResourcePath can get returned multiple times - if more than one resource provider provides it - but only one instance with given ResourcePath is accessible (from provider with highest priority).
Definition at line 27 of file ResourceAccess.inl.
Member Data Documentation
◆ cm
ClientMarker iv::ResourceAccess::cm |
Definition at line 18 of file ResourceAccess.hpp.
The documentation for this class was generated from the following files:
- ivorium_systems/ResourceManagementSystem/ResourceAccess.hpp
- ivorium_systems/ResourceManagementSystem/ResourceAccess.cpp
- ivorium_systems/ResourceManagementSystem/ResourceAccess.inl