![]() |
OpenPFC
0.1.4
Phase Field Crystal simulation framework
|
A registry for field modifiers used in the application. More...
#include <field_modifier_registry.hpp>
Public Types | |
| using | CreatorFunction = std::function< FieldModifier_p(const json &)> |
Public Member Functions | |
| void | register_modifier (const std::string &type, CreatorFunction creator) |
| Register a field modifier with its creator function. | |
| FieldModifier_p | create_modifier (const std::string &type, const json &data) |
| Create an instance of a field modifier based on its registered type. | |
Static Public Member Functions | |
| static FieldModifierRegistry & | get_instance () |
| Get the singleton instance of the FieldModifierRegistry. | |
A registry for field modifiers used in the application.
The FieldModifierRegistry class provides a centralized registry for field modifiers. It allows registration of field modifiers along with their corresponding creator functions, and provides a way to create instances of field modifiers based on their registered types.
|
inline |
Create an instance of a field modifier based on its registered type.
| type | The type string of the field modifier to create. |
| data | A json object defining the field modifier parameters. |
| std::invalid_argument | if the specified type is not registered. |

|
inlinestatic |
Get the singleton instance of the FieldModifierRegistry.

|
inline |
Register a field modifier with its creator function.
| type | The type string associated with the field modifier. |
| creator | The creator function that creates an instance of the field modifier. |