| 76 | out << " - " << p.first << endl; |
| 77 | } |
| 78 | unique_ptr<Plugin> Create(const string& name, Menu* menu) const |
| 79 | { |
| 80 | for (auto& p: plugins) |
| 81 | if (p.first == name) |
| 82 | return p.second(menu); |
| 83 | return {}; |
| 84 | } |
| 85 | private: |
| 86 | static PluginRegistry instance; |
| 87 | vector<pair<string, Factory>> plugins; |