Spicy
Public Member Functions | List of all members
hilti::PluginRegistry Class Reference

#include <plugin.h>

Public Member Functions

const std::vector< Plugin > & plugins () const
 
Result< std::reference_wrapper< const Plugin > > pluginForExtension (hilti::rt::filesystem::path ext) const
 
const PluginhiltiPlugin () const
 
template<typename PluginMember >
bool hasHookFor (PluginMember hook)
 
bool supportsExtension (hilti::rt::filesystem::path ext) const
 
auto supportedExtensions () const
 
void register_ (const Plugin &p)
 

Detailed Description

Maintains the set of all available plugins. registry() returns the global singleton registry instance.

Member Function Documentation

◆ hasHookFor()

template<typename PluginMember >
bool hilti::PluginRegistry::hasHookFor ( PluginMember  hook)
inline

Checks if at least one plugin implements a given hook.

Template Parameters
PluginMemberthe hook
Returns
true if there's an implementation for the hook

◆ hiltiPlugin()

const Plugin & PluginRegistry::hiltiPlugin ( ) const

Shortcut to return the HILTI plugin. This must have been registered already when called.

◆ pluginForExtension()

Result< std::reference_wrapper< const Plugin > > PluginRegistry::pluginForExtension ( hilti::rt::filesystem::path  ext) const

Returns the plugin handling a module with a given file extension, if available.

Parameters
extextension, including the leading .
Returns
plugin if any has been register for the extension

◆ plugins()

const std::vector<Plugin>& hilti::PluginRegistry::plugins ( ) const
inline

Returns a vector of all currently registered plugins, sorted by their order numbers.

◆ register_()

void PluginRegistry::register_ ( const Plugin p)

Registers a plugin with the registry.

Note
This method should normally not be called directly, use plugin::Register() instead.
Parameters
pplugin to register

◆ supportedExtensions()

auto hilti::PluginRegistry::supportedExtensions ( ) const
inline

Returns a vector of all extensions that registered set of plugins handles.

◆ supportsExtension()

bool hilti::PluginRegistry::supportsExtension ( hilti::rt::filesystem::path  ext) const
inline

Checks if there a plugin registered for a specific file extension.

Parameters
extextension, including the leading .
Returns
true if there's a plugin for this extension

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