[glade--] Could raw C++ pointers be eliminated?
Paul Elliott <[email protected]> Tue, 19 Oct 2004 21:44:31 -0500
| Newsgroups | gmane.comp.gnome.glademm |
|---|---|
| Message-ID | <[email protected]> |
My (and others) C++ memory philosophy is that raw C++ pointers
should be very rare in application programs. They cause
problems in an exception environment:
http://www.io.com/~pelliott/notes/philo.html
http://austinlug.org/ALG/Presentations/elliott_peless/peless.sxi
(see especially slide 40)
When I need to create a complex widgit or dialog, I run
glademm, glade--, then I hack the hell out of the generated
code, changing all the pointers to sub-widgits to contained
("has-a") subobjects.
What would be involved in changing glade-- to generate
this code automaticly?
If this is not easy, what would be involved in changing
all the raw pointers to some kind of smart pointer?
std::auto_ptr, boost::shared_ptr or Gtk::RefPtr?
One of the selling points of Gtkmm is that member instances
can be used:
(4) Member instances can be used, simplifying memory
management. All GTK+ C widgets are dealt with by use of
pointers. As a C++ coder you know that pointers should be
avoided where possible.
From the Gtkmm FAQ:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/FAQ/html/index.html#id2486512
So my question is, how much trouble would it be to make glade-- take
advantge of this?
Thank You
Best wishes.
--
Paul Elliott 1(512)837-1096
[email protected] PMB 181, 11900 Metric Blvd Suite J
http://www.io.com/~pelliott/pme/ Austin TX 78758-3117
_______________________________________________
glademm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/glademm-list
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBddEPiv9zpDRc3ZkRAgNUAJ9fFPD0Wr2/Y3sAuOISD+au0Y7iiACfed6l pIsjq09vC9lAYLZv5HeKNXE= =2kVC -----END PGP SIGNATURE-----