Graphics properties implementation
Shai Ayal
shaiay at gmail.com
Thu Jan 17 22:47:29 CST 2008
On Jan 17, 2008 11:13 PM, Michael Goffioul <michael.goffioul at gmail.com> wrote:
> On 1/17/08, Shai Ayal <shaiay at gmail.com> 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.
>
More information about the Octave-maintainers
mailing list