|
ASPECT
|

Public Member Functions | |
| ~ManagerBase () override | |
| void | update () override |
| template<typename PluginType , typename = typename std::enable_if_t<std::is_base_of<InterfaceType,PluginType>::value>> | |
| bool | has_matching_active_plugin () const |
| template<typename PluginType , typename = typename std::enable_if_t<std::is_base_of<InterfaceType,PluginType>::value>> | |
| const PluginType & | get_matching_active_plugin () const |
| const std::list< std::unique_ptr< InterfaceType > > & | get_active_plugins () const |
| const std::vector< std::string > & | get_active_plugin_names () const |
| template<class Archive > | |
| void | save (Archive &ar, const unsigned int version) const |
| template<class Archive > | |
| void | load (Archive &ar, const unsigned int version) |
| virtual void | save (std::map< std::string, std::string > &status_strings) const |
| virtual void | load (const std::map< std::string, std::string > &status_strings) |
Public Member Functions inherited from aspect::Plugins::InterfaceBase | |
| virtual | ~InterfaceBase ()=default |
| virtual void | initialize () |
| virtual void | parse_parameters (ParameterHandler &prm) |
| virtual void | save (std::map< std::string, std::string > &status_strings) const |
| virtual void | load (const std::map< std::string, std::string > &status_strings) |
Protected Attributes | |
| std::list< std::unique_ptr< InterfaceType > > | plugin_objects |
| std::vector< std::string > | plugin_names |
Additional Inherited Members | |
Static Public Member Functions inherited from aspect::Plugins::InterfaceBase | |
| static void | declare_parameters (ParameterHandler &prm) |
A base class for "plugin manager" classes. Plugin manager classes are used in places where one can legitimately use more than one plugin of a certain kind. For example, while there can only ever be one geometry (and consequently, the Simulator class only stores a single object of type derived from GeometryModels::Interface), one can have many different postprocessor objects at the same time. In these circumstances, the Simulator class stores a Postprocess::Manager object that internally stores zero or more objects of type derived from Postprocess::Interface. Since there are many places inside ASPECT where we need these "plugin manager" classes, the current class provides some common functionality to all of these classes.
The class takes as template argument the type of the derived class's interface type. Since a manager is always also a plugin (to the Simulator class) itself, the current class is derived from the InterfaceBase class as well.
|
override |
Destructor.
Definition at line 364 of file plugins.h.
References Assert, StandardExceptions::ExcInternalError(), aspect::Plugins::ManagerBase< InterfaceType >::plugin_names, and aspect::Plugins::ManagerBase< InterfaceType >::plugin_objects.
|
overridevirtual |
A function that is called at the beginning of each time step, calling the update function of the individual plugins.
Reimplemented from aspect::Plugins::InterfaceBase.
Definition at line 380 of file plugins.h.
References aspect::Plugins::ManagerBase< InterfaceType >::plugin_objects.
|
inline |
Go through the list of all plugins that have been selected in the input file (and are consequently currently active) and return true if one of them has the desired type specified by the template argument.
This function can only be called if the given template type (the first template argument) is a class derived from the Interface class in this namespace.
Definition at line 474 of file plugins.h.
References aspect::Plugins::ManagerBase< InterfaceType >::plugin_objects.
|
inline |
Go through the list of all plugins that have been selected in the input file (and are consequently currently active) and see if one of them has the type specified by the template argument or can be cast to that type. If so, return a reference to it. If no postprocessor is active that matches the given type, throw an exception.
The returned object is necessarily an element in the list returned by get_active_plugins(), but cast to a derived type.
This function can only be called if the given template type (the first template argument) is a class derived from the Interface class in this namespace.
Definition at line 487 of file plugins.h.
References AssertThrow, StandardExceptions::ExcMessage(), and aspect::Plugins::ManagerBase< InterfaceType >::plugin_objects.
| const std::list< std::unique_ptr< InterfaceType > > & aspect::Plugins::ManagerBase< InterfaceType >::get_active_plugins |
Return a list of plugin objects that have been requested in the parameter file and that are, consequently, active in the current manager object.
Definition at line 508 of file plugins.h.
References aspect::Plugins::ManagerBase< InterfaceType >::plugin_objects.
| const std::vector< std::string > & aspect::Plugins::ManagerBase< InterfaceType >::get_active_plugin_names |
Return a list of names used in the input file to select plugins, and that are, consequently, active in the current manager object. The names in the returned list correspond to the objects returned by get_active_plugins().
Definition at line 517 of file plugins.h.
References aspect::Plugins::ManagerBase< InterfaceType >::plugin_names.
| void aspect::Plugins::ManagerBase< InterfaceType >::save | ( | Archive & | ar, |
| const unsigned int | version | ||
| ) | const |
Write the data of this object to a stream for the purpose of serialization.
Definition at line 439 of file plugins.h.
References aspect::Plugins::ManagerBase< InterfaceType >::plugin_objects.
| void aspect::Plugins::ManagerBase< InterfaceType >::load | ( | Archive & | ar, |
| const unsigned int | version | ||
| ) |
Read the data of this object from a stream for the purpose of serialization.
Definition at line 454 of file plugins.h.
References aspect::Plugins::ManagerBase< InterfaceType >::plugin_objects.
| virtual void aspect::Plugins::InterfaceBase::save |
Manager classes are also plugins. The InterfaceBase class that is common to all plugins has another save() function that would be hidden by the one above. Make sure that both remain visible.
| virtual void aspect::Plugins::InterfaceBase::load |
Manager classes are also plugins. The InterfaceBase class that is common to all plugins has another load() function that would be hidden by the one above. Make sure that both remain visible.
|
protected |
A list of plugin objects that have been requested in the parameter file.
Definition at line 352 of file plugins.h.
Referenced by aspect::Plugins::ManagerBase< InterfaceType >::get_active_plugins(), aspect::Plugins::ManagerBase< InterfaceType >::get_matching_active_plugin(), aspect::Plugins::ManagerBase< InterfaceType >::has_matching_active_plugin(), aspect::Plugins::ManagerBase< InterfaceType >::load(), aspect::Plugins::ManagerBase< InterfaceType >::save(), aspect::Plugins::ManagerBase< InterfaceType >::update(), and aspect::Plugins::ManagerBase< InterfaceType >::~ManagerBase().
|
protected |
A list of names used in the input file to identify plugins, corresponding to the plugin objects stored in the previous variable.
Definition at line 358 of file plugins.h.
Referenced by aspect::Plugins::ManagerBase< InterfaceType >::get_active_plugin_names(), and aspect::Plugins::ManagerBase< InterfaceType >::~ManagerBase().