HAL
hal::BasePluginInterface Class Referenceabstract

#include <plugin_interface_base.h>

Inheritance diagram for hal::BasePluginInterface:
Inheritance graph
Collaboration diagram for hal::BasePluginInterface:
Collaboration graph

Public Member Functions

 BasePluginInterface ()=default
 
virtual ~BasePluginInterface ()
 
virtual void initialize ()
 
virtual std::string get_name () const =0
 
virtual std::string get_version () const =0
 
virtual std::string get_description () const
 
virtual std::set< std::string > get_dependencies () const
 
template<typename... Args>
void log (const Args &... args) const
 
virtual void on_load ()
 
virtual void on_unload ()
 
virtual void initialize_logging ()
 
virtual std::vector< AbstractExtensionInterface * > get_extensions () const
 
template<typename T >
T * get_first_extension () const
 
void delete_extension (AbstractExtensionInterface *aeif)
 

Protected Attributes

std::vector< AbstractExtensionInterface * > m_extensions
 

Detailed Description

Definition at line 56 of file plugin_interface_base.h.

Constructor & Destructor Documentation

◆ BasePluginInterface()

hal::BasePluginInterface::BasePluginInterface ( )
default

◆ ~BasePluginInterface()

hal::BasePluginInterface::~BasePluginInterface ( )
virtual

Definition at line 9 of file plugin_interface_base.cpp.

References m_extensions.

Member Function Documentation

◆ delete_extension()

void hal::BasePluginInterface::delete_extension ( AbstractExtensionInterface aeif)

Delete extension instance and free memory

Parameters
aeifThe extenstion instance to be deleted. Nothing will be done if not found in list.

Definition at line 42 of file plugin_interface_base.cpp.

References m_extensions.

Referenced by hal::HGLParserPlugin::on_unload(), hal::HGLWriterPlugin::on_unload(), hal::LibertyParserPlugin::on_unload(), hal::VerilogParserPlugin::on_unload(), hal::VerilogWriterPlugin::on_unload(), and hal::VHDLParserPlugin::on_unload().

◆ get_dependencies()

std::set< std::string > hal::BasePluginInterface::get_dependencies ( ) const
virtual

Get all dependencies of this plugin.

Returns
The plugins that this plugin depends on.

Reimplemented in hal::PyBasePluginInterface, hal::GraphAlgorithmPlugin, hal::DataflowPlugin, and hal::BooleanInfluencePlugin.

Definition at line 24 of file plugin_interface_base.cpp.

Referenced by hal::plugin_interfaces_init(), and hal::GuiPluginEntry::updateFromLoaded().

◆ get_description()

std::string hal::BasePluginInterface::get_description ( ) const
virtual

Get the description of the plugin.

Returns
The description of the plugin.

Reimplemented in hal::PyBasePluginInterface, hal::SolveFsmPlugin, hal::GraphAlgorithmPlugin, hal::DataflowPlugin, and hal::BooleanInfluencePlugin.

Definition at line 19 of file plugin_interface_base.cpp.

Referenced by hal::plugin_interfaces_init(), and hal::GuiPluginEntry::updateFromLoaded().

◆ get_extensions()

std::vector< AbstractExtensionInterface * > hal::BasePluginInterface::get_extensions ( ) const
virtual

Get GUI/CLI/FAC extension functionality if implemented by derived class

Returns
pointer to instance implementing extensions

Definition at line 37 of file plugin_interface_base.cpp.

References m_extensions.

Referenced by hal::GuiPluginManager::getGuiExtensions(), and hal::GuiPluginEntry::updateFromLoaded().

◆ get_first_extension()

template<typename T >
T* hal::BasePluginInterface::get_first_extension ( ) const
inline

Get first extension of given type T.

Returns
pointer to first extension of type T or nullptr if no such extension exists.

Definition at line 138 of file plugin_interface_base.h.

References hal::T.

Referenced by hal::plugin_manager::get_first_extension().

◆ get_name()

◆ get_version()

◆ initialize()

void hal::BasePluginInterface::initialize ( )
virtual

Plugins utilize two phase construction. Always populate all members etc in the initialize function which is automatically called by plugin_manager::get_plugin_instance()

Definition at line 15 of file plugin_interface_base.cpp.

◆ initialize_logging()

void hal::BasePluginInterface::initialize_logging ( )
virtual

Initializes the logging channel(s) of a plugin.
If not overwritten, a logging channel equal to the plugin name is created.

Definition at line 57 of file plugin_interface_base.cpp.

References hal::LogManager::add_channel(), hal::LogManager::create_file_sink(), hal::LogManager::create_gui_sink(), hal::LogManager::create_stdout_sink(), hal::LogManager::get_instance(), and get_name().

◆ log()

template<typename... Args>
void hal::BasePluginInterface::log ( const Args &...  args) const
inline

Shorthand for fast text logging.

Parameters
[in]args- The format string, followed by values.

Definition at line 106 of file plugin_interface_base.h.

References control::args, and log_info.

◆ on_load()

void hal::BasePluginInterface::on_load ( )
virtual

This function is automatically executed when the factory is loaded by the plugin manager

Reimplemented in hal::VHDLParserPlugin, hal::VerilogWriterPlugin, hal::VerilogParserPlugin, hal::LibertyParserPlugin, hal::HGLWriterPlugin, and hal::HGLParserPlugin.

Definition at line 29 of file plugin_interface_base.cpp.

◆ on_unload()

void hal::BasePluginInterface::on_unload ( )
virtual

This function is automatically executed when the factory is unloaded by the plugin manager

Reimplemented in hal::VHDLParserPlugin, hal::VerilogWriterPlugin, hal::VerilogParserPlugin, hal::LibertyParserPlugin, hal::HGLWriterPlugin, and hal::HGLParserPlugin.

Definition at line 33 of file plugin_interface_base.cpp.

Member Data Documentation

◆ m_extensions


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