SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Registry()

template<typename T >
void Spices::ResourcePool< T >::Registry ( const std::string & name,
std::shared_ptr< T > resource )
inlinestatic

Registry a resource to this Pool.

Parameters
[in]nameResource Name.
[in]resourceResource.

Definition at line 178 of file ResourcePool.h.

179 {
181
182 std::unique_lock<std::shared_mutex> lock(m_Mutex);
183
184 if (m_Resources.find(name) != m_Resources.end())
185 {
186 return;
187 }
188
189 m_Resources[name] = std::make_unique<Resource>(resource);
190 }
#define SPICES_PROFILE_ZONE
static std::unordered_map< std::string, std::unique_ptr< Resource > > m_Resources
Static variable stores all specific resources in a basic type Pool.
static std::shared_mutex m_Mutex
Mutex for this pool.