On 25/11/2012 15:29, c. wrote:
> On 25 Nov 2012, at 12:49, Richard wrote:
>
>> I suspect he wants to do something like this:
>>
>> http://www.mathworks.co.uk/matlabcentral/fileexchange/38964-example-matlab-class-wrapper-for-a-c++-class
>> http://www.mathworks.com/matlabcentral/newsreader/view_thread/278243
>>
>> Richard
> There is nothing special to be done to link C++ with Octave,
> Octave itself is written in C++ so classes have no need to be "encapsulated"
> in an oct file you can just use them as in any other C++ program.
>
> c.
>
>

Really? so i can have a C++ class, and call it and its methods from an 
m-file in Octave, and have it persist like a real C++ object from one 
call of its methods to the next?

This is not possible with plain mex files in Matlab because you must 
create an instance of a C++ class which will be destroyed once the mex 
file completes (which is the problem that using handle classes in the 
linked example solves). As I understood it Octave has the same 
limitation, but since it does not yet have classdef, there is no way to 
do the same thing. I'd be very interested hear if there was though, or 
that I have misunderstood something about oct files.

Richard



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to