rtti.inc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Michael Van Canneyt
  5. member of the Free Pascal development team
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. { Run-Time type information routines }
  13. { The RTTI is implemented through a series of constants : }
  14. Const
  15. tkUnknown = 0;
  16. tkInteger = 1;
  17. tkChar = 2;
  18. tkEnumeration = 3;
  19. tkFloat = 4;
  20. tkSet = 5;
  21. tkMethod = 6;
  22. tkSString = 7;
  23. tkString = tkSString;
  24. tkLString = 8;
  25. tkAString = 9;
  26. tkWString = 10;
  27. tkVariant = 11;
  28. tkArray = 12;
  29. tkRecord = 13;
  30. tkInterface = 14;
  31. tkClass = 15;
  32. tkObject = 16;
  33. tkWChar = 17;
  34. tkBool = 18;
  35. tkInt64 = 19;
  36. tkQWord = 20;
  37. { A record is designed as follows :
  38. 1 : tkrecord
  39. 2 : Length of name string (n);
  40. 3 : name string;
  41. 3+n : record size;
  42. 7+n : number of elements (N)
  43. 11+n : N times : Pointer to type info
  44. Offset in record
  45. }
  46. Type
  47. TRecElem = Record
  48. Info : Pointer;
  49. Offset : Longint;
  50. end;
  51. TRecElemArray = Array[1..Maxint] of TRecElem;
  52. PRecRec = ^TRecRec;
  53. TRecRec = record
  54. Size,Count : Longint;
  55. Elements : TRecElemArray;
  56. end;
  57. { An array is designed as follows :
  58. 1 : tkArray;
  59. 2 : length of name string (n);
  60. 3 : NAme string
  61. 3+n : Element Size
  62. 7+n : Number of elements
  63. 11+n : Pointer to type of elements
  64. }
  65. PArrayRec = ^TArrayRec;
  66. TArrayRec = record
  67. Size,Count : Longint;
  68. Info : Pointer;
  69. end;
  70. { The actual Routines are implemented per processor. }
  71. {$i rttip.inc}
  72. {
  73. $Log$
  74. Revision 1.8 2000-06-22 20:04:07 peter
  75. * added tkint64,tkqword constants
  76. Revision 1.7 2000/06/14 08:52:05 michael
  77. + Fixed all constants so they match compiler defined constants
  78. Revision 1.6 2000/02/09 16:59:31 peter
  79. * truncated log
  80. Revision 1.5 2000/01/07 16:41:36 daniel
  81. * copyright 2000
  82. }