octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implementation of libpointer


From: Reza Housseini
Subject: Re: Implementation of libpointer
Date: Tue, 24 Sep 2013 16:42:54 +0200

Thanks John

I already made a public repository [1] but it's far from complete and I didn't found time working on that recently. I just thought using the octave_struct base class because of the similar interface which matlab uses with "mypointer.Value" but probably it's also possible to have the same behaviour without the octave_struct base class. There is this lib.pointer class [2] if you mean that when talking about handle class object?


[1] https://bitbucket.org/rezahousseini/octave-shared-lib-utilities
[2] http://www.mathworks.ch/ch/help/matlab/ref/lib.pointerclass.html


On Tue, Sep 24, 2013 at 3:40 PM, John W. Eaton <address@hidden> wrote:
On 09/24/2013 05:57 AM, Reza Housseini wrote:
Hello

I try to implement the libpointer function [1]. It is used for example
in the calllib function [2]. Therefore a new type declaration is needed
and I was wondering where and how to implement them. Is it correct that
it need to be placed in libinterp/octave-value? And should it be some
derived struct class, with fixed size, like:

     class
     octave_pointer : public octave_struct
     {
       ...
     }

Or inherit directly from octave_map?

If you want to create a new value type in Octave, then it ultimately needs to be derived from octave_base_value.  So deriving from octave_struct could work.  It could also be derived directly from octave_base_value and contain an octave_scalar_map object (or can a libpointer object have non-scalar dimensions?)

But since it appears that the libpointer object only ever contains two fields, maybe it should just be a separate kind of object that doesn't use a structure for its implementation.

Is libpointer a handle class object in Matlab?  If so, you'll have some difficulty getting full compatibility

If you are working on calllib and would eventually like for it to be a part of Octave, maybe it would be helpful if you would share your code with us so we could provide some early feedback.

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]