home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / gnusmalltalk / ctype.st < prev    next >
Text File  |  1992-02-16  |  2KB  |  72 lines

  1. "======================================================================
  2. |
  3. | Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
  4. | Written by Steve Byrne.
  5. |
  6. | This file is part of GNU Smalltalk.
  7. |
  8. | GNU Smalltalk is free software; you can redistribute it and/or modify it
  9. | under the terms of the GNU General Public License as published by the Free
  10. | Software Foundation; either version 1, or (at your option) any later version.
  11. | GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
  12. | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. | FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  14. | details.
  15. | You should have received a copy of the GNU General Public License along with
  16. | GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
  17. | Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  
  18. |
  19.  ======================================================================"
  20.  
  21. "
  22. |     Change Log
  23. | ============================================================================
  24. | Author       Date       Change 
  25. | sbb         16 Feb 92      created summer 90
  26. |
  27. "
  28.  
  29. !CType class methodsFor: 'instance creation'!
  30.  
  31. baseType: aBaseType
  32.     ^self baseType: aBaseType subType: nil
  33. !
  34.  
  35. baseType: aBaseType subType: aSubType
  36.     ^self baseType: aBaseType subType: aSubType numElements: 1
  37. !
  38.  
  39. baseType: aBaseType subType: aSubType numElements: anInteger
  40.     ^self new baseType: aBaseType subType: aSubType numElements: anInteger
  41. !!
  42.  
  43. !CType methodsFor: 'accessing'!
  44.  
  45. subType
  46.     ^subType
  47. !
  48.  
  49. baseType
  50.     ^baseType
  51. !
  52.  
  53. numElements
  54.     ^numElements
  55. !
  56.  
  57. sizeof
  58.     ^numElements * subType sizeof
  59. !!
  60.  
  61.  
  62. !CType methodsFor: 'private'!
  63.  
  64. baseType: aBaseType subType: aSubType numElements: anInteger
  65.     baseType _ aBaseType.
  66.     subType _ aSubType.
  67.     numElements _ anInteger
  68. !!
  69.  
  70.