home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / IDIOMS.ZIP / EK.C < prev    next >
C/C++ Source or Header  |  1991-12-04  |  2KB  |  41 lines

  1. /* Copyright (c) 1992 by AT&T Bell Laboratories. */
  2. /* Advanced C++ Programming Styles and Idioms */
  3. /* James O. Coplien */
  4. /* All rights reserved. */
  5.  
  6. //************************************************************//
  7. //                                                            //
  8. //     F I L E :    E K . C                                   //
  9. //                                                            //
  10. //         Code for class Thing                               //
  11. //                                                            //
  12. //************************************************************//
  13.  
  14. #include "ek.h"
  15.  
  16. Thing *
  17. Thing::cutover() {
  18.     // placeholder for cutover function.  This function is
  19.     // provided by the user on a case-by-case basis to
  20.     // orchestrate the conversion between an old class
  21.     // data format and a new one.  The function is
  22.     // invoked on an instance of the old class, and should
  23.     // return an instance of the new one.
  24.     return this;
  25. }
  26.  
  27. int
  28. Thing::docutover() {
  29.     // the user may choose not to cut over some objects
  30.     // on a class data conversion.  This function returns
  31.     // true or false on an object-by-object basis to tell
  32.     // whether the object should be converted to the new
  33.     // format.  This is done mainly for objects shared
  34.     // by multiple envelope classes:  the object needs
  35.     // to be converted exactly once, NOT once per
  36.     // envelope, and docutover can orchestrate when that
  37.     // shared object is converted (by looking at its
  38.     // reference count, keeping a shadow counter, etc.)
  39.     return 1;
  40. }
  41.