octave-maintainers
[Top][All Lists]
Advanced

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

Re: Graphics properties implementation


From: Shai Ayal
Subject: Re: Graphics properties implementation
Date: Fri, 18 Jan 2008 06:47:29 +0200

On Jan 17, 2008 11:13 PM, Michael Goffioul <address@hidden> wrote:
> On 1/17/08, Shai Ayal <address@hidden> wrote:
> > This is similar to the postset checks I suggested. Maybe we should
> > make it more generic and add a preset & postset functions which would
> > be called from set (with the "v" modifier):
> >
> > void set_faces (const octave_value& v)
> > {
> >  if (! error_state)
> >  {
> >     preset ("faces", v);
> >     if (! error_state)
> >     {
> >        faces = v;
> >        postset ("faces");
> >        mark_modified ();
> >     }
> >  }
> > }
> >
> > this allows for further checks of the input before setting the value
> > -- I'm sure it will come in handy sometime ...
>
> I think the "preset" is overkill for the C++ implementation of core
> objects. In the JHandles development, I never had to "preset"
> anything, only "postset". "preset" might be useful for dynamically
> built objects, but in this case listeners will be implemented in
> m-code, and this will be supported.

preset is for checking the validity of the value against other
properties before seting it - the example that comes to mind is
checking for a valid axes handle before setting figure.currentaxes
of course this could be done in the set method, but then again, this
can be said of the validate you suggest as well
Anyway, if the only example is the figure.currentaxes one, maybe it's
not worth the cputime

> The problem I see with trying to making this generic, even for C++
> "listeners" is that it will make things slower, and I'd like to avoid that
> when possible.

I have no problem with slow set, only with slow get

> Michael.
>


reply via email to

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