4 template<
class TResource >
8 return this->choose_provider( res_path,
typeid( TResource ) );
11 template<
class TResource >
16 auto equal_range = this->resources.equal_range( res_path );
17 for(
auto it = equal_range.first; it != equal_range.second; ++it )
19 Resource & res = it->second;
20 if( res.type ==
typeid( TResource ) )
21 return reinterpret_cast< TResource *
>( res.client );
28 ResourceProvider * provider = this->choose_provider( res_path,
typeid( TResource ) );
31 this->
warning(
SRC_INFO,
"Path '", res_path,
"' can not be resolved. No registered provider provides this path for type '",
typeid( TResource ).name(),
"'." );
36 std::pair< void *, Instance * > created = provider->
create_resource( res_path,
typeid( TResource ), &this->root );
45 res.type =
typeid( TResource );
46 res.client = created.first;
47 res.inst = created.second;
48 this->resources.insert( std::make_pair( res_path, res ) );
51 TResource * client =
reinterpret_cast< TResource *
>( created.first );
56 template<
class TResource >
59 for(
auto & p_provider : this->providers )
60 p_provider.second->each_resource(
typeid( TResource ), f );