Sierra Toolkit
Version of the Day
|
#include <UserPlugin.hpp>
Classes | |
class | Register |
Class template Register registers the user function function pointer with the function_name on object creation. More... | |
Public Types | |
typedef S | Signature |
Subroutine call signature. | |
Static Public Member Functions | |
static UserSubroutine & | instance () |
Member function instance returns the instance of the registry, cast as a UserSubroutine registry.. More... | |
static void | registerFunction (const std::string &function_name, Signature *function) |
Member function registerFunction registers the user function's name with the specified user function function pointer. More... | |
static Signature * | execute (const std::string &function_name) |
Member function execute returns the user function function associated with the specified signature and derived_name. More... | |
static Signature * | getFunction (const std::string &function_name) |
Member function execute returns the user function function pointer associated with the specified signature and derived_name. More... | |
static bool | exists (const std::string &derived_name) |
Member function exists returns true if user function specified by derived_name exists. More... | |
Class template UserSubroutine is a template used for the association of user function to be registered and acquired via the UserSubroutine mechanism. The template traits enforces the signature matching of the user function and the its usage.
The registration requires a unique function name and is required to implement a traits class with a Signature typedef which specifies the signature of the user function and a static function named getUserSubroutineName() which returns a const std::string reference to the user function's name. This name must be unique across users of the registry. There is no way to enforce this programatically, so it is recommended that a application prefix be attached to the function name.
Definition at line 520 of file UserPlugin.hpp.
|
inlinestatic |
Member function instance returns the instance of the registry, cast as a UserSubroutine registry..
Definition at line 537 of file UserPlugin.hpp.
|
inlinestatic |
Member function registerFunction registers the user function's name with the specified user function function pointer.
The base class name is determined by the BaseClass template argument's getCreatorName() static member function. The signature is defined UserSubroutineTraits template argument's Signature typedef.
function_name | a std::string const reference to the user function's name. |
function | a Signature function pointer to the user function. |
Definition at line 556 of file UserPlugin.hpp.
|
inlinestatic |
Member function execute returns the user function function associated with the specified signature and derived_name.
function_name | a std::string const reference to the user function's name. |
a | std::invalid_argument exception is thrown if there is no user function registered for the specified name. |
Definition at line 573 of file UserPlugin.hpp.
|
inlinestatic |
Member function execute returns the user function function pointer associated with the specified signature and derived_name.
function_name | a std::string const reference to the user function's name. |
a | std::invalid_argument exception is thrown if there is no user function registered for the specified name. |
Definition at line 592 of file UserPlugin.hpp.
|
inlinestatic |
Member function exists returns true if user function specified by derived_name exists.
function_name | a std::string const reference to the user function's name. |
Definition at line 608 of file UserPlugin.hpp.