AI 24/25 Project Software
Documentation for the AI 24/25 course programming project software
Loading...
Searching...
No Matches
registry.h
1#ifndef PLUGINS_REGISTRY_H
2#define PLUGINS_REGISTRY_H
3
4#include "registry_types.h"
5
6#include <string>
7#include <typeindex>
8#include <unordered_set>
9
10namespace downward::cli::plugins {
11class Feature;
12class Registry {
13 /*
14 List of FeatureType* for types of all features in use.
15
16 The FeatureType objects contains the documentation of those types and is
17 used to generate the complete help output.
18 */
19 FeatureTypes feature_types;
20
21 /*
22 Maps subcategory keys to the SubcategoryPlugin with that key.
23
24 A subcategory is a set of plugins of the same type that are grouped
25 together in the user documentation. For example, all PDB heuristics
26 are grouped together on the page documenting heuristics.
27 */
28 SubcategoryPlugins subcategory_plugins;
29
30 /*
31 Maps keys (e.g. 'astar') to features with that key.
32
33 A Feature objects contains its documentation, arguments, and
34 has the ability to construct the objects of that type.
35 */
36 Features features;
37
38public:
39 Registry(
40 FeatureTypes&& feature_types,
41 SubcategoryPlugins&& subcategory_plugins,
42 Features&& features);
43
44 bool has_feature(const std::string& name) const;
45 std::shared_ptr<const Feature> get_feature(const std::string& name) const;
46 const SubcategoryPlugin&
47 get_subcategory_plugin(const std::string& subcategory) const;
48
49 const FeatureTypes& get_feature_types() const;
50 std::vector<const SubcategoryPlugin*> get_subcategory_plugins() const;
51 std::vector<std::shared_ptr<const Feature>> get_features() const;
52};
53} // namespace downward::cli::plugins
54
55#endif