fourdst_plugin 0.0.1a
C++ Plugin Manager
|
Template base class for functor-style plugins. More...
#include <functor.h>
Public Member Functions | |
virtual T | operator() (const T &input) const =0 |
Function call operator for processing input data. | |
![]() | |
IPluginBase (const char *plugin_name, const char *plugin_version) | |
![]() | |
IPluginBase (const char *plugin_name, const char *plugin_version) | |
const char * | get_name () const override |
Get the plugin name from the global variable. | |
const char * | get_version () const override |
Get the plugin version from the global variable. | |
![]() | |
virtual | ~IPlugin ()=default |
Virtual destructor to ensure proper cleanup of derived classes. | |
Template base class for functor-style plugins.
This template provides a convenient base class for plugins that implement functor-like behavior - they take an input of type T and return an output of the same type T. This is particularly useful for data processing, filtering, or transformation plugins.
The template inherits from PluginBase to automatically provide plugin identification functionality while adding the functor interface.
T | The type of data that this functor plugin processes. Must be copyable and should typically be movable for performance. |
Example usage:
|
pure virtual |
Function call operator for processing input data.
This pure virtual method must be implemented by derived classes to define the specific transformation or processing logic. The method takes input data and returns processed output of the same type.
input | The input data to process, passed by const reference to avoid unnecessary copying |
Implementation-dependent. | Derived classes should document any exceptions they may throw during processing. |