rtti.inc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.2 2000-07-13 11:33:45 michael
  75. + removed logs
  76. }