home *** CD-ROM | disk | FTP | other *** search
- #ifndef lint
- static const char sccsid[] = "%Z%%I% %G% %U% %W%";
- #endif
- /*
- * COMPONENT_NAME: (RTTI) Run-Time Type System for C++
- *
- * FUNCTIONS:
- *
- * ORIGINS: 27
- *
- * (C) COPYRIGHT International Business Machines Corp. 1992
- * This work was supported by a grant from International Business
- * Machines, Inc. These procedures are contributed to the public domain
- * by International Business Machines Inc. "AS IS" without any warranty
- * of any kind including the warranty of merchantability or fitness
- * for a particular purpose.
- *
- *
- * This is free software. Feel free to redistribute and/or modify it.
- * Please send us e-mail and let us know if you have any problems
- * or suggestions.
- *
- * Arindam Banerji
- * axb@cse.nd.edu
- *
- */
-
-
- #ifdef _KERNEL
- #include <stdio.h>
- #else
- #include <iostream.h>
- #endif // _KERNEL
-
-
-
- #include "String.h"
- #include "trace.h"
-
- // trace.cc
- // A simple trace utility for the back-end
-
- Trace::Trace(string name) : funcname(name) , type(FUNCTIONTYPE)
- {
- #ifdef TRACE
-
- #ifdef _KERNEL
- printf("Entering function %s\n", (char *) funcname ) ;
- #else
- cerr << " Entering function " << funcname << endl ;
- #endif // _KERNEL
-
- #endif // TRACE
- }
-
- Trace::Trace(string nm,string cls) :
- funcname(nm),type(CLASSTYPE),classname(cls)
- {
- #ifdef TRACE
-
- #ifdef _KERNEL
- printf("Entering member %s in %s\n",(char *) funcname,
- (char *) classname) ;
- #else
- cerr << "Entering member " << funcname << "in " << classname << endl ;
- #endif // _KERNEL
-
- #endif // TRACE
- }
-
-
- Trace::~Trace ()
- {
- if (type == CLASSTYPE)
- {
- #ifdef TRACE
-
- #ifdef _KERNEL
- printf("Exiting member %s in %s\n", (char *) funcname,
- (char *) classname ) ;
- #else
- cerr << "Exiting member " << funcname << "in " << classname << endl;
- #endif // _KERNEL
-
- #endif // TRACE
- }
- else if ( type == FUNCTIONTYPE)
- {
- #ifdef TRACE
-
- #ifdef _KERNEL
- printf("Exiting %s\n", (char *) funcname) ;
- #else
- cerr << "Exiting " << funcname << endl;
- #endif // _KERNEL
-
- #endif // TRACE
- }
- } // destructor
-
-