.TH G_DRAW 2 "24 September 1991" "Demeter" "Demeter Software" .SH NAME g_draw \- sends the generic draw message to an object. .SH SYNOPSIS virtual void Universal:: .I g_draw() .SH DESCRIPTION .I g_draw displays a detailed description of an object using an indented tree format. The class of the object is displayed, followed by a descriptor that depends on the type of class the object belongs to. If the class of the object is a construction class, the descriptor HAS n PARTS is displayed, where n is the number of parts as defined in the class dictionary. If the class of the object is a repetition class, the descriptor HAS n ELEMENTS is displayed, where n is the number of actual repeated elements in the object. In either case, the composition of the object is displayed by sending the .I g_draw message to each part or element of the object. If the object is of a terminal class (i.e., Ident, Number, Real, String, or Text), then instead of describing the composition of the object, the value of the object is displayed. If the class of the object is a construction class and one of its optional components is not present, then .I g_draw displays the message "Missing optional part!" instead of sending the .I g_draw message to the nonexistent object. The receiving object must be a tree object. That is, it cannot have any cycles or shared subobjects. .SH REDEFINITION Since .I g_draw is a virtual function, it can be redefined at any user class. This means that the user can change the way in which .I g_draw displays a particular class of objects. As a technical consideration, making .I g_draw virtual allows to define it recursively and to give the termination condition as a redefinition at the terminal classes DemIdent, DemNumber, DemReal, DemString, and DemText. .SH EXAMPLE Here is an example of how to use .I g_draw . Compound* iCompound = new Compound(); .br iCompound = (Compound*)iCompound->g_parse("demeter-input"); .br .br iCompound->g_draw(); .SH SEE ALSO g_parse(2), terminal(2) .SH REFERENCES .I User Manual for The C++ Demeter System .br Walter L. Hursch .br Northeastern University, 1993 .I The Annotated C++ Reference Manual .br Margaret A. Ellis and Bjarne Stroustrup .br Addison-Wesley, 1990 .I C++ Primer .br Stanley B. Lippman .br Addison-Wesley, 1989