help-octave
[Top][All Lists]
Advanced

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

RE: user data types


From: Billings, Paul
Subject: RE: user data types
Date: Wed, 10 Aug 2005 10:25:02 -1000

Stefan,

Thank you very much for your thoughts.  I had envisioned a linear hierarchy,
however you described a design using aggregation.  Is this required due to
the way octave interfaces or simply a design preference?  A class hierarchy
(left to right):

My thinking:
octave_base_value <- Data3d <- SequenceData
                            <- Custom1Data
                            ...

My understanding of your thinking:
octave_base_value <- OctaveData3d (has a Data3d* member)
Data3d <- SequenceData
       <- Custom1Data
       ...

Is 1) my understanding of your suggestion correct, and 2) do you see
advantages to either approach?  Your design would allow switching of data
types, while I would have to declare another instance.  Am I missing
something important?

Paul


> -----Original Message-----
> From: Stefan van der Walt [mailto:address@hidden
> Sent: Tuesday, August 09, 2005 11:32 PM
> To: Paul Billings
> Subject: Re: user data types
>
>
> Hi Paul
>
> Another simple example is at
>
> http://www.srcf.ucam.org/~mjm80/mdp/web/octave.html
>
> (the result of the thread you refer to below).
>
> What you want to do sounds reasonable easy to implement (although more
> complex than the example above, since you want to involve multiple
> formats).
>
> Still, don't think it should be a problem.  Create an Octave class,
> say OctaveFormat that is a wrapper around a base class "Format".
> OctaveFormat contains a pointer to an instance of Format (which could
> be SequenceFormat or CustomOneFormat or whatever).  Octave interacts
> with OctaveFormat, which in return interacts with the contained format
> class.
>
> Or something along those lines...
>
> Regards
> Stéfan
>
> On Tue, Aug 09, 2005 at 12:50:50PM -1000, Paul Billings wrote:
> > It still appears that I am on the right track.  Further
> research has turned
> > up a similar thread:
> >
http://www.octave.org/octave-lists/archive/help-octave.2005/msg02767.html
>
> My desire for a simple example is at:
>   http://wiki.octave.org/wiki.pl?CodaTypes
>
> I know I need to define the subsref function (matlab), but I'm sure
there's
> something similar for octave.
>
> Is there anything tricky to having a hierarchy of these types?  I want a
> base class with most of the functionality (e.g., subsref(), size(), etc.).
> Subsref() would call a virtual function load_data() to get the specific
> data.  This virtual function would be defined in various subclasses (each
> derived from the base class), where each subclass is specific to a
> particular format (e.g., sequence of image files, custom format #1, custom
> format #2, etc.)
>
> Paul



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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