SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Access()

template<typename T >
std::shared_ptr< T > Spices::ResourcePool< T >::Access ( const std::string & path)
inlinestatic

Access a resource by path directly. Do nothing if resource is not found.

Parameters
[in]pathResource file path in disk.
Returns
Returns resource smart pointer.

Definition at line 143 of file ResourcePool.h.

144 {
146
147 assert(Has(path));
148 assert(m_Resources[path]->GetState() == Resource::ResourceStateEnum::Loaded);
149
150 return m_Resources[path]->GetResource<T>();
151 }
#define SPICES_PROFILE_ZONE
static bool Has(const std::string &name)
Determine if specific resource is exist.
static std::unordered_map< std::string, std::unique_ptr< Resource > > m_Resources
Static variable stores all specific resources in a basic type Pool.

References Spices::ResourcePool< T >::Has().