Skip to content

Commit 4aa7ad0

Browse files
committed
fable: Add get_factory_keys() to Factory schema
This allows users to write better error messages.
1 parent 60e4559 commit 4aa7ad0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

fable/include/fable/schema/factory.hpp

+11
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,17 @@ class FactoryBase : public Base<CRTP> {
223223
return available_.at(key);
224224
}
225225

226+
/**
227+
* Return the set of added factory keys.
228+
*/
229+
[[nodiscard]] std::vector<std::string> get_factory_keys() const {
230+
std::vector<std::string> keys;
231+
for (const auto& [key, value] : available_) {
232+
keys.emplace_back(key);
233+
}
234+
return keys;
235+
}
236+
226237
/**
227238
* Return whether a factory with the given key is available.
228239
*/

0 commit comments

Comments
 (0)