A type serving as the base for types that hold a pointer to a LocalResourcePool and a fixed category string.
Definition at line 220 of file resources.inl.
Public Type Index: | |
| using | SPResourcePool = SharedPtr<resources::ResourcePool, MonoAllocator> |
Public Field Index: | |
| NCString | ResourceCategory |
Public Method Index: | |
| ResourceHolder (const NCString &resourceCategory=nullptr) | |
| ResourceHolder (SPResourcePool &pool, const NCString &resourceCategory) | |
| void | BootstrapResource (const NString &name, const String &data) |
| const String & | GetResource (const NString &name) |
| ResourcePool & | GetResourcePool () |
| SPResourcePool & | GetResourcePoolSP () |
| bool | HasPool () |
| void | Set (SPResourcePool &pool, const NCString &resourceCategory=nullptr) |
| const String & | TryResource (const NString &name) |
Protected Field Index: | |
| SPResourcePool | resourcePool |
| Shared pointer to the resource pool. | |
| using alib::resources::ResourceHolder::SPResourcePool = SharedPtr<resources::ResourcePool, MonoAllocator> |
Type definition used for sharing resource-pool instances. With default-bootstrapping, an instance of type LocalResourcePool is used here, which is created with allocator instance GLOBAL_ALLOCATOR.
Definition at line 225 of file resources.inl.
| NCString alib::resources::ResourceHolder::ResourceCategory |
The name of the resource category of externalized string resources defined and used by this resource holder.
Definition at line 234 of file resources.inl.
|
protected |
Shared pointer to the resource pool.
Definition at line 229 of file resources.inl.
|
inline |
Constructor.
| resourceCategory | Value for field ResourceCategory. |
Definition at line 238 of file resources.inl.
|
inline |
Constructor.
| pool | Value for the field resourcePool. |
| resourceCategory | Value for the field ResourceCategory. |
Definition at line 244 of file resources.inl.
|
inline |
Shortcut method that invokes void Bootstrap(const NString&, const NString&, const String&) on field resourcePool providing field ResourceCategory as a parameter.
| name | The resource name. |
| data | The resource data string. |
Definition at line 267 of file resources.inl.
Shortcut method that invokes const String & Get(const NString&, const String&, bool) on field resourcePool providing field ResourceCategory as parameter.
With debug-builds, this method asserts that a resource was found. If this is not wanted, use TryResource.
| name | The resource name. |
Definition at line 287 of file resources.inl.
|
inline |
Returns a reference (not the shared-pointer!) to the resource pool held in our SharedPtr.
Definition at line 277 of file resources.inl.
|
inline |
Returns a reference (!) to the shared pointer holding the resource pool.
Definition at line 273 of file resources.inl.
|
inline |
Determines if a resource pool is set.
true if the field resourcePool is not nulled, false otherwise. Definition at line 260 of file resources.inl.
|
inline |
Constructor.
| pool | Value for the field resourcePool. |
| resourceCategory | Value for field ResourceCategory. If not given (nulled), then the old value is preserved. |
Definition at line 252 of file resources.inl.
Shortcut method that invokes const String & Get(const NString&, const String&, bool) on field resourcePool providing field ResourceCategory as parameter.
| name | The resource name. |
Definition at line 301 of file resources.inl.