home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / CTECHAPP.ZIP / CONTAINR.ZIP / CONTAINR.CPP next >
C/C++ Source or Header  |  1990-02-19  |  907b  |  47 lines

  1. //  Module:     Containr (Abstract Base Class for Containers)
  2. //  Version:    3.20
  3. //
  4. //  Language:   C++ 2.0
  5. //  Environ:    Any
  6. //
  7. //  Purpose:    Provides an abstract base class for container classes.
  8. //
  9. //  Written by: Scott Robert Ladd
  10.  
  11. #include "Containr.hpp"
  12.  
  13. extern "C"
  14.     {
  15.     #include "stdio.h"
  16.     }
  17.  
  18. // prototypes
  19. static void DefaultHandler();
  20.  
  21. // default exception handler
  22. static void DefaultHandler()
  23.     {
  24.     puts("\aContainer Error: memory allocation failure!");
  25.     }
  26.  
  27. // constructor
  28. Container::Container()
  29.     {
  30.     Count = 0;
  31.     ErrorHandler = DefaultHandler;
  32.     }
  33.  
  34. // copy constructor
  35. Container::Container(const Container & c)
  36.     {
  37.     Count = c.Count;
  38.     ErrorHandler = c.ErrorHandler;
  39.     }
  40.  
  41. // assignment opeartor
  42. void Container::operator = (const Container & c)
  43.     {
  44.     Count = c.Count;
  45.     ErrorHandler = c.ErrorHandler;
  46.     }
  47.