StreamResourceSubprovider.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 #include <unordered_map>
6 
7 namespace iv
8 {
9 
13 {
14 public:
17 
18  Instance * instance() const;
19 
20 protected:
21  void Parse_EachResource( std::istream & metadata_file );
22  void Parse_EachParameter( std::function< void( std::string const & param, std::string const & val ) > const & = nullptr );
23 
24  virtual void Resource( std::string const & resource_class, ResourcePath path ) = 0;
25 
26 private:
27  JsonLex lex;
28 };
29 
33 {
34 public:
36  Plain_StreamResourceSubprovider( Instance * inst, StreamResourceProvider const * provider, char const * metadata_class );
37  void each_resource( std::function< void( ResourcePath const & ) > const & ) const;
38  bool has_resource( ResourcePath const & ) const;
39 
40 protected:
41  virtual void Resource( std::string const & resource_class, ResourcePath path ) override;
42 
43 private:
44  char const * metadata_class;
45  std::unordered_set< ResourcePath > resources;
46 };
47 
48 }