[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Wrapper to use a C++ class in Octave
From: |
Carlo De Falco |
Subject: |
Re: Wrapper to use a C++ class in Octave |
Date: |
Sat, 12 Aug 2017 15:23:11 +0000 |
> On 10 Aug 2017, at 19:21, Mike Miller <address@hidden> wrote:
>
> On Wed, Aug 09, 2017 at 23:40:49 +0200, Stefan Oltmanns wrote:
>> The class is designed for non blocking operation and everything is done
>> by a background thread (when result is ready the callback function is
>> called).
>>
>> Is there a simple way to write a wrapper around the class? Is there any
>> example where something like this has been done?
>
> This is certainly doable and has been done before. I can't say if you'll
> call it simple. Take a look at Octave's own audioplayer and
> audiorecorder classes, which have options to call user functions when
> the audio driver needs data or has data ready.
>
>
> https://hg.savannah.gnu.org/hgweb/octave/file/@/libinterp/dldfcn/audiodevinfo.cc
Another example of this in Octave sources could be the implementation of ode15i
as a wrapper to the sundials IDA library:
http://hg.savannah.gnu.org/hgweb/octave/file/c3cfd3115b78/libinterp/dldfcn/__ode15__.cc
The most simple example of storing and calling an Octave function from a C++
program
is in the examples ditributed with Octave sources:
http://hg.savannah.gnu.org/hgweb/octave/file/c3cfd3115b78/examples/code/funcdemo.cc
HTH,
c.