Set of published ResourceFactories which can be referenced by name.
More...
#include <ResourceFactory.hpp>
|
template<typename ResourceFactoryT > |
void | addResourceFactory () |
| Add a resource factory by its template type.
|
|
sparta::ResourceFactoryBase * | getResourceFactory (const std::string &name) |
| Returns a ResourceFactory with the given resource type name.
|
|
bool | hasResource (const std::string &name) const noexcept |
| Checks for a resource with the given resource type name.
|
|
std::string | renderResources (bool one_per_line=true) |
| Returns a string containing all resource names known by this object separated by newlines.
|
|
ResourceFactoryMap::const_iterator | begin () const |
| Get a constant begin iterator to the ResourceSet.
|
|
ResourceFactoryMap::const_iterator | end () const |
| Get a constant end iterator to the ResourceSet.
|
|
Set of published ResourceFactories which can be referenced by name.
Definition at line 323 of file ResourceFactory.hpp.
◆ ResourceFactoryMap
◆ addResourceFactory()
template<typename ResourceFactoryT >
void sparta::ResourceSet::addResourceFactory |
( |
| ) |
|
|
inline |
Add a resource factory by its template type.
- Template Parameters
-
ResourceFactoryT | Type of factory to add |
- Precondition
- This type of factory must not have been added to this ResourceSet
- Postcondition
- An instantiation of ResourceFactoryT will be held inside this ResourceSet and cab be looked up by it's name
Definition at line 337 of file ResourceFactory.hpp.
◆ begin()
ResourceFactoryMap::const_iterator sparta::ResourceSet::begin |
( |
| ) |
const |
|
inline |
Get a constant begin iterator to the ResourceSet.
Returns an interator to an internal std::pair: first is the name of the factory, second is the pointer to the factory.
Definition at line 373 of file ResourceFactory.hpp.
◆ end()
ResourceFactoryMap::const_iterator sparta::ResourceSet::end |
( |
| ) |
const |
|
inline |
◆ getResourceFactory()
Returns a ResourceFactory with the given resource type name.
- Exceptions
-
- Note
- Use renderResources to show all resources
◆ hasResource()
bool sparta::ResourceSet::hasResource |
( |
const std::string & |
name | ) |
const |
|
noexcept |
Checks for a resource with the given resource type name.
- Returns
- true if resource with given name is found, false otherwise
◆ renderResources()
std::string sparta::ResourceSet::renderResources |
( |
bool |
one_per_line = true | ) |
|
Returns a string containing all resource names known by this object separated by newlines.
- Parameters
-
one_per_line | Newline between each resource in output. If false, uses commas |
The documentation for this class was generated from the following file: