Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.
|
|
Math Forum
»
Discussions
»
Software
»
comp.soft-sys.matlab
Notice: We are no longer accepting new posts, but the forums will continue to be readable.
Topic:
Making C++ objects persistent between mex calls, and robust.
Replies:
38
Last Post:
Aug 5, 2017 8:06 PM
|
 |
|
|
Re: Making C++ objects persistent between mex calls, and robust.
Posted:
Feb 3, 2011 11:53 AM
|
|
"Pierre" wrote: > First, except for the initializing method, one does not necessarily have to write the proxy method WrapperClass/<action> in order to invoke the <action>_mex functions: only declare the <action> method in the class definition and place the mex files in the @WrapperClass directory immediately... you have to implement mexFunction() anyhow, which is another proxy function already and which can take over the part of fetching the C++ object pointer from the Matlab object with mxGetProperty(). I admit, this concerns exclusively code aesthetics but it might slightly improve code maintainability and oversight.
Another point, which works in favour of the WrapperClass/<action> approach, is that with that approach you can get away with just one mex function. You can then call it with a parameter, e.g. a string, to denote which class function you want to call. That's the way I'm currently doing things, but it is entirely aesthetic, you're right.
Oliver
|
|
|
|