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

Re: gEDA-dev: New diagram (attempt at UML)



On Thu, 2007-03-22 at 09:57 -0800, Steve Meier wrote:
> I think I like the union inside the object especially for complex
> objects which has a list of 
> 
> GList *prim_objs;    // Other Primitive objects 
> 
> else it would have to have lists for arcs, boxes, circles, lines, text
> and pictures.

No, not necessarily. It would have a list of "object" pointers.
Depending on what type identifier is embedded in the object header, we
know it is safe to type-cast this pointer to a "box" pointer, or a
"circle" pointer.

(This is why I used the word 'carefully' in the suggestion - you have to
avoid an incorrect typecast for the type of object you have. On the
other hand.. you need to be careful which union member you access, so it
doesn't really matter).

The benefit of "my way" (e.g. gobject's way) is that an external program
can if it wants, make a new derived object without needing to modify the
union in the library. Whether or not this is actually relevant for our
case I don't know.

> struct st_complex {
> 
>   char *basename;
> 
>   BOOL is_hierarchy_io;    // is this an interpage hierarchical symbol?
>   BOOL is_schematic_sym;   // is this a symbol that has a schematic?
> 
>   DISPLAY *display;   // how object relates to world and display window
> 
>   BOOL embeded;
> 
>   GList *net_pin_objs;         // list of net pins
> 
>   GList *bus_pin_objs;         // list of bus pins
> 
>   GList *hidden_nets;          // list of nets
> 
>   GList *prim_objs;            // Other Primitive objects 
> };

Looks good. I'm thinking that for the diagram we produced:

net pins and bus pins "might" be the same object. At least, derived from
the same object.

The list of hidden nets is unimportant for a graphic representation.
That should come under the circuit model.

Regards,

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev