ASPECT
Public Member Functions | Protected Attributes | List of all members
aspect::Plugins::ManagerBase< InterfaceType > Class Template Reference
Inheritance diagram for aspect::Plugins::ManagerBase< InterfaceType >:
Inheritance graph
[legend]

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
 
- Public Member Functions inherited from aspect::Plugins::InterfaceBase
virtual ~InterfaceBase ()=default
 
virtual void initialize ()
 
virtual void parse_parameters (ParameterHandler &prm)
 

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)
 

Detailed Description

template<typename InterfaceType>
class aspect::Plugins::ManagerBase< InterfaceType >

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.

Definition at line 213 of file plugins.h.

Constructor & Destructor Documentation

§ ~ManagerBase()

template<typename InterfaceType >
aspect::Plugins::ManagerBase< InterfaceType >::~ManagerBase ( )
override

Destructor.

Definition at line 295 of file plugins.h.

Member Function Documentation

§ update()

template<typename InterfaceType >
void aspect::Plugins::ManagerBase< InterfaceType >::update ( )
overridevirtual

A function that is called at the beginning of each time step, calling the update function of the individual heating models.

Reimplemented from aspect::Plugins::InterfaceBase.

Definition at line 311 of file plugins.h.

§ has_matching_active_plugin()

template<typename InterfaceType >
template<typename PluginType , typename >
bool aspect::Plugins::ManagerBase< InterfaceType >::has_matching_active_plugin ( ) const
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 371 of file plugins.h.

§ get_matching_active_plugin()

template<typename InterfaceType >
template<typename PluginType , typename >
const PluginType & aspect::Plugins::ManagerBase< InterfaceType >::get_matching_active_plugin ( ) const
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 384 of file plugins.h.

§ get_active_plugins()

template<typename InterfaceType >
const std::list< std::unique_ptr< InterfaceType > > & aspect::Plugins::ManagerBase< InterfaceType >::get_active_plugins ( ) const

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 405 of file plugins.h.

§ get_active_plugin_names()

template<typename InterfaceType >
const std::vector< std::string > & aspect::Plugins::ManagerBase< InterfaceType >::get_active_plugin_names ( ) const

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 414 of file plugins.h.

Member Data Documentation

§ plugin_objects

template<typename InterfaceType>
std::list<std::unique_ptr<InterfaceType> > aspect::Plugins::ManagerBase< InterfaceType >::plugin_objects
protected

A list of plugin objects that have been requested in the parameter file.

Definition at line 283 of file plugins.h.

§ plugin_names

template<typename InterfaceType>
std::vector<std::string> aspect::Plugins::ManagerBase< InterfaceType >::plugin_names
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 289 of file plugins.h.


The documentation for this class was generated from the following file: