.TH G_CHECK 2 "2 October 1991" "Demeter" "Demeter Software" .SH NAME g_check \- send the generic check message to an object. .SH SYNOPSIS int Universal:: .I g_check ( char* objClassName ) .SH DESCRIPTION .I g_check checks whether the receiver is a legal object of class .I objClassName. If .I objClassName is not provided, the first class in the current class dictionary is used. The receiving object must be a tree object. That is, it cannot have any cycles or shared subobjects. .I g_check is a generic method implemented at class Universal and inherited by any user class. .SH ERROR MESSAGES If the receiving object is a legal object of class .I objClassName, .I g_check displays the message "GCHECK Success: this is a legal object of type .I objClassName ". Otherwise, three error messages are displayed. .TP 10 Diagnostic An explanation of the error. .TP Production stack dump A listing, in reverse order, of the productions in the grammar that led to the point where the error occurred. .TP Error condition The message "GCHECK Error: this is NOT a legal object of type .I objClassName " is displayed. .LP .SH EXAMPLE Here is an example of how to use .I g_check . Compound* iCompound = new Compound(); .br iCompound = someCompoundInstantiatingFunction(); .br .br if( iCompound->g_check() ) .br exit( -1 ); .br Of course, in this example we could have used g_parse. But since a successful send of g_parse always returns a legal object, sending g_check becomes unnecessary. This example shows that .I g_check is most useful when instantiating objects with means other than g_parse. .SH SEE ALSO g_parse(2), g_equal(2), g_copy(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