[Overview][Constants][Types][Classes][Procedures and functions][Index] |
[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
Implements the base class for a map for unique IDs to arbitrary data.
Source position: maps.pp line 94
type TBaseMap = class(TPersistent) |
||
protected |
||
procedure LockMap; |
|
Locks the Map when an iterator is added. |
procedure UnLockMap; |
|
Unlocks the Map when an iterator is removed. |
procedure InternalAdd(); |
|
Adds a map item with the specified ID and Data to the AVL Tree. |
function InternalGetData(); |
|
Gets the data stored in the specified map item. |
function InternalGetDataPtr(); |
|
Gets a Pointer to the data for the specified map item. |
function InternalGetId(); |
|
Get the ID value for the specified map item. |
function InternalSetData(); |
|
Stores the data for the specified map item. |
procedure ReleaseData(); virtual; |
|
Frees resources allocated for the data in the map item. |
public |
||
constructor Create(); |
|
Constructor for the class instance. |
procedure Clear; |
|
Clears all map items in the AVL Tree. |
function Count; |
|
Gets the number of map items in the AVL Tree. |
function Delete(); |
|
Deletes the specified map item from the AVL Tree. |
destructor Destroy; override; |
|
Destructor for the class instance. |
end; |
|
Implements the base class for a map for unique IDs to arbitrary data. |
|
| | ||
| | ||
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.
Use a descendant class, such as TMap, which includes methods to Add items and to read or write their arbitrary data values.
Author: Marc Weustink
Version 3.2 | Generated 2024-02-25 | Home |