[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: changing genprop.awk to handle radio_values
From: |
Shai Ayal |
Subject: |
Re: changing genprop.awk to handle radio_values |
Date: |
Fri, 14 Sep 2007 23:31:49 +0300 |
On 9/14/07, John W. Eaton <address@hidden> wrote:
> On 14-Sep-2007, Shai Ayal wrote:
>
> | the attached patch will emmit the following set function if the "a"
> | modifier is used:
> |
> | void set_NAME (const octave_value& val)
> | {
> | TYPE tmpNAME (NAME);
> | tmpNAME = val;
> | set_NAME (tmpNAME);
> | };
> |
> | this will allow the error check in set_NAME (const TYPE& NAME) to be used
> |
> |
> | 2007-09-14 Shai Ayal <address@hidden>
> |
> | * genprop.awk: added the "a" modifier which creates an assignment
> | set_NAME(const octave_value& val) function
>
> I applied this patch with a few minor changes. First, I just used
> "tmp" instead of tmpNAME, and I also added some more info to the
> description in the comments. Is the following a correct and
> reasonable statement?
yes
> ## a: The octave_value version of the set function will use assignment:
> ##
> ## void
> ## set_NAME (const octave_value& val)
> ## {
> ## TYPE tmp (NAME);
> ## tmp = val;
> ## set_NAME (tmp);
> ## }
> ##
> ## This is useful for things like the radio_value classes which
> ## use an overloaded assignment operator of the form
> ##
> ## radio_property& operator = (const octave_value& val);
> ##
> ## that preserves the list of possible values, which is different
> ## from what would happen if we simply used the
> ##
> ## TYPE (const octave_value&)
> ##
> ## constructor, which creates a new radio_property and so cannot
> ## preserve the old list of possible values.
>
> Which properties should be tagged with "a" in graphics.h.in?
currently none, because there are no radio_property properties now.
But some which today are octave_values will have to be converted --
line.linestyle, line.marker, line.color and such. The conversion is
not just adding an "a" but also changing the type of the property and
adding a list of allowed values. I will probably do this slowly over
time (or in one fell swoop if I have a lot of time without enough
energy to think about things).
Shai