|
ASPECT
|
Public Types | |
| using | PluginInfo = std::tuple< std::string, std::string, void(*)(ParameterHandler &), std::unique_ptr< InterfaceClass >(*)()> |
Public Member Functions | |
| ~PluginList () | |
| DeclException1 (ExcUnknownPlugin, std::string,<< "Can't create a plugin of name <"<< arg1<< "> because such a plugin hasn't been declared.") | |
Static Public Member Functions | |
| static void | register_plugin (const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< InterfaceClass >(*factory_function)()) |
| static std::string | get_pattern_of_names () |
| static std::string | get_description_string () |
| static void | declare_parameters (ParameterHandler &prm) |
| static std::unique_ptr< InterfaceClass > | create_plugin (const std::string &name, const std::string &documentation) |
| static std::unique_ptr< InterfaceClass > | create_plugin (const std::string &name, const std::string &documentation, ParameterHandler &prm) |
| static void | write_plugin_graph (const std::string &plugin_system_name, std::ostream &output_stream, const std::string &attachment_point="Simulator") |
Static Public Attributes | |
| static std::list< PluginInfo > * | plugins = nullptr |
A class that stores a list of registered plugins for the given interface type.
| using aspect::internal::Plugins::PluginList< InterfaceClass >::PluginInfo = std::tuple<std::string, std::string, void ( *) (ParameterHandler &), std::unique_ptr<InterfaceClass>( *) ()> |
A type describing everything we need to know about a plugin.
The entries in the tuple are:
| aspect::internal::Plugins::PluginList< InterfaceClass >::~PluginList |
|
static |
Register a plugin by name, description, parameter declaration function, and factory function. See the discussion for the PluginInfo type above for more information on their meaning.
Definition at line 740 of file plugins.h.
References Assert, and StandardExceptions::ExcMessage().
|
static |
Generate a list of names of the registered plugins separated by '|' so that they can be taken as the input for Patterns::Selection.
To make it easier to visually scan through the list of plugins, names are sorted alphabetically.
Definition at line 774 of file plugins.h.
References Assert, and StandardExceptions::ExcMessage().
|
static |
|
static |
Let all registered plugins define their parameters.
Definition at line 849 of file plugins.h.
References Assert, and StandardExceptions::ExcMessage().
|
static |
Given the name of one plugin, create a corresponding object and return a pointer to it. The second argument provides a hint where this function was called from, to be printed in case there is an error.
Ownership of the object is handed over to the caller of this function.
Definition at line 865 of file plugins.h.
References Assert, AssertThrow, and StandardExceptions::ExcMessage().
|
static |
Given the name of one plugin, create a corresponding object and return a pointer to it. The second argument provides a hint where this function was called from, to be printed in case there is an error. Before returning, let the newly created object read its run-time parameters from the parameter object.
Ownership of the object is handed over to the caller of this function.
|
static |
For the current plugin subsystem, write a connection graph of all of the plugins we know about, in the format that the programs dot and neato understand. This allows for a visualization of how all of the plugins that ASPECT knows about are interconnected, and connect to other parts of the ASPECT code.
| plugin_system_name | The name to be used for the current plugin system. This name will be used for the "Interface" class to which all plugins connect. |
| output_stream | The stream to write the output to. |
| attachment_point | The point to which a plugin subsystem feeds information. By default, this is the Simulator class, but some plugin systems (most notably the visualization postprocessors, which feeds to one of the postprocessor classes) hook into other places. If other than the "Simulator" default, the attachment point should be of the form typeid(ClassName).name() as this is the form used by this function to identify nodes in the plugin graph. |
Definition at line 919 of file plugins.h.
References Assert, const_iterator(), and StandardExceptions::ExcInternalError().
| aspect::internal::Plugins::PluginList< InterfaceClass >::DeclException1 | ( | ExcUnknownPlugin | , |
| std::string | |||
| ) |
Exception.
|
inlinestatic |
A pointer to a list of all registered plugins.
The object is a pointer rather than an object for the following reason: objects with static initializers (such as =0) are initialized before any objects for which one needs to run constructors. Consequently, we can be sure that this pointer is set to zero before we ever try to register a plugin, and consequently whenever we run register_plugin(), we need not worry whether we try to add something to this list before the lists's constructor has successfully run.