Skip to content

Commit 1c3aa07

Browse files
committed
GenericPlugin: Add global() function
1 parent 7c7cac6 commit 1c3aa07

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

include/ppplugin/plugin.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ class GenericPlugin {
5757
template <typename ReturnValue, typename... Args>
5858
[[nodiscard]] CallResult<ReturnValue> call(const std::string& function_name, Args&&... args);
5959

60+
template <typename VariableType>
61+
CallResult<VariableType> global(const std::string& variable_name)
62+
{
63+
return plugin_.global(variable_name);
64+
}
65+
template <typename VariableType>
66+
void global(const std::string& variable_name, VariableType&& new_value)
67+
{
68+
plugin_.global(variable_name, std::forward<VariableType>(new_value));
69+
}
70+
6071
template <typename P>
6172
std::optional<std::reference_wrapper<P>> plugin();
6273

0 commit comments

Comments
 (0)