Skip to content

Commit

Permalink
doc: Update docstrings for plugins' base classes
Browse files Browse the repository at this point in the history
And some final docs fixups.
  • Loading branch information
jan-kolarik authored and j-mracek committed Jan 2, 2024
1 parent 2508120 commit 5a8dbd7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
5 changes: 1 addition & 4 deletions dnf5/include/dnf5/iplugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct PluginVersion {
std::uint16_t micro;
};

/// @brief A base class for implementing DNF5 plugins that provide one or more commands to users.
class IPlugin {
public:
IPlugin(Context & context) : context(&context) {}
Expand Down Expand Up @@ -65,10 +66,6 @@ class IPlugin {

virtual std::vector<std::unique_ptr<Command>> create_commands() = 0;

/// It is called when a hook is reached. The argument describes what happened.
// TODO(jrohel): Design an API for a different plugin type than command. For example, to modify or log output.
//virtual bool hook(HookId hook_id) = 0;

/// Finish the plugin and release all resources obtained by the init method and in hooks.
virtual void finish() noexcept = 0;

Expand Down
11 changes: 0 additions & 11 deletions dnf5/plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,6 @@ bool Plugins::init() {
return true;
}

/*bool Plugins::hook(HookId id) {
for (auto & plugin : plugins) {
if (plugin->get_enabled()) {
if (!plugin->hook(id)) {
return false;
}
}
}
return true;
}*/

void Plugins::finish() noexcept {
for (auto plugin = plugins.rbegin(), stop = plugins.rend(); plugin != stop; ++plugin) {
if ((*plugin)->get_enabled()) {
Expand Down
6 changes: 3 additions & 3 deletions doc/libdnf5_plugins/actions.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

.. _actions_plugin_ref-label:

======================
libdnf5 Actions Plugin
======================
==============
Actions Plugin
==============

Description
===========
Expand Down
1 change: 1 addition & 0 deletions include/libdnf5/plugin/iplugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct Version {
std::uint16_t micro;
};

/// @brief A base class for implementing LIBDNF5 plugins that introduce additional logic into the library using hooks.
class IPlugin {
public:
IPlugin(Base & base) : base(&base) {}
Expand Down

0 comments on commit 5a8dbd7

Please sign in to comment.