[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Graphics] More convenient backend access
From: |
John W. Eaton |
Subject: |
Re: [Graphics] More convenient backend access |
Date: |
Sat, 02 Feb 2008 02:56:59 -0500 |
On 2-Feb-2008, Shai Ayal wrote:
| On Feb 1, 2008 12:58 PM, Shai Ayal <address@hidden> wrote:
| >
| > On Feb 1, 2008 12:11 PM, Michael Goffioul <address@hidden> wrote:
| > > On Fri, Feb 1, 2008 at 8:07 AM, Shai Ayal <address@hidden> wrote:
| > > > Attached is a patch which adds the figure.__backend__ property and
| > > > relevant set method
| > > > Michael, can you please have a look and approve -- I'm not sure I
| > > > understood the interaction between graphics_backend and figure.
| > > >
| > > > Shai
| > > >
| > > > 2008-02-01 Shai Ayal <address@hidden>
| > > >
| > > > * graphics.h.in (figure): add __backend__ property and set method
| > > > (class graphics_backend): add find_backend method
| > > >
| > >
| > > It looks OK (although I don't understand why you call find_backend
| > > twice; you could re-use "b", no?).
| >
| > you are correct -- it is a typo.
|
| The corrected patch attached
| Shai
|
| 2008-02-01 Shai Ayal <address@hidden>
|
| * graphics.h.in (figure): add __backend__ property and set method
| (class graphics_backend): add find_backend method
I applied this patch and checked it in but changed
| + static graphics_backend find_backend (const std::string& name)
| + {
| + if (available_backends.find (name) != available_backends.end ())
| + return available_backends[name];
| + else
| + return default_backend ();
| + }
to be
static graphics_backend find_backend (const std::string& name)
{
const_available_backends_iterator p = available_backends.find (name);
if (p != available_backends.end ())
return p->second;
else
return default_backend ();
}
(along with adding some typedefs for the iterators). I know that this
change is not terribly important, but we might as well only do the map
lookup once.
Thanks,
jwe