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

Function decleration registration #10

Closed
jaynus opened this Issue Dec 4, 2015 · 2 comments

Comments

Projects
None yet
4 participants
@jaynus
Copy link
Collaborator

jaynus commented Dec 4, 2015

@NouberNou

We talked about the ability to also call the function registration handlers, and inject and register new SQF functions. We need this functionality to properly call back into the C++ realm.

the ability to register

TYPE functionname ARRAY( TYPE, TYPE, TYPE) would be ideal - with return values. This would allow us to begin registering extended SQF functionality.

@jaynus jaynus added the task label Dec 4, 2015

@jaynus jaynus added this to the 1.0 milestone Dec 4, 2015

@Verox- Verox- added the enhancement label Jan 30, 2016

@Verox- Verox- removed this from the 1.0 milestone Feb 12, 2016

@NouberNou NouberNou added Feature Request and removed task labels Mar 16, 2016

@dedmen

This comment has been minimized.

Copy link
Member

dedmen commented Apr 30, 2017

dedmen@fd87553
First draft. Working fine for binary operators with types STRING or ARRAY on profiling build v16 and only if the Module that registered them never unloads. But it's a start.
diag_codePerformance from SQF:
["hello"] interceptEvent ["you"] 0.0033
"intercept" callExtension "test"; 0.0266 ms
Debug build.

["hello"] interceptEvent ["you"] 0.0023 ms
"intercept" callExtension "test"; 0.0043 ms
Release build.

But to get the same outcome via the callExtension method you also have to pass data through variables.. So the callExtension variant to do the same would be something like this

missionNamespace setVariable ["ARG","hello"];
missionNamespace getVariable "ARG";
"intercept" callExtension "test";
missionNamespace setVariable ["RETURN","you"];
missionNamespace getVariable "RETURN";

0.0152 ms (Release Mode)

Which means it's a substancial improvement just for moving the Intercept functions to Native SQF Functions.

@dedmen

This comment has been minimized.

Copy link
Member

dedmen commented May 1, 2017

PR is there now. #123

@dedmen dedmen closed this in #123 May 5, 2017

dedmen added a commit that referenced this issue May 5, 2017

Register SQF Functions (#10) (#123)
Registering SQF Functions - First draft
Made registerSqfFunc available to Plugins
Formatting
Fixed inverted behaviour of game_value::is_null
Pattern find registerSQFFunctions
Register Unary Functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment