gEDA-user: interesting links
Peter Clifton
pcjc2 at cam.ac.uk
Thu Aug 30 14:47:08 EDT 2007
On Thu, 2007-08-30 at 14:03 -0400, DJ Delorie wrote:
> C, not C++. Go read the pcb code; it has tables and switch statements
> all over the place that check the object type.
>
> If you're using vtables anyway, you might as well put a pointer to the
> vtable in the structure and skip all the "type" checking.
Yep - although my original reason for suggesting moving a function
pointer from the OBJECT struct was that it was a gschem pointer in a
libgeda structure. "type" belongs to libgeda, but the vfunc table with
front-end dependent drawing functions ought not.
Anyway - this is all very idealistic - I don't propose changing anything
right now, although I am looking into how libgeda / gschem could be
further separated into the model / view+controller pattern. In its
standard interpretation, this would entail allowing multiple views -
which means not putting view specific pointers / data in the model.
Peter C.
More information about the geda-user
mailing list