Joel Andersson
Joel Andersson
I committed an attempt that appears to work. I just added the type conversion on the MATLAB side. Not really a pretty solution, but I guess OK for now.
Actually, I forgot something very important. The subsref/subsasgn functions are necessary when you have member variables. Because they redirect a call like: ``` matlab a = MyWrappedClass(...) a.foo = 4;...
Yeah, the correct way is definitely to use typemaps. Wasn't sure how to do it though. Now that it at least works I think I'd prefer to focus on other...
Didn't know about those... Since there is no corresponding property in the Matlab proxy, I'm not sure if it will work. Let me test...
I'm reopening this. The current design is not safe, cf. https://github.com/casadi/casadi/issues/1463. The correct solution to this would be to use typemaps as @wsfulton suggested above. That does not cover all...
Nope, not possible: ``` >> a = testgetset() Error using testgetset Error: File: /Users/jaeandersson/tmp/testgetset.m Line: 1 Column: 10 Cannot specify a set function for property 'myprop' in class 'testgetset', because...
I think the prettiest solution is adding a feature that, when wrapping a global function, places the proxy function not globally, but as member function in all of the classes...
Yes, I don't like the idea of dummy properties. In addition to the memory overhead issues, it would also cause problems if you want to do multiple inheritance of two...
Actually, the dummy properties can be left untouched at all times. Have a look at this: ``` matlab classdef testgetset < handle properties myprop end properties (Access=private, Hidden=true) myprop_internal end...
So a possibility would be to refactor the handling of member variables and member constants. We could also make the `swigPtr` hidden and remove `disp` since the default printing routine...