1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Documentation for LCL (Lazarus Component Library) and LazUtils (Lazarus
Utilities) are published under the Creative Commons Attribution-ShareAlike 4.0
International public license.
https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt
https://gitlab.com/freepascal.org/lazarus/lazarus/-/blob/main/docs/cc-by-sa-4-0.txt
Copyright (c) 1997-2025, by the Lazarus Development Team.
-->
<fpdoc-descriptions>
<package name="lazutils">
<!--
====================================================================
Maps
====================================================================
-->
<module name="Maps">
<short>Implements a map for unique IDs to arbitrary data.</short>
<descr>
<p>
<file>maps.pp</file> implements a map for unique IDs to arbitrary data. The
ID-to-Data mapping is stored in an Average Level Binary Tree for fast
indexing. The map also maintains a linked list between the ordered items for
fast iteration through its elements. The ID can be signed or unsigned, with a
size of 1, 2, 4, 8, 16 or 32 bytes. The data can be of any (constant) size.
</p>
<p>
Author: Marc Weustink
</p>
<p>
<file>maps.pp</file> is part of the <file>LazUtils</file> package.
</p>
</descr>
<!-- unresolved externals references -->
<element name="Classes"/>
<element name="SysUtils"/>
<element name="Math"/>
<element name="typinfo"/>
<element name="Laz_AVL_Tree"/>
<element name="FPCAdds"/>
<element name="TMapIdType">
<short>Identifies the data type used for map IDs.</short>
<descr>
<p>
TMapIdType is an enumeration type with values that identify the native data
type used in map ID values. TMapIdType is used in TMapID and as an argument
in the TBaseMap.Create method.
</p>
</descr>
<seealso>
<link id="TMapID">TMapID</link>
<link id="TBaseMap.Create">TBaseMap.Create</link>
</seealso>
</element>
<element name="TMapIdType.itu1">
<short>1 byte unsigned value (Byte).</short>
</element>
<element name="TMapIdType.its1">
<short>1 byte signed value (ShortInt).</short>
</element>
<element name="TMapIdType.itu2">
<short>2 byte unsigned value (Word).</short>
</element>
<element name="TMapIdType.its2">
<short>2 byte signed value (SmallInt).</short>
</element>
<element name="TMapIdType.itu4">
<short>4 byte unsigned value (LongWord).</short>
</element>
<element name="TMapIdType.its4">
<short>4 byte signed value (LongInt).</short>
</element>
<element name="TMapIdType.itu8">
<short>8 byte unsigned value (QWord).</short>
</element>
<element name="TMapIdType.its8">
<short>8 byte signed value (Int64).</short>
</element>
<element name="TMapIdType.itu16">
<short>16 byte unsigned value (Low and High QWords).</short>
</element>
<element name="TMapIdType.its16">
<short>16 byte signed value (Low QWord and High Int64).</short>
</element>
<element name="TMapIdType.itu32">
<short>32 byte unsigned value (4 QWord values).</short>
</element>
<element name="TMapIdType.its32">
<short>32 byte signed value (3 QWord values and Int64).</short>
</element>
<element name="itsPtrSize">
<short>
Constant that indicates the size of a signed Pointer in the map.
</short>
<descr>
<p>
itsPtrSize is a constant TMapIdType data type that indicates the size used
for a signed Pointer in the map. The definition is CPU-specific. For a 64-bit
CPU, it is defined as its8 in TMapIdType (or Int64). For all other CPUs, it
is defines as its4 in TMapIdType (or LongInt).
</p>
<p>
Use ituPtrSize to get the length of an unsigned Pointer in the map.
</p>
<remark>
Not used in the current implementation.
</remark>
</descr>
</element>
<element name="ituPtrSize">
<short>
Constant that indicates the size of an unsigned Pointer in the map.
</short>
<descr>
<p>
ituPtrSize is a constant TMapIdType data type that indicates the size used
for an unsigned Pointer in the map. The definition is CPU-specific. For a
64-bit CPU, it is defined as itu8 in TMapIdType (or QWord). For all other
CPUs, it is defines as itu4 in TMapIdType (or LongWord).
</p>
<p>
Use itsPtrSize to get the length of a signed Pointer in the map.
</p>
<remark>
Not used in the current implementation.
</remark>
</descr>
</element>
<element name="PMapItem">
<short>Pointer to a TMapItem data type.</short>
<descr>
<p>
PMapItem is a Pointer to a TMapItem data type. PMapItem is the type used to
represent the first, last, previous, and next items in a linked list.
PMapItem is used in TMapLink and TBaseMap.
</p>
</descr>
<seealso>
<link id="TMapItem">TMapItem</link>
<link id="TMapLink">TMapLink</link>
<link id="TBaseMap">TBaseMap</link>
</seealso>
</element>
<element name="PMapLink">
<short>Pointer to a TMapLink data type.</short>
<descr>
<p>
PMapLink is a Pointer to a TMapLink data type.
</p>
<remark>
Not used in the current implementation.
</remark>
</descr>
</element>
<element name="TMapLink">
<short>Record type used to build the linked list for items in the map.</short>
<descr>
<p>
TMapLink is a record type with members that contain Pointers to the Previous
and Next items in the linked list for the map. TMapLink is used to implement
TMapItem.
</p>
</descr>
</element>
<element name="TMapLink.Previous">
<short>Pointer to the previous item in the linked list for a map.</short>
<descr>
<p>
Previous is a PMapItem type that contains a pointer to the previous item in
the linked list for a map. Values in Previous and Next are used when TBaseMap
adds an item to the map, and when TMapIterator acts upon items in the linked
list.
</p>
</descr>
</element>
<element name="TMapLink.Next">
<short>Pointer to the Next item in the linked list for a map.</short>
<descr>
<p>
Next is a PMapItem type that contains a pointer to the Next item in the
linked list for a map. Values in Previous and Next are used when TBaseMap
adds an item to the map, and when TMapIterator acts upon items in the linked
list.
</p>
</descr>
</element>
<element name="PMapID">
<short>Pointer to a TMapID type.</short>
<descr>
<p>
PMapID is a Pointer to a TMapID type.
</p>
</descr>
</element>
<element name="TMapID">
<short>Represents an ID in a map association.</short>
<descr>
<p>
TMapID is a record type used to provide access to the byte values in the ID
for a map association. Members are provided in TMapID to represent each byte
in the signed or unsigned value used in the ID.
</p>
<p>
Values in the TMapIdType enumeration indicate which members in the variable
structure are needed for the ID value. In other words, assigning an unsigned
Byte value to the ID yields access to the U1 member. Assigning a signed
ShortInt value to ID, yields access to the S1 member. Et. al.
</p>
<p>
The implementation for 16- and 32-byte ID values is platform- or OS-specific,
and takes into account the Endian byte order for the values.
</p>
<p>
TMapID is the type used for the ID member in TMapItem.
</p>
</descr>
</element>
<element name="TMapID.U1">
<short>
Unsigned Byte value for the ID (1 Byte).
</short>
</element>
<element name="TMapID.S1">
Signed ShortInt value for the ID (1 Byte)
<short>.
</short>
</element>
<element name="TMapID.U2">
<short>
Unsigned Word value for the ID (2 Bytes).
</short>
</element>
<element name="TMapID.S2">
<short>
Signed SmallInt value for the ID (2 Bytes).
</short>
</element>
<element name="TMapID.U4">
<short>
Unsigned LongWord value for the ID (4 Bytes).
</short>
</element>
<element name="TMapID.S4">
<short>
Signed LongInt value for the ID (4 Bytes).
</short>
</element>
<element name="TMapID.U8">
<short>
Unsigned QWord value for the ID (8 Bytes).
</short>
</element>
<element name="TMapID.S8">
<short>
Signed Int64 value for the ID (8 Bytes).
</short>
</element>
<element name="TMapID.U16H">
<short>
Unsigned QWords (Low and High) (16 Bytes) (with Endian byte order).
</short>
</element>
<element name="TMapID.U16L">
<short>.
</short>
</element>
<element name="TMapID.S16H">
<short>.
</short>
</element>
<element name="TMapID.S16L">
<short>
Signed QWord (Low) and Int64 (High) (16 Bytes) (with Endian byte order).
</short>
</element>
<element name="TMapID.U32HH">
<short>
Unsigned QWords (LL, LH, HL, HH) (32 Bytes) (with Endian byte order).
</short>
</element>
<element name="TMapID.U32HL">
<short>
Unsigned QWords (LL, LH, HL, HH) (32 Bytes) (with Endian byte order).
</short>
</element>
<element name="TMapID.U32LH">
<short>
Unsigned QWords (LL, LH, HL, HH) (32 Bytes) (with Endian byte order).
</short>
</element>
<element name="TMapID.U32LL">
<short>
Unsigned QWords (LL, LH, HL, HH) (32 Bytes) (with Endian byte order).
</short>
</element>
<element name="TMapID.S32HH">
<short>
Signed QWords (LL, LH, HL) and signed Int64 (HH) (with Endian byte order).
</short>
</element>
<element name="TMapID.S32HL">
<short>
Signed QWords (LL, LH, HL) and signed Int64 (HH) (with Endian byte order).
</short>
</element>
<element name="TMapID.S32LH">
<short>
Signed QWords (LL, LH, HL) and signed Int64 (HH) (with Endian byte order).
</short>
</element>
<element name="TMapID.S32LL">
<short>
Signed QWords (LL, LH, HL) and signed Int64 (HH) (with Endian byte order).
</short>
</element>
<element name="TMapItem">
<short>
Represents the ID and order of items in the linked list for the map.
</short>
<descr>
<p>
TMapItem is a packed record type with members that represent the ID in the
map, and navigation for the linked list of items. Data for the map item is
written immediately following the packed record structure
</p>
</descr>
</element>
<element name="TMapItem.Link">
<short>
Provides navigation to the previous and next map items in the linked list.
</short>
<descr>
<p>
Link is a TMapLink type which provides navigation to the previous and next
map items in the linked list. Link contains Pointers to TMapItem instances
that represent the order of access for items in the linked list.
</p>
</descr>
</element>
<element name="TMapItem.ID">
<short>
Represents the ID for the map item.
</short>
<descr>
<p>
ID is a TMapID type that represents the ID for the map item. ID provides
members which allow access to the byte values in the unique identifier.
</p>
</descr>
</element>
<element name="TLockedMapModifyException">
<short>Exception raised when a modification is made to a locked Map.</short>
<descr/>
<seealso>
<link id="TBaseMap"/>
</seealso>
</element>
<element name="TLockedMapModifyException.Create">
<short>Constructor for the class instance.</short>
<descr>
<p>
<var>Create</var> is the constructor for the class instance, and calls the
inherited constructor using the exception message text: 'Map modification not
allowed'.
</p>
</descr>
<seealso>
<link id="TBaseMap.Clear"/>
<link id="TBaseMap.Delete"/>
<link id="TBaseMap.Destroy"/>
<link id="TBaseMap.InternalAdd"/>
</seealso>
</element>
<element name="TBaseMap">
<short>
Implements the base class for a map for unique IDs to arbitrary data.
</short>
<descr>
<p>
Implements the base class that is a map for unique IDs to arbitrary data. The
ID-to-Data mapping is stored in an Average Level Binary Tree for fast
indexing. The map also maintains a linked list between the ordered items for
fast iteration through its elements. The ID can be signed or unsigned, with a
size of 1, 2, 4, 8, 16 or 32 bytes. The data can be of any (constant) size.
</p>
<p>
Use a descendant class, such as TMap, which includes methods to Add items and
to read or write their arbitrary data values.
</p>
<p>
Author: Marc Weustink
</p>
</descr>
<seealso>
<link id="#rtl.classes.TPersistent">TPersistent</link>
</seealso>
</element>
<element name="TBaseMap.FTree"/>
<element name="TBaseMap.FIdType"/>
<element name="TBaseMap.FDataSize"/>
<element name="TBaseMap.FFirst"/>
<element name="TBaseMap.FLast"/>
<element name="TBaseMap.FIterators"/>
<element name="TBaseMap.FLocked"/>
<element name="TBaseMap.FindNode">
<short>Finds a node in the AVL Tree with the specified ID.</short>
</element>
<element name="TBaseMap.FindNode.Result">
<short>AVL Tree node with the specified item.</short>
</element>
<element name="TBaseMap.FindNode.AId">
<short>ID to locate in the AVL Tree.</short>
</element>
<element name="TBaseMap.FindItem">
<short>Finds the data for the item with the specified ID.</short>
</element>
<element name="TBaseMap.FindItem.Result">
<short>Data stored in the AVL Tree for the specified ID.</short>
</element>
<element name="TBaseMap.FindItem.AId">
<short>ID to locate in the AVL Tree.</short>
</element>
<element name="TBaseMap.FreeData">
<short>Frees the data for the specified AVL Tree node.</short>
</element>
<element name="TBaseMap.FreeData.ANode">
<short>AVL Tree node to locate in the map.</short>
</element>
<element name="TBaseMap.TreeCompareID">
<short>
Gets the relative order for the specified map items using their binary ID
values.
</short>
</element>
<element name="TBaseMap.TreeCompareID.Result">
<short>-1, 0, or 1 as the relative order for the map items.</short>
</element>
<element name="TBaseMap.TreeCompareID.Sender">
<short>AVL Tree for the operation.</short>
</element>
<element name="TBaseMap.TreeCompareID.AItem1">
<short>Map item to compare.</short>
</element>
<element name="TBaseMap.TreeCompareID.AItem2">
<short>Map item to compare.</short>
</element>
<element name="TBaseMap.IteratorAdd">
<short>Adds the map iterator to the internal list.</short>
</element>
<element name="TBaseMap.IteratorAdd.AIterator">
<short>Map iterator to add to the list.</short>
</element>
<element name="TBaseMap.IteratorRemove">
<short>Removes the map iterator from the internal list.</short>
</element>
<element name="TBaseMap.IteratorRemove.AIterator">
<short>Map iterator to remove from the list.</short>
</element>
<element name="TBaseMap.LockMap">
<short>Locks the Map when an iterator is added.</short>
<descr>
<p>
Calls <var>InterLockedIncrement</var> to increase the value in the internal
member used to track the locking state.
</p>
</descr>
<seealso>
<link id="TLockedMapIterator.AddToMap"/>
</seealso>
</element>
<element name="TBaseMap.UnLockMap">
<short>Unlocks the Map when an iterator is removed.</short>
<descr>
<p>
Calls <var>InterLockedDecrement</var> to decrease the value in the internal
member used to track the locking state.
</p>
</descr>
<seealso>
<link id="TLockedMapIterator.RemoveFromMap"/>
</seealso>
</element>
<element name="TBaseMap.InternalAdd">
<short>
Adds a map item with the specified ID and Data to the AVL Tree.
</short>
<descr>
<p>
InternalAdd is a procedure used to add a map item with the specified ID and
Data to the AVL Tree. InternalAdd raises an EListError exception if AId
already exists in the internal AVL Tree, and no actions are performed in the
method.
</p>
<p>
InternalAdd allocates and populates memory used for the TMapItem and its
arbitrary data, and adds the new item to the internal AVL Tree. InternalAdd
updates the pointers to the previous and next map items in the linked list.
</p>
<p>
Do not call InternalAdd directly. Use a descendant class, such as TMap, which
implements the Add method.
</p>
</descr>
<errors>
<p>
Raises an EListError exception when a duplicate ID is found in the AVL Tree.
Raised with the message in DUPLICATE_ID.
</p>
</errors>
</element>
<element name="TBaseMap.InternalAdd.AId">
<short>ID for the new map item.</short>
</element>
<element name="TBaseMap.InternalAdd.AData">
<short>Data for the new map item.</short>
</element>
<element name="TBaseMap.InternalGetData">
<short>
Gets the data stored in the specified map item.
</short>
<descr>
<p>
InternalGetData is a Boolean function used to get the data stored in the
specified map item. AItem is the map item examined in the method, and must
contain a valid pointer. The return value is set to False, and no actions are
performed in the method, when AItem contains <var>Nil</var>. The return value
is <b>True</b> when a pointer has been assigned to AItem.
</p>
<p>
InternalGetData skips the ID value in AItem, and stores the Data for the map
item in AData. The size arguments passed in the constructor are used when
reading the ID and Data values. Please note that no validation is performed
for the arbitrary byte values read into AData.
</p>
<p>
Do not call InternalGetData directly. Use the public methods in the class, or
a descendant class like TMap which implements the GetData method.
</p>
</descr>
<seealso>
<link id="#lazutils.maps.TMap.GetData">TMap.GetData</link>
</seealso>
</element>
<element name="TBaseMap.InternalGetData.Result">
<short><b>True</b> when the specified map item is a valid pointer.</short>
</element>
<element name="TBaseMap.InternalGetData.AItem">
<short>Map item to examine n the method.</short>
</element>
<element name="TBaseMap.InternalGetData.AData">
<short>Data stored in the specified map item.</short>
</element>
<element name="TBaseMap.InternalGetDataPtr">
<short>
Gets a Pointer to the data for the specified map item.
</short>
<descr>
<p>
InternalGetDataPtr is a function used to get a Pointer to the data for the
specified map item. AItem is a Pointer to the map item examined in the
method. The return value is set to <var>Nil</var> when AItem has not been
assigned, and no actions are performed in the method.
</p>
<p>
InternalGetDataPtr sets the Pointer in the return value to the position in
AItem immediately after the ID value. InternalGetDataPtr is used in the
implementation of methods like Delete and FreeData.
</p>
<p>
Do not call InternalGetDataPtr directly. Use one of the public methods in the
class, or a descendant class like TMap which implements the GetDataPtr method.
</p>
</descr>
<seealso>
<link id="TBaseMap.Delete"/>
<link id="#lazutils.maps.TMap.GetDataPtr">TMap.GetDataPtr</link>
</seealso>
</element>
<element name="TBaseMap.InternalGetDataPtr.Result">
<short>Pointer to the data for the specified map item.</short>
</element>
<element name="TBaseMap.InternalGetDataPtr.AItem">
<short>Map item examined in the method.</short>
</element>
<element name="TBaseMap.InternalGetId">
<short>
Get the ID value for the specified map item.
</short>
<descr>
<p>
InternalGetId is a Boolean function used to get the ID value for the
specified map item. AItem is a Pointer to the map item examined in the
method. The return value is <b>False</b> if AItem has not been assigned
(contains <var>Nil</var>), and no actions are performed in the method.
</p>
<p>
InternalGetId stores the ID value from AItem in the AID parameter. The number
of bytes used for the ID is specified using a TMapIdType value in the
constructor for the class.
</p>
<p>
InternalGetID is used primarily in the implementation of TBaseMapIterator and
descendant classes.
</p>
</descr>
</element>
<element name="TBaseMap.InternalGetId.Result">
<short><b>False</b> if the specified map item is not a valid Pointer.</short>
</element>
<element name="TBaseMap.InternalGetId.AItem">
<short>Map item examined in the method.</short>
</element>
<element name="TBaseMap.InternalGetId.AID">
<short>Value for the ID in the specified map item.</short>
</element>
<element name="TBaseMap.InternalSetData">
<short>Stores the data for the specified map item.</short>
<descr/>
</element>
<element name="TBaseMap.InternalSetData.Result">
<short/>
</element>
<element name="TBaseMap.InternalSetData.AItem">
<short/>
</element>
<element name="TBaseMap.InternalSetData.AData">
<short/>
</element>
<element name="TBaseMap.ReleaseData">
<short>Frees resources allocated for the data in the map item.</short>
<descr/>
</element>
<element name="TBaseMap.ReleaseData.ADataPtr">
<short/>
</element>
<element name="TBaseMap.Create">
<short>Constructor for the class instance.</short>
<descr/>
</element>
<element name="TBaseMap.Create.AIdType">
<short/>
</element>
<element name="TBaseMap.Create.ADataSize">
<short/>
</element>
<element name="TBaseMap.Clear">
<short>Clears all map items in the AVL Tree.</short>
<descr/>
</element>
<element name="TBaseMap.Count">
<short>Gets the number of map items in the AVL Tree.</short>
<descr/>
</element>
<element name="TBaseMap.Count.Result">
<short/>
</element>
<element name="TBaseMap.Delete">
<short>Deletes the specified map item from the AVL Tree.</short>
<descr/>
</element>
<element name="TBaseMap.Delete.Result">
<short/>
</element>
<element name="TBaseMap.Delete.AId">
<short/>
</element>
<element name="TBaseMap.Destroy">
<short>Destructor for the class instance.</short>
<descr/>
</element>
<element name="TBaseMapIterator">
<short>Specifies the interface used for map item iterators.</short>
<descr/>
</element>
<element name="TBaseMapIterator.FMap"/>
<element name="TBaseMapIterator.FCurrent"/>
<element name="TBaseMapIterator.FInValid"/>
<element name="TBaseMapIterator.FBOM"/>
<element name="TBaseMapIterator.FEOM"/>
<element name="TBaseMapIterator.MapDestroyed">
<short>Called when the map is destroyed.</short>
</element>
<element name="TBaseMapIterator.MapCleared">
<short>Called when the map is cleared.</short>
</element>
<element name="TBaseMapIterator.ItemRemove">
<short>Called when an Item is removed from the map.</short>
</element>
<element name="TBaseMapIterator.ItemRemove.AData">
<short>Pointer to the AVL Tree node for the item.</short>
</element>
<element name="TBaseMapIterator.AddToMap">
<short>Adds the class instance to the associated Map for the iterator.</short>
<descr/>
<seealso/>
</element>
<element name="TBaseMapIterator.RemoveFromMap">
<short>
Removes the class instance from the associated Map for the iterator.
</short>
<descr/>
<seealso/>
</element>
<element name="TBaseMapIterator.InternalCreate">
<short>
Initializes the iterator for specified the map.
</short>
<descr>
<p>
InternalCreate is a procedure used to initialize the iterator for specified
the map. InternalCreate calls the inherited Create method to create the class
instance, and sets values needed for internal members in the class. The
following properties are updated in the iterator:
</p>
<dl>
<dt>Current</dt>
<dd>Set to the first map item in the linked list</dd>
<dt>BOM</dt>
<dd>Set to <b>True</b> when Current is <var>Nil</var></dd>
<dt>EOM</dt>
<dd>Set to <b>True</b> when Current is <var>Nil</var></dd>
</dl>
<p>
InternalCreate is called from the Create method for the class instance.
</p>
</descr>
</element>
<element name="TBaseMapIterator.InternalCreate.AMap">
<short>Map for the iterator class instance.</short>
</element>
<element name="TBaseMapIterator.InternalLocate">
<short>
<b>True</b> when a matching map item is found.
</short>
<descr>
<p>
InternalLocate is a Boolean function used to locate the specified map item in
the AVL Tree for the map. AID contains a pointer to the map item and its ID
and Data values. The return value is <b>True</b> when a matching map item is
found.
</p>
<p>
InternalLocate calls ValidateMap to ensure that the map is still valid for
the iterator. An EInvalidOperation is raised in ValidateMap if the structure
is not assigned (contains <var>Nil</var>).
</p>
<p>
InternalLocate compares the map item in AId to the nodes in the AVL Tree for
the map. The internal Invalid flag is set to <b>True</b> if a map item in the
linked list has been removed, or when the map has been freed. The values in
the following properties are updated to reflect the position and state for
the iterator:
</p>
<dl>
<dt>BOM</dt>
<dd><b>True</b> when the item in Current is <var>Nil</var></dd>
<dt>EOM</dt>
<dd><b>True</b> when the item in Current is <var>Nil</var></dd>
<dt>Current</dt>
<dd>
Node in the AVL Tree where the item is stored, or the value from Last when
the item is not found
</dd>
</dl>
<p>
Do not call InternalLocate directly. It is called from descendant classes
which implement the Locate method.
</p>
</descr>
</element>
<element name="TBaseMapIterator.InternalLocate.Result">
<short><b>True</b> when the map item exists in the map.</short>
</element>
<element name="TBaseMapIterator.InternalLocate.AId">
<short>Map item to locate in the method.</short>
</element>
<element name="TBaseMapIterator.Validate">
<short>
Validates the AVL Tree and the Current item in the iterator.
</short>
<descr>
<p>
Validate is a procedure used to validate the nodes in the AVL tree for the
map, and the Current item for the iterator. Validate calls ValidateMap to
check the nodes in the AVL Tree. It updates the values in Current and Invalid
as the nodes are processed. Validate raises an EInvalidOperation exception if
the value in Current is <var>Nil</var>, or the Invalid flag is set.
</p>
</descr>
<errors>
<dl>
<dt>EInvalidOperation</dt>
<dd>
Raised when Current is unassigned with the message 'No current item'.
</dd>
<dt>EInvalidOperation</dt>
<dd>
Raised when the Invalid flag is set with the message 'Current item removed'.
</dd>
</dl>
</errors>
</element>
<element name="TBaseMapIterator.ValidateMap">
<short>
Ensures that the map for the iterator is still valid.
</short>
<descr>
<p>
ValidateMap is a procedure used to ensure that the map class for the iterator
is still valid. An EInvalidOperation exception is raised if the class
instance is unassigned (contains <var>Nil</var>).
</p>
</descr>
<errors>
<p>
EInvalidOperation is raised if the map class instance is unassigned (contains
<var>Nil</var>). Raised with the message 'Map destroyed'.
</p>
</errors>
</element>
<element name="TBaseMapIterator.Current">
<short>
Current map item for the iterator.
</short>
<descr>
<p>
Current is a read-only PMapItem property that contains a Pointer to the
current map item for the iterator. The value in Current is updated in
navigation methods for the iterator, such as: First, Next, Previous, Last,
and Locate. The value in Current may also be updated in methods like Validate
and ValidateMap.
</p>
</descr>
</element>
<element name="TBaseMapIterator.Destroy">
<short>Destructor for the class instance.</short>
<descr/>
</element>
<element name="TBaseMapIterator.First">
<short>Moves to the first item in the linked list.</short>
<descr/>
</element>
<element name="TBaseMapIterator.Next">
<short>Moves to the next item in the linked list.</short>
<descr/>
</element>
<element name="TBaseMapIterator.Previous">
<short>Moves to the previous item in the linked list.</short>
<descr/>
</element>
<element name="TBaseMapIterator.Last">
<short>Moves to the last item in the linked list.</short>
<descr/>
</element>
<element name="TBaseMapIterator.Valid">
<short>Indicates if the map for the iterator has been freed.</short>
<descr>
<p>
Valid is a Boolean function used to determine if the map for the iterator is
still valid. The return value is <b>False</b> when the map class instance has
been freed (contains <var>Nil</var>).
</p>
</descr>
</element>
<!-- function result Visibility: public -->
<element name="TBaseMapIterator.Valid.Result">
<short><b>False</b> when the map for the iterator has been freed.</short>
</element>
<element name="TBaseMapIterator.BOM">
<short>
<b>True</b> when the iterator is at the beginning of the linked list for the
map.
</short>
<descr>
<p>
BOM is a read-only Boolean property that indicates if the iterator is at the
beginning of the linked list for the map, or the value in Current is
<var>Nil</var>. The value in BOM is updated when navigation methods for the
iterator are used, such as: First, Next, Previous, Last, and Locate.
</p>
</descr>
</element>
<element name="TBaseMapIterator.EOM">
<short>
<b>True</b> when the iterator is at the end of the linked list for the map.
</short>
<descr/>
</element>
<element name="TMap">
<short>
Implements a map for unique IDs to arbitrary data.
</short>
<descr>
<p>
Implements a map for unique IDs to arbitrary data. The ID-to-Data mapping is
stored in an Average Level Binary Tree for fast indexing. The map also
maintains a linked list between the ordered items for fast iteration through
its elements. The ID can be signed or unsigned, with a size of 1, 2, 4, 8, 16
or 32 bytes. The data can be of any (constant) size.
</p>
<p>
TMap extends the ancestor class to include public methods which Add map
items, and read or write their arbitrary data values.
</p>
<p>
Author: Marc Weustink
</p>
</descr>
</element>
<element name="TMap.Add">
<short>
Adds a map item with the specified ID and Data values.
</short>
<descr/>
</element>
<element name="TMap.Add.AId">
<short>Map item to add in the method.</short>
</element>
<element name="TMap.Add.AData">
<short>Data for the map item to add in the method.</short>
</element>
<element name="TMap.HasId">
<short>
Checks for the specified ID is in the AVL Tree for the map.
</short>
<descr>
<p>
<var>HasId</var> is a <var>Boolean</var> function used to locate the
specified map item in the AVL Tree for the map. HasId calls the FindNode
method to located the value in AId. The return value is <b>True</b> when
FindNode returns a value other than <var>Nil</var>.
</p>
</descr>
</element>
<element name="TMap.HasId.Result">
<short>
<b>True</b> when the AVL Tree contains a node for the specified map item.
</short>
</element>
<element name="TMap.HasId.AID">
<short>Map item to locate in the AVL Tree.</short>
</element>
<element name="TMap.GetData">
<short>
Gets the Data for the map item with the specified ID.
</short>
<descr/>
</element>
<element name="TMap.GetData.Result" link="#lazutils.maps.TBaseMap.InternalGetData.Result">
<short/>
</element>
<element name="TMap.GetData.AId" link="#lazutils.maps.TBaseMap.InternalGetData.AId">
<short/>
</element>
<element name="TMap.GetData.AData" link="#lazutils.maps.TBaseMap.InternalGetData.AId">
<short/>
</element>
<element name="TMap.GetDataPtr">
<short>Gets a Pointer to the data for the specified map item.</short>
<descr/>
</element>
<element name="TMap.GetDataPtr.Result" link="#lazutils.maps.TBaseMap.InternalGetDataPtr.Result">
<short/>
</element>
<element name="TMap.GetDataPtr.AId" link="#lazutils.maps.TBaseMap.InternalGetDataPtr.AId">
<short/>
</element>
<element name="TMap.SetData">
<short>Stores the data for the specified map item.</short>
<descr/>
</element>
<element name="TMap.SetData.Result" link="#lazutils.maps.TBaseMap.InternalSetData.Result">
<short/>
</element>
<element name="TMap.SetData.AId" link="#lazutils.maps.TBaseMap.InternalSetData.AId">
<short/>
</element>
<element name="TMap.SetData.AData" link="#lazutils.maps.TBaseMap.InternalSetData.AData">
<short/>
</element>
<element name="TMapIterator">
<short>Implements an iterator for items in a map.</short>
<descr>
<p>
<var>TMapIterator</var> is a <var>TBaseMapIterator</var> descendant that
implements an iterator for items in a map. TMapIterator provides methods to
initialize the iterator for a map. It also provides methods to read the IDs
for map items, and to read and write the Data in map items. TMapIterator also
provides an implementation of the Locate method.
</p>
</descr>
<seealso>
<link id="TBaseMapIterator"/>
</seealso>
</element>
<element name="TMapIterator.Create">
<short>Constructor for the class instance.</short>
<seealso>
<link id="TBaseMapIterator.InternalCreate"/>
</seealso>
<descr/>
</element>
<element name="TMapIterator.Create.AMap">
<short>Map with IDs and Data for the iterator.</short>
</element>
<element name="TMapIterator.DataPtr">
<short>Gets the Pointer to the Data in a map item.</short>
<descr/>
<seealso>
<link id="TBaseMap.InternalGetDataPtr"/>
</seealso>
</element>
<element name="TMapIterator.DataPtr.Result" link="#lazutils.maps.TBaseMap.InternalGetDataPtr.Result">
<short/>
</element>
<element name="TMapIterator.GetData">
<short>Gets the Data for a map item.</short>
<seealso>
<link id="TBaseMap.InternalGetData"/>
</seealso>
<descr/>
</element>
<element name="TMapIterator.GetData.AData" link="#lazutils.maps.TBaseMap.InternalGetData,AData">
<short>Data for the map item.</short>
</element>
<element name="TMapIterator.GetID">
<short>Gets the ID for a map item.</short>
<descr/>
<seealso>
<link id="TBaseMap.InternalGetID"/>
</seealso>
</element>
<element name="TMapIterator.GetID.AID" link="#lazutils.maps.TBaseMap.InternalGetID.AID">
<short/>
</element>
<element name="TMapIterator.Locate">
<short>Locates a map item with the specified ID.</short>
<descr/>
<seealso>
<link id="TBaseMapIterator.InternalLocate"/>
</seealso>
</element>
<element name="TMapIterator.Locate.Result" link="#lazutils.maps.TBaseMapIterator.InternalLocate.Result">
<short/>
</element>
<element name="TMapIterator.Locate.AId" link="#lazutils.maps.TBaseMapIterator.InternalLocate.AId">
<short/>
</element>
<element name="TMapIterator.SetData">
<short>Sets the Data for a map item.</short>
<descr/>
<seealso>
<link id="TBaseMap.InternalSetData"/>
</seealso>
</element>
<element name="TMapIterator.SetData.AData" link="#lazutils.maps.TBaseMap.InternalSetData.AData">
<short/>
</element>
<element name="TLockedMapIterator">
<short>
Implements a map iterator with thread-safe locking in the associated map.
</short>
<descr>
<p>
<var>TLockedMapIterator</var> is a <var>TMapIterator</var> descendant which
allows iteration of a map in multiple threads. The associated map will be
locked prior to adding or removing entries.
</p>
</descr>
<seealso/>
</element>
<element name="TLockedMapIterator.AddToMap">
<short/>
<descr/>
<seealso/>
</element>
<element name="TLockedMapIterator.RemoveFromMap">
<short/>
<descr/>
<seealso/>
</element>
<element name="TTypedMap">
<short>
Implements a map with support for reference counted Type Information in the
Data.
</short>
<descr>
<p>
TTypedMap is a TBaseMap map descendant that implements a map with support for
reference counted Type Information in the Data for map items.
</p>
</descr>
<seealso>
<link id="TBaseMap"/>
</seealso>
</element>
<element name="TTypedMap.FTypeInfo"/>
<element name="TTypedMap.InternalSetData" link="#lazutils.maps.TBaseMap.InternalSetData">
<short/>
<descr/>
</element>
<element name="TTypedMap.InternalSetData.Result">
<short/>
</element>
<element name="TTypedMap.InternalSetData.AItem">
<short/>
</element>
<element name="TTypedMap.InternalSetData.AData">
<short/>
</element>
<element name="TTypedMap.ReleaseData" link="#lazutils.maps.TBaseMap.ReleaseData">
<short/>
<descr/>
</element>
<element name="TTypedMap.ReleaseData.ADataPtr">
<short/>
</element>
<element name="TTypedMap.Add" link="#lazutils.maps.TMap.Add">
<short/>
<descr/>
</element>
<element name="TTypedMap.Add.AId">
<short/>
</element>
<element name="TTypedMap.Add.AData">
<short/>
</element>
<element name="TTypedMap.Create">
<short>Constructor for the class instance.</short>
<descr/>
</element>
<element name="TTypedMap.Create.AIdType">
<short/>
</element>
<element name="TTypedMap.Create.ATypeInfo">
<short/>
</element>
<element name="TTypedMap.Destroy" link="#lazutils.maps.TBaseMap.Destroy">
<short>Destructor for the class instance.</short>
<descr/>
</element>
<element name="TTypedMap.HasId" link="#lazutils.maps.TMap.HasId">
<short/>
<descr/>
</element>
<element name="TTypedMap.HasId.Result">
<short/>
</element>
<element name="TTypedMap.HasId.AID">
<short/>
</element>
<element name="TTypedMap.GetData" link="#lazutils.maps.TMap.GetData">
<short>Gets the Data for the specified map item.</short>
<descr/>
</element>
<element name="TTypedMap.GetData.Result">
<short/>
</element>
<element name="TTypedMap.GetData.AId">
<short/>
</element>
<element name="TTypedMap.GetData.AData">
<short/>
</element>
<element name="TTypedMap.GetDataPtr" link="#lazutils.maps.TMap.GetDataPtr">
<short>Gets a Pointer to the Data for the specified map item.</short>
<descr/>
</element>
<element name="TTypedMap.GetDataPtr.Result">
<short/>
</element>
<element name="TTypedMap.GetDataPtr.AId">
<short/>
</element>
<element name="TTypedMap.SetData" link="#lazutils.maps.TMap.SetData">
<short>Stores the Data for the specified map item.</short>
<descr/>
</element>
<element name="TTypedMap.SetData.Result">
<short/>
</element>
<element name="TTypedMap.SetData.AId">
<short/>
</element>
<element name="TTypedMap.SetData.AData">
<short/>
</element>
<element name="TTypedMapIterator">
<short>Implements an iterator for items in a map.</short>
<descr>
<p>
<var>TTypedMapIterator</var> is a <var>TMapIterator</var> descendant that
implements an iterator for map items with reference counted Type Information
in their Data. TTypedMapIterator provides methods to initialize the iterator
for a map. It also provides methods to read the IDs for map items, and to
read and write the Data in map items. TTypedMapIterator also provides an
implementation of the Locate method.
</p>
</descr>
<seealso>
<link id="TMapIterator"/>
</seealso>
</element>
<element name="TTypedMapIterator.Create">
<short>Constructor for the class instance.</short>
<descr/>
</element>
<element name="TTypedMapIterator.Create.AMap">
<short/>
</element>
<element name="TTypedMapIterator.GetData">
<short>Gets the Data for the map item.</short>
<descr/>
</element>
<element name="TTypedMapIterator.GetData.AData">
<short/>
</element>
<element name="TTypedMapIterator.GetID">
<short>Gets the ID for the map item.</short>
<descr/>
</element>
<element name="TTypedMapIterator.GetID.AID">
<short/>
</element>
<element name="TTypedMapIterator.Locate">
<short>Locates a map item with the specified ID.</short>
<descr/>
</element>
<element name="TTypedMapIterator.Locate.Result">
<short/>
</element>
<element name="TTypedMapIterator.Locate.AId">
<short/>
</element>
<element name="TTypedMapIterator.SetData">
<short>Stores the Data for the map item.</short>
<descr/>
</element>
<element name="TTypedMapIterator.SetData.AData">
<short/>
</element>
<!-- function Visibility: default -->
<element name="MapReport">
<short>Gets information about the AVL Tree in the specified map.</short>
<descr>
<p>
MapReport is a String function used to get information about the AVL Tree in
the specified map. The return value contains information about the order of
nodes in the AVL Tree, and the pointers used in the structure. It is intended
for use as a diagnostic tool.
</p>
</descr>
</element>
<element name="MapReport.Result">
<short>String with the multi-line information about the AVL Tree.</short>
</element>
<element name="MapReport.AMap">
<short>Map class to examine in the routine.</short>
</element>
</module>
<!-- Maps -->
</package>
</fpdoc-descriptions>
|