home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / compiler / rtti / readme.txt < prev    next >
Encoding:
Text File  |  1996-02-20  |  2.8 KB  |  67 lines

  1. ***************************************************************************
  2. *  RTTI SAMPLE PROJECT: Readme File (README)                              *
  3. *                                                                         *
  4. * COPYRIGHT: Copyright(C) International Business Machines Corp.,1992,1995.*
  5. *                                                                         *
  6. * DISCLAIMER OF WARRANTIES:                                               *
  7. *   The accompanying code is sample code created by the IBM Corporation.  *
  8. *   This sample code is not part of any standard IBM product and is       *
  9. *   provided to you solely for the purpose of assisting you in the        *
  10. *   development of your applications.  The code is provided "AS IS",      *
  11. *   without warranty of any kind.  IBM shall not be liable for any        *
  12. *   damages arising out of your use of the sample code, even if they      *
  13. *   have been advised of the possibility of such damages.                 *
  14. ***************************************************************************
  15. SAMPLE - RTTI
  16.    DESCRIPTION:
  17.         RTTI is a C++ program that uses the new runtime type information 
  18.         supported by the compiler. The test case uses the new 'typeid'
  19.         and the new 'dynamic_cast' operator'.
  20.  
  21.    TASK:
  22.         The program creates a company with a list of employees.
  23.         The list is traversed at runtime to calculate the company payroll.
  24.  
  25.    CONCEPT/FEATURE:
  26.         The new 'typeid' operator is used to identify at runtime the type 
  27.         an object pointed to by a pointer, that is, the type of of employee 
  28.         (either manager or programmer) found in the company's list. 
  29.  
  30.         The new 'dynamic_cast' operator is used to perform a safe down cast, 
  31.         from a pointer to a base class type to a pointer to a derived class
  32.         type, that is, from a pointer to 'employee', which is the generic 
  33.         type describing the employees of the company, to a pointer to a
  34.         manager or programmer type, which describes in more specific 
  35.         details the attributes of each company's employees.
  36.  
  37.  
  38. HOW TO RUN THE SAMPLE FROM THE COMMAND LINE:
  39.  
  40.    Simply type the name of the .EXE file, that is:
  41.  
  42.       MAIN.EXE
  43.  
  44. HOW TO BUILD THE SAMPLE FROM THE COMMAND LINE:
  45.    
  46.    Enter the following:
  47.       
  48.       cd X:\ibmcppw\samples\compiler\rtti 
  49.  
  50.    where X: is the drive you installed the samples component of 
  51.    VisualAge for C++.
  52.  
  53.    To build the RTTI sample, enter the following:
  54.  
  55.        NMAKE
  56.  
  57.  
  58. ADDITIONAL INFORMATION:
  59.  
  60.    For information on this and other samples shipped with the VisualAge for
  61.    C++ product, please see the Guide to Samples notebook.
  62.  
  63.    To access the notebook from the Program Manager, open the VisualAge for 
  64.    C++ product object, then open the Guide to Samples notebook.
  65.  
  66.  
  67.