home *** CD-ROM | disk | FTP | other *** search
- ***************************************************************************
- * RTTI SAMPLE PROJECT: Readme File (README) *
- * *
- * COPYRIGHT: Copyright(C) International Business Machines Corp.,1992,1995.*
- * *
- * DISCLAIMER OF WARRANTIES: *
- * The accompanying code is sample code created by the IBM Corporation. *
- * This sample code is not part of any standard IBM product and is *
- * provided to you solely for the purpose of assisting you in the *
- * development of your applications. The code is provided "AS IS", *
- * without warranty of any kind. IBM shall not be liable for any *
- * damages arising out of your use of the sample code, even if they *
- * have been advised of the possibility of such damages. *
- ***************************************************************************
- SAMPLE - RTTI
- DESCRIPTION:
- RTTI is a C++ program that uses the new runtime type information
- supported by the compiler. The test case uses the new 'typeid'
- and the new 'dynamic_cast' operator'.
-
- TASK:
- The program creates a company with a list of employees.
- The list is traversed at runtime to calculate the company payroll.
-
- CONCEPT/FEATURE:
- The new 'typeid' operator is used to identify at runtime the type
- an object pointed to by a pointer, that is, the type of of employee
- (either manager or programmer) found in the company's list.
-
- The new 'dynamic_cast' operator is used to perform a safe down cast,
- from a pointer to a base class type to a pointer to a derived class
- type, that is, from a pointer to 'employee', which is the generic
- type describing the employees of the company, to a pointer to a
- manager or programmer type, which describes in more specific
- details the attributes of each company's employees.
-
-
- HOW TO RUN THE SAMPLE FROM THE COMMAND LINE:
-
- Simply type the name of the .EXE file, that is:
-
- MAIN.EXE
-
- HOW TO BUILD THE SAMPLE FROM THE COMMAND LINE:
-
- Enter the following:
-
- cd X:\ibmcppw\samples\compiler\rtti
-
- where X: is the drive you installed the samples component of
- VisualAge for C++.
-
- To build the RTTI sample, enter the following:
-
- NMAKE
-
-
- ADDITIONAL INFORMATION:
-
- For information on this and other samples shipped with the VisualAge for
- C++ product, please see the Guide to Samples notebook.
-
- To access the notebook from the Program Manager, open the VisualAge for
- C++ product object, then open the Guide to Samples notebook.
-
-
-