2 #include "../../Defs.hpp"
9 if( !StreamResourceProvider::Markers )
12 delete StreamResourceProvider::Markers;
13 StreamResourceProvider::Markers =
nullptr;
17 cm( inst, this,
"StreamResource",
ClientMarker::Status() ),
28 auto row = view->
Table( DebugTable ).
Row(
this );
29 row.
Column(
"path", this->path );
47 std::unordered_multimap< std::type_index, std::unique_ptr< StreamResourceProvider::Marker > > * StreamResourceProvider::Markers;
51 cm( inst, this,
"StreamResourceProvider" )
56 bool StreamResourceProvider::has_path(
ResourcePath const & path, std::type_index type )
61 auto const & [ begin, end ] = Markers->equal_range( type );
62 for(
auto it = begin; it != end; ++it )
64 auto & marker = it->second;
65 if( marker->HasResource(
this, path ) )
72 void StreamResourceProvider::each_resource( std::type_index type, std::function<
void( ResourcePath
const & ) >
const & f )
77 auto const & [ begin, end ] = Markers->equal_range( type );
78 for(
auto it = begin; it != end; ++it )
80 auto & marker = it->second;
81 marker->EachResource(
this, f );
85 void StreamResourceProvider::each_type( std::function<
void( std::type_index type ) >
const & f )
90 for(
auto it = Markers->begin(); it != Markers->end(); ++it )
91 f( it->second->GetType() );
94 std::pair< void *, Instance * > StreamResourceProvider::create_resource( ResourcePath
const & path, std::type_index type, ResourcesRoot * parent )
97 return std::pair< void *, Instance * >(
nullptr,
nullptr );
99 auto const & [ begin, end ] = Markers->equal_range( type );
100 for(
auto it = begin; it != end; ++it )
102 auto & marker = it->second;
103 if( marker->HasResource(
this, path ) )
104 return marker->MakeResource(
this, parent, path );
107 return std::pair< void *, Instance * >(
nullptr,
nullptr );