-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting/getting global variables in Plugins #19
Open
taminob
wants to merge
14
commits into
main
Choose a base branch
from
feature/set-global-in-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since this plugin is supposed to do nothing, the global function will simply return a default constructed value for the getter and do nothing for the setter.
This will return the second template parameter of a template class. It will be used for retrieving the error of Expected when it is not clear that the class actually has enough template parameters. A default value can be passed in case the class does not have sufficient template parameters.
Although the class is called CallError, it is also used for errors when setting/getting variables. Thus, the new error class incorrectType can help narrowing down the actual issue when passing the wrong type for a variable. This can only be detected in the scripting languages.
This alternative is called RemoveCvrefT.
Previously, this was performed in PythonTuple. However, this is less flexible since an unnecessary PythonTuple needs to be constructed that way which is why it was moved to PythonObject.
Previously, the returned string was interpreted as a null-terminated C-string. However, a Python bytes object may contain null bytes in the string which is why the separately stored string length must be used to construct the correct string.
This feature will probably not be implemented and thus the placeholder does no longer make sense.
1c3aa07
to
703f04b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C
Related to C plugin
C++
Related to C++ plugin
enhancement
New feature or request
Lua
Related to Lua plugin
python
Related to python plugin
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add two functions for setting/getting global variables to each plugin type:
global<T>(variable_name)
for getting global variablesglobal(variable_name, value)
for setting global variables