home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tlx501.zip / SRC / XALLOC.CPP < prev    next >
C/C++ Source or Header  |  1996-07-08  |  2KB  |  51 lines

  1. /****************************************************************************
  2.     $Id: xalloc.cpp 501.0 1995/03/07 12:26:30 RON Exp $
  3.  
  4.     Copyright (c) 1991-95 Tarma Software Research. All rights reserved.
  5.  
  6.     Project:    Tarma Library for C++ V5.0
  7.     Author:     Ron van der Wal
  8.  
  9.     Implementation of class TLXAlloc.
  10.  
  11.     $Log: xalloc.cpp $
  12.     Revision 501.0  1995/03/07 12:26:30  RON
  13.     Updated for TLX 5.01
  14.     Revision 1.3  1995/01/31 16:30:36  RON
  15.     Update for release 012
  16.     Added partial support for SunPro C++ compiler
  17.     Revision 1.2  1995/01/06  15:59:02  ron
  18.     Corrected Revision keyword
  19.  
  20.     Revision 1.1  1994/11/16  15:46:33  ron
  21.     Initial revision
  22.  
  23. ****************************************************************************/
  24.  
  25. #include <tlx\501\_build.h>
  26.  
  27. TLX_MODULE_INFO("$Revision: 501.0 $");
  28.  
  29. #include <stdio.h>              // For sprintf()
  30. #include <tlx\501\except.h>
  31.  
  32. /*-------------------------------------------------------------------------*/
  33.     TLXAlloc::TLXAlloc(const TLXLocus &aLocus, size_t aSize)
  34.  
  35. /*  Constructor. Initializes the data members and base class.
  36. ---------------------------------------------------------------------------*/
  37. : TLException(aLocus), mSize(aSize)
  38. {
  39. }
  40.  
  41. /*-------------------------------------------------------------------------*/
  42.     const char *TLXAlloc::Description() const
  43.  
  44. /*  Builds a description of the exception and returns a pointer to it.
  45. ---------------------------------------------------------------------------*/
  46. {
  47.     sprintf(sBuffer, "Memory allocation of %u bytes failed", mSize);
  48.     return sBuffer;
  49. }
  50.  
  51.