Skip to content
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

max_jit_class_wrap_addmethods() -or- exposing jitter methods to max wrapper (late stage) #44

Open
diablodale opened this issue Jun 21, 2020 · 2 comments

Comments

@diablodale
Copy link
Contributor

What is the behavior of max_jit_class_wrap_addmethods()?
Can I call it multiple times with no harm?

My need is to add methods to a jitter object that is exposed to Max via a max wrapper object. And these methods are to be added after the call to max_jit_class_wrap_standard()

Trial/error/reading header files I found max_jit_class_wrap_addmethods() and it seems to do what I want. Though I am unclear as to its full behavior and if there are negative sideaffects if called multiple times; once after each time I add a method to the jitter class.

Is there a API to cause the max wrapper to see this single new jitter method without (re)parsing all methods in bulk as I'm guessing max_jit_class_wrap_addmethods() does?

After this example is clarified, would be good to add documentation for this function and the others in related doc issues #20

@robtherich
Copy link
Contributor

hey Dale, this function simply iterates the messages and attributes stored in the jitter class, and adds Jitter wrapper functions for each of them (e.g. defer and usurp specific handlers).

there should be no issue calling this multiple times, each subsequent call should simply overwrite any previous calls. I believe all your assumptions are correct and this is the way to add a method post max_jit_class_wrap_standard() call.

@diablodale
Copy link
Contributor Author

thx for clarification.

For other readers...due to inter-dependent complexities and some features not exposed via customer APIs of very low-level Max behavior I need, I chose to stop using the max_jit_class_wrap_addmethods() API.

Instead, I use the more typical and well-tested pattern of...

class_new()
max_jit_class_obex_setup()
max_jit_class_mop_wrap()
// custom methods here with max_jit_class_addmethod_xxxx(), jit_class_addmethod(), class_addmethod(), etc.
max_jit_class_wrap_standard()
class_register()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants