octave-maintainers
[Top][All Lists]
Advanced

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

Re: changing genprop.awk to handle radio_values


From: John W. Eaton
Subject: Re: changing genprop.awk to handle radio_values
Date: Fri, 14 Sep 2007 16:03:54 -0400

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?

  ##   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?

Thanks,

jwe


reply via email to

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