Skip to content

Commit

Permalink
Merge pull request boutproject#2046 from boutproject/factory-docstring
Browse files Browse the repository at this point in the history
Improve generic factory docstring example
  • Loading branch information
bendudson authored May 30, 2020
2 parents c5d712a + f9f6e2f commit 51151e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/bout/generic_factory.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
/// };
///
/// class MyFactory : public Factory<Base, MyFactory> {
/// public:
/// static constexpr auto type_name = "Base";
/// static constexpr auto section_name = "base";
/// static constexpr auto option_name = "type";
Expand All @@ -45,6 +46,14 @@
/// RegisterInFactory<Base, Derived, MyFactory> register("derived_type");
/// auto foo = MyFactory::getInstance().create("derived_type");
///
/// In a .cxx file the static members should be declared:
///
/// constexpr decltype(MyFactory::type_name) MyFactory::type_name;
/// constexpr decltype(MyFactory::section_name) MyFactory::section_name;
/// constexpr decltype(MyFactory::option_name) MyFactory::option_name;
/// constexpr decltype(MyFactory::default_type) MyFactory::default_type;
///
///
/// @tparam BaseType The base class that this factory creates
/// @tparam DerivedFactory The derived factory inheriting from this class
/// @tparam TypeCreator The function signature for creating a new BaseType
Expand Down

0 comments on commit 51151e5

Please sign in to comment.