Return to Unit Reference
Description
Ultibo classes unit
To be documented
Constants
[Expand]
Error constants *_Error
SListIndexError = 'List index out of bounds (%d)';
|
|
SFCreateError = 'Cannot create file %s';
|
|
SFOpenError = 'Cannot open file %s';
|
|
[Expand]
B-Tree constants btree_*
btreeCompareLess = -1;
|
|
btreeCompareEqual = 0;
|
|
btreeCompareGreater = 1;
|
|
[Expand]
Hash constants *_Hash*
stringHashSize = 8;
|
|
|
listHashBits = 8;
|
|
treeHashBits = 3;
|
|
|
keyHashMinBits = 1;
|
|
keyHashMaxBits = 16;
|
Maximum of 16 bit hash mask (65535 buckets) due to memory usage
|
keyHashMasks:array[keyHashMinBits..keyHashMaxBits] of LongWord = (
|
|
$00000001,$00000003,$00000007,$0000000F,
|
|
$0000001F,$0000003F,$0000007F,$000000FF,
|
|
$000001FF,$000003FF,$000007FF,$00000FFF,
|
|
$00001FFF,$00003FFF,$00007FFF,$0000FFFF);
|
|
[Expand]
Delta constants *_Delta
memoryStreamDelta = $2000;
|
|
memoryStreamShift = 13;
|
|
|
stringListDelta = $2000;
|
|
Type definitions
None defined
Class definitions
TThreadEx
[Expand]
TThreadEx = class(TThread)
Note: TThread with Before and After Execution methods
|
|
private
|
|
protected
|
procedure Execution; virtual;
|
|
procedure AfterExecution; virtual;
|
|
procedure BeforeExecution; virtual;
|
|
procedure Execute; override;
|
|
public
|
procedure TerminateAndWaitFor;
|
|
TTimerEx
[Expand]
TTimerEx = class(TObject)
Note: TTimer/TFPTimer equivalent for Ultibo specific timers
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
FInterval:Integer;
|
|
FEnabled:Boolean;
|
|
FWorker:Boolean;
|
If True then use a Worker thread for the timer event
|
FOnTimer:TNotifyEvent;
|
|
FTimerHandle:TTimerHandle;
|
|
|
procedure SetEnabled(Value:Boolean);
|
|
protected
|
procedure Timer; virtual;
|
|
procedure StartTimer; virtual;
|
|
procedure StopTimer; virtual;
|
|
public
|
property Interval:Integer read FInterval write FInterval;
|
|
property Enabled:Boolean read FEnabled write SetEnabled;
|
|
property Worker:Boolean read FWorker write FWorker;
|
|
|
property OnTimer:TNotifyEvent read FOnTimer write FOnTimer;
|
|
TObjList
[Expand]
TObjList = class(TList)
Note: TList with Auto Free of List Objects
List which Frees all nodes on Destroy
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
procedure DestroyListObjects;
|
|
public
|
procedure ClearList;
|
|
TThreadObjList
[Expand]
TThreadObjList = class(TThreadList)
Note: TThreadList with Auto Free of List Objects
Thread Safe List which Frees all nodes on Destroy
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
procedure DestroyListObjects;
|
|
public
|
procedure ClearList;
|
|
TListObject
[Expand]
TListObject = class(TObject)
Note: A TObject with .Prev/.Next with Properties for use in Lists
|
|
private
|
FPrev:TListObject;
|
|
FNext:TListObject;
|
|
public
|
property Prev:TListObject read FPrev write FPrev;
|
|
property Next:TListObject read FNext write FNext;
|
|
TLinkedList
[Expand]
TLinkedList = class(TObject)
Note: A List of TListObjects with automatic .Prev/.Next Links
Linked List which does not Free nodes on Destroy
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
FCount:Integer;
|
|
FFirst:TListObject;
|
|
FLast:TListObject;
|
|
function GetCount:Integer;
|
|
function Link(AValue:TListObject):Boolean;
|
|
function LinkEx(APrev,AValue:TListObject):Boolean;
|
|
function Unlink(AValue:TListObject):Boolean;
|
|
public
|
property Count:Integer read GetCount;
|
|
property First:TListObject read FFirst;
|
|
property Last:TListObject read FLast;
|
|
function Add(AValue:TListObject):Boolean; virtual;
|
|
function Remove(AValue:TListObject):Boolean; virtual;
|
|
function Insert(APrev,AValue:TListObject):Boolean; virtual;
|
|
procedure Clear; virtual;
|
|
TLinkedObjList
[Expand]
TLinkedObjList = class(TLinkedList)
Note: TLinkedList with Auto Free of List Objects
Linked List which Frees all nodes on Destroy
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
|
public
|
procedure ClearList;
|
|
TThreadLinkedObjList
[Expand]
TThreadLinkedObjList = class(TLinkedList)
Note: TLinkedList with Auto Free of List Objects
Thread Safe Linked List which Frees all nodes on Destroy
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
FLock:TRTLCriticalSection;
|
|
public
|
procedure ClearList;
|
|
|
procedure LockList;
|
|
procedure UnlockList;
|
|
TTreeObject
[Expand]
TTreeObject = class(TListObject)
Note: A TObject with Prev/Next/Parent/FirstChild for use in Trees
|
|
private
|
FParent:TTreeObject;
|
|
FFirstChild:TTreeObject;
|
|
FLastChild:TTreeObject;
|
|
public
|
property Parent:TTreeObject read FParent write FParent;
|
|
property FirstChild:TTreeObject read FFirstChild write FFirstChild;
|
|
property LastChild:TTreeObject read FLastChild write FLastChild;
|
|
TLinkedTree
[Expand]
TLinkedTree = class(TObject)
Note: A Tree of TTreeObjects with automatic Prev/Next etc Links
Linked Tree which does not Free nodes on Destroy
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
FCount:Integer;
|
|
FFirst:TTreeObject;
|
|
FLast:TTreeObject;
|
|
function GetCount:Integer;
|
|
function Link(AValue,AParent:TTreeObject):Boolean;
|
|
function LinkEx(APrev,AValue,AParent:TTreeObject):Boolean;
|
|
function Unlink(AValue:TTreeObject):Boolean;
|
|
public
|
property Count:Integer read GetCount;
|
|
property Root:TTreeObject read FFirst;
|
|
property First:TTreeObject read FFirst;
|
|
property Last:TTreeObject read FLast;
|
|
function Add(AValue,AParent:TTreeObject):Boolean; virtual;
|
|
function Remove(AValue:TTreeObject):Boolean; virtual;
|
|
function Insert(APrev,AValue,AParent:TTreeObject):Boolean; virtual;
|
|
procedure Move(AValue,AParent:TTreeObject); virtual;
|
|
procedure Clear; virtual;
|
|
function FirstChild(AParent:TTreeObject):TTreeObject;
|
|
function LastChild(AParent:TTreeObject):TTreeObject;
|
|
TLinkedObjTree
[Expand]
TLinkedObjTree = class(TLinkedTree)
Note: TLinkedTree with Auto Free of Tree Objects
Linked Tree which Frees all nodes on Destroy
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
|
protected
|
procedure ClearListItems(AParent:TTreeObject);
|
|
public
|
procedure ClearList;
|
|
TBtreeObject
[Expand]
TBtreeObject = class(TObject)
Note: A TObject with Left/Right/Parent for use in B-Trees
|
|
private
|
FBlank:Boolean;
|
Object is the blank key (1 per node)
|
|
FPrev:TBtreeObject;
|
Prev object in Linked List (Sorted)
|
FNext:TBtreeObject;
|
Next object in Linked List (Sorted)
|
|
FLeft:TBtreeObject;
|
Left sibling in B-Tree (Lower)
|
FRight:TBtreeObject;
|
Right sibling in B-Tree (Higher)
|
|
FChild:TBtreeObject;
|
Child object in B-Tree (Lower)
|
FParent:TBtreeObject;
|
Parent object in B-Tree (Higher)
|
public
|
property Blank:Boolean read FBlank write FBlank;
|
|
|
property Prev:TBtreeObject read FPrev write FPrev;
|
|
property Next:TBtreeObject read FNext write FNext;
|
|
|
property Left:TBtreeObject read FLeft write FLeft;
|
|
property Right:TBtreeObject read FRight write FRight;
|
|
|
property Child:TBtreeObject read FChild write FChild;
|
|
property Parent:TBtreeObject read FParent write FParent;
|
|
|
procedure Clear;
|
|
TLinkedBtree
[Expand]
TLinkedBtree = class(TObject)
Note: A B-Tree of TBtreeObjects with automatic Left/Right etc Links
Linked B-Tree which does not Free nodes on Destroy
|
|
Note: Search/Find should be implemented by descendants. Compare must always be implemented by descendants. Blank keys are not included in the linked list. Blank key always compares as higher than anything. Linked list allows easy traversal in either direction. Also allows implementation of the rebalance function.
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
procedure SetOrder(AOrder:LongWord);
|
|
|
function PropogateDrop(AEntry:TBtreeObject):Boolean;
|
|
function PropogateDropOld(AEntry:TBtreeObject):Boolean;
|
|
function PropogateDropOldOld(AEntry:TBtreeObject):Boolean;
|
|
function PropogateMerge(AEntry:TBtreeObject):Boolean;
|
|
function PropogateSplit(AEntry:TBtreeObject):Boolean;
|
|
protected
|
FOrder:LongWord;
|
Order N of B-Tree (N - 1 Keys per Node)
|
FMedian:LongWord;
|
Ceil(N / 2) (Median - 1 Keys as Minimum)
|
|
FSwapLeft:Boolean;
|
If True then Remove will Swap with Left not Right
|
|
FRoot:TBtreeObject;
|
Root Node of B-Tree
|
FFirst:TBtreeObject;
|
First object in Linked List (Sorted)
|
FLast:TBtreeObject;
|
Last object in Linked List (Sorted)
|
FFirstBlank:TBtreeObject;
|
First blank key in Linked List (Not Sorted)
|
FLastBlank:TBtreeObject;
|
Last blank key in Linked List (Not Sorted)
|
|
function GetCount(AEntry:TBtreeObject):LongWord; virtual;
|
|
function GetDepth(AEntry:TBtreeObject):LongWord; virtual;
|
|
|
function GetEnd(AEntry:TBtreeObject):TBtreeObject; virtual;
|
|
function GetStart(AEntry:TBtreeObject):TBtreeObject; virtual;
|
|
function GetBlank(AEntry:TBtreeObject):TBtreeObject; virtual;
|
|
function GetMedian(AEntry:TBtreeObject):TBtreeObject; virtual;
|
|
|
function GetDrop(AEntry:TBtreeObject; var ALeft:Boolean):TBtreeObject; virtual;
|
|
function GetMerge(AEntry:TBtreeObject):TBtreeObject; virtual;
|
|
function GetBorrow(AEntry:TBtreeObject):TBtreeObject; virtual;
|
|
function GetTarget(ADrop:TBtreeObject; ALeft:Boolean):TBtreeObject; virtual;
|
|
|
function SetParent(AEntry,AParent:TBtreeObject):Boolean;
|
|
|
function GetLefthand(AEntry:TBtreeObject):TBtreeObject;
|
|
function GetRighthand(AEntry:TBtreeObject):TBtreeObject;
|
|
|
function GetLeftmost(AEntry:TBtreeObject):TBtreeObject;
|
|
function GetRightmost(AEntry:TBtreeObject):TBtreeObject;
|
|
|
function GetSuccessor(AEntry:TBtreeObject):TBtreeObject;
|
|
function GetPredecessor(AEntry:TBtreeObject):TBtreeObject;
|
|
|
function GetPosition(AStart,AEntry:TBtreeObject):TBtreeObject;
|
|
|
function Push(AEntry:TBtreeObject):Boolean;
|
|
function Split(AEntry:TBtreeObject):Boolean;
|
|
function Swap(AEntry,ASwap:TBtreeObject; ALeft:Boolean):Boolean;
|
|
function Drop(AEntry,ADrop,ATarget:TBtreeObject; ALeft:Boolean):Boolean;
|
|
function DropOld(AEntry,ADrop:TBtreeObject; ALeft:Boolean):Boolean;
|
|
function DropOldOld(AEntry,ADrop:TBtreeObject; ALeft:Boolean):Boolean;
|
|
function DropOldOldOld(AEntry,ADrop:TBtreeObject; ALeft:Boolean):Boolean;
|
|
function Merge(AEntry,AMerge:TBtreeObject):Boolean;
|
|
function Borrow(AEntry,ABorrow:TBtreeObject):Boolean;
|
|
|
function Link(AEntry,ANext:TBtreeObject):Boolean;
|
|
function Unlink(AEntry:TBtreeObject):Boolean;
|
|
|
function LinkBlank(AEntry:TBtreeObject):Boolean;
|
|
function UnlinkBlank(AEntry:TBtreeObject):Boolean;
|
|
|
function Attach(AParent,AEntry,ARight:TBtreeObject):Boolean;
|
|
function Detach(AEntry:TBtreeObject):Boolean;
|
|
|
function PushNode(AEntry:TBtreeObject):Boolean; virtual;
|
Allows descendants to monitor node pus
|
function SplitNode(AEntry:TBtreeObject):Boolean; virtual;
|
Allows descendants to monitor node split
|
function DropNode(AEntry,ADrop,ATarget:TBtreeObject; ALeft:Boolean):Boolean; virtual;
|
Allows descendants to monitor node drop
|
function DropNodeOld(AEntry,ADrop:TBtreeObject; ALeft:Boolean):Boolean; virtual;
|
Allows descendants to monitor node drop
|
function MergeNode(AEntry,AMerge:TBtreeObject):Boolean; virtual;
|
Allows descendants to monitor node merge
|
function BorrowEntry(AEntry,ABorrow:TBtreeObject):Boolean; virtual;
|
Allows descendants to monitor entry borrow
|
|
function SwapEntry(AEntry,ASwap:TBtreeObject;ALeft:Boolean):Boolean; virtual;
|
Allows descendants to monitor entry swap
|
function SetParentEntry(AEntry,AParent:TBtreeObject):Boolean; virtual;
|
Allows descendants to monitor entry parent
|
|
function CreateBlank:TBtreeObject; virtual;
|
Allows descendants to monitor node creation
|
function DeleteBlank(ABlank:TBtreeObject):Boolean; virtual;
|
Allows descendants to monitor node deletion
|
|
function AttachBlank(ABlank:TBtreeObject):Boolean; virtual;
|
Allows descendants to monitor node modification
|
function DetachBlank(ABlank:TBtreeObject):Boolean; virtual;
|
Allows descendants to monitor node modification
|
|
function AttachEntry(AEntry:TBtreeObject):Boolean; virtual;
|
Allows descendants to monitor node modification
|
function DetachEntry(AEntry:TBtreeObject):Boolean; virtual;
|
Allows descendants to monitor node modification
|
|
function RequirePush(AEntry:TBtreeObject):Boolean; virtual;
|
Allows descendants to modify balancing behaviour
|
function RequireSplit(AEntry:TBtreeObject):Boolean; virtual;
|
Allows descendants to modify balancing behaviour
|
function RequireDrop(AEntry:TBtreeObject):Boolean; virtual;
|
Allows descendants to modify balancing behaviour
|
function RequireMerge(AEntry:TBtreeObject):Boolean; virtual;
|
Allows descendants to modify balancing behaviour
|
function RequireBorrow(AEntry:TBtreeObject):Boolean; virtual;
|
Allows descendants to modify balancing behaviour
|
|
function Compare(AEntry1,AEntry2:TBtreeObject):Integer; virtual;
|
|
public
|
property Order:LongWord read FOrder write SetOrder;
|
|
property Median:LongWord read FMedian;
|
|
|
property SwapLeft:Boolean read FSwapLeft;
|
|
|
property Root:TBtreeObject read FRoot;
|
|
property First:TBtreeObject read FFirst;
|
|
property Last:TBtreeObject read FLast;
|
|
|
function Add(AParent,AEntry:TBtreeObject):Boolean;
|
|
|
function Insert(AEntry:TBtreeObject):Boolean;
|
|
function Remove(AEntry:TBtreeObject):Boolean;
|
|
function RemoveOld(AEntry:TBtreeObject):Boolean;
|
|
function RemoveOldOld(AEntry:TBtreeObject):Boolean;
|
|
|
procedure Clear;
|
|
procedure Empty;
|
|
procedure Rebuild;
|
|
TLinkedObjBtree
[Expand]
TLinkedObjBtree = class(TLinkedBtree)
Note: TLinkedBtree with Auto Free of B-Tree Objects
Linked B-Tree which Frees all nodes on Destroy
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
|
public
|
procedure ClearBtree;
|
|
procedure EmptyBtree;
|
|
THashListObject
[Expand]
THashListObject = class(TListObject)
Note: A TObject with KeyPrev/KeyNext/KeyHash for use in HashLists
|
|
private
|
FKeyPrev:THashListObject;
|
|
FKeyNext:THashListObject;
|
|
protected
|
FKeyHash:LongWord;
|
Publish in descendants if required
|
|
procedure SetKeyHash(AKeyHash:LongWord);
|
|
public
|
property KeyList:THashLinkedList read FKeyList write FKeyList;
|
|
property KeyPrev:THashListObject read FKeyPrev write FKeyPrev;
|
|
property KeyNext:THashListObject read FKeyNext write FKeyNext;
|
|
THashLinkedList
[Expand]
THashLinkedList = class(TLinkedList)
Note: A List of THashListObjects with automatic hash buckets
|
|
constructor Create(AKeyBits:Byte);
|
|
destructor Destroy; override;
|
|
private
|
FKeyBits:Byte;
|
|
FKeyMask:LongWord;
|
|
FKeyBuckets:Pointer;
|
|
function KeyLink(AValue:THashListObject):Boolean;
|
|
function KeyUnlink(AValue:THashListObject):Boolean;
|
|
public
|
function KeyFirst(AKeyHash:LongWord):THashListObject;
|
|
|
function Add(AValue:TListObject):Boolean; override;
|
|
function Remove(AValue:TListObject):Boolean; override;
|
|
function Insert(APrev,AValue:TListObject):Boolean; override;
|
|
procedure Clear; override;
|
|
THashLinkedObjList
[Expand]
THashLinkedObjList = class(THashLinkedList)
Note: THashLinkedList with Auto Free of List Objects
|
|
constructor Create(AKeyBits:Byte);
|
|
destructor Destroy; override;
|
|
private
|
|
public
|
procedure ClearList;
|
|
THashTreeObject
[Expand]
THashTreeObject = class(TTreeObject)
Note: A TObject with KeyPrev/KeyNext/KeyHash for use in HashTrees
|
|
constructor Create(AKeyBits:Byte);
|
|
destructor Destroy; override;
|
|
private
|
FKeyBits:Byte;
|
|
FKeyMask:LongWord;
|
|
FKeyBuckets:Pointer;
|
|
FKeyTree:THashLinkedTree;
|
|
FKeyPrev:THashTreeObject;
|
|
FKeyNext:THashTreeObject;
|
|
protected
|
FKeyHash:LongWord; {Publish in descendants if required}
|
|
procedure SetKeyHash(AKeyHash:LongWord);
|
|
function KeyLink(AValue:THashTreeObject):Boolean;
|
|
function KeyUnlink(AValue:THashTreeObject):Boolean;
|
|
public
|
function KeyFirst(AKeyHash:LongWord):THashTreeObject;
|
|
|
property KeyTree:THashLinkedTree read FKeyTree write FKeyTree;
|
|
property KeyPrev:THashTreeObject read FKeyPrev write FKeyPrev;
|
|
property KeyNext:THashTreeObject read FKeyNext write FKeyNext;
|
|
THashLinkedTree
[Expand]
THashLinkedTree = class(TLinkedTree)
Note: A Tree of THashTreeObjects with automatic hash buckets
|
|
constructor Create(AKeyBits:Byte);
|
|
destructor Destroy; override;
|
|
private
|
FKeyBits:Byte;
|
|
FKeyMask:LongWord;
|
|
FKeyBuckets:Pointer;
|
|
function KeyLink(AValue,AParent:THashTreeObject):Boolean;
|
|
function KeyUnlink(AValue,AParent:THashTreeObject):Boolean;
|
|
public
|
function KeyFirst(AParent:THashTreeObject; AKeyHash:LongWord):THashTreeObject;
|
|
|
function Add(AValue,AParent:TTreeObject):Boolean; override;
|
|
function Remove(AValue:TTreeObject):Boolean; override;
|
|
function Insert(APrev,AValue,AParent:TTreeObject):Boolean; override;
|
|
procedure Move(AValue,AParent:TTreeObject); override;
|
|
procedure Clear; override;
|
|
THashLinkedObjTree
[Expand]
THashLinkedObjTree = class(THashLinkedTree)
Note: THashLinkedTree with Auto Free of List Objects
|
|
constructor Create(AKeyBits:Byte);
|
|
destructor Destroy; override;
|
|
private
|
procedure ClearListItems(AParent:THashTreeObject);
|
|
public
|
procedure ClearList;
|
|
TStringObject
[Expand]
TStringObject = class(TListObject)
Note: A TObject with Prev/Next/Value/Hash for use in StringLists
|
|
private
|
FValue:String;
|
|
FData:TObject;
|
|
protected
|
FHash:LongWord;
|
|
|
procedure SetValue(const AValue:String); virtual;
|
|
public
|
property Value:String read FValue write SetValue;
|
|
property Data:TObject read FData write FData;
|
|
property Hash:LongWord read FHash;
|
|
TLinkedStringList
[Expand]
TLinkedStringList = class(TStrings)
Note: A List of TStringObjects with automatic Prev/Next Links
Mostly identical methods to TStringList with addition of First/Last/Next/Prev
|
|
Note: Currently does not implement Sorting or Duplicate handling
|
|
constructor Create;
|
|
public (Public destructor for FPC RTL)
|
destructor Destroy; override;
|
|
private
|
FCount:Integer;
|
|
FFirst:TStringObject;
|
|
FLast:TStringObject;
|
|
FSorted:Boolean;
|
|
FUpdating:Boolean;
|
|
FDuplicates:TDuplicates;
|
|
FOnChange:TNotifyEvent;
|
|
FOnChanging:TNotifyEvent;
|
|
procedure QuickSort(L,R:Integer);
|
|
procedure SetSorted(Value:Boolean);
|
|
|
function GetItem(AIndex:Integer):TStringObject;
|
|
|
function Link(AValue:TStringObject):Boolean;
|
|
function LinkEx(APrev,AValue:TStringObject):Boolean;
|
|
function Unlink(AValue:TStringObject):Boolean;
|
|
protected
|
procedure ClearList; virtual;
|
|
|
procedure Changed; virtual;
|
|
procedure Changing; virtual;
|
|
function Get(Index:Integer):String; override;
|
|
function GetCount:Integer; override;
|
|
function GetObject(Index:Integer):TObject; override;
|
|
procedure Put(Index:Integer; const S:String); override;
|
|
procedure PutObject(Index:Integer; AObject:TObject); override;
|
|
procedure SetUpdateState(Updating:Boolean); override;
|
|
public
|
function Add(const S:String):Integer; override;
|
|
procedure Clear; override;
|
|
procedure Delete(Index:Integer); override;
|
|
procedure Exchange(Index1,Index2:Integer); override;
|
|
function Find(const S:String; var Index:Integer):Boolean; virtual;
|
|
function IndexOf(const S:String):Integer; override;
|
|
procedure Insert(Index:Integer; const S:String); override;
|
|
procedure Sort; virtual;
|
|
property First:TStringObject read FFirst;
|
|
property Last:TStringObject read FLast;
|
|
property Duplicates:TDuplicates read FDuplicates write FDuplicates;
|
|
property Sorted:Boolean read FSorted write SetSorted;
|
|
property OnChange:TNotifyEvent read FOnChange write FOnChange;
|
|
property OnChanging:TNotifyEvent read FOnChanging write FOnChanging;
|
|
TStringBlock
[Expand]
TStringBlock = class(TListObject)
Note: Block object for TLinkedStringListEx
|
|
destructor Destroy; override;
|
|
private
|
|
public
|
Data:Pointer;
|
Pointer to Allocated Memory Block
|
Size:LongWord;
|
Size of Allocated Memory Block
|
Start:LongWord;
|
Index of First Item in this Block
|
Count:LongWord;
|
Current Items in this Block
|
Capacity:LongWord;
|
Total Capacity of this Block
|
TStringObjectEx
[Expand]
TStringObjectEx = class(TStringObject)
Note: A TStringObject for use with StringListEx
|
|
private
|
FBlock:TStringBlock;
|
|
public
|
property Block:TStringBlock read FBlock write FBlock;
|
|
TLinkedStringListEx
[Expand]
TLinkedStringListEx = class(TLinkedStringList)
Note: A TLinkedStringList with block list for entry Indexing
|
|
constructor Create;
|
|
public (Public destructor for FPC RTL)
|
destructor Destroy; override;
|
|
private
|
FRecent:TStringBlock;
|
|
FBlocks:TLinkedObjList;
|
|
|
FCapacity:Integer;
|
|
|
function GetBlock(Index:Integer):TStringBlock;
|
|
function AddBlock(Block:TStringBlock; Index:Integer):TStringBlock;
|
|
function DeleteBlock(Block:TStringBlock):Boolean;
|
|
function UpdateBlocks(Block:TStringBlock):Boolean;
|
|
|
function GetItem(Block:TStringBlock; Index:Integer):TStringObjectEx;
|
|
function AddItem(Block:TStringBlock; Index:Integer; Item:TStringObjectEx):Boolean;
|
|
function DeleteItem(Block:TStringBlock; Index:Integer; Item:TStringObjectEx):Boolean;
|
|
|
function IndexOfItem(Block:TStringBlock; Item:TStringObjectEx):Integer;
|
|
protected
|
function Get(Index:Integer):String; override;
|
|
function GetCapacity:Integer; override;
|
|
function GetObject(Index:Integer):TObject; override;
|
|
procedure Put(Index:Integer; const S:String); override;
|
|
procedure PutObject(Index:Integer; AObject:TObject); override;
|
|
public
|
function Add(const S:String):Integer; override;
|
|
procedure Clear; override;
|
|
procedure Delete(Index:Integer); override;
|
|
procedure Exchange(Index1,Index2:Integer); override;
|
|
function IndexOf(const S:String):Integer; override;
|
|
procedure Insert(Index:Integer; const S:String); override;
|
|
THashStringObject
[Expand]
THashStringObject = class(TStringObjectEx)
Note: A TObject with Prev/Next/Hash for use in HashStringLists
|
|
private
|
FList:THashLinkedStringList;
|
|
FKeyPrev:THashStringObject;
|
|
FKeyNext:THashStringObject;
|
|
|
procedure SetHash(AHash:LongWord);
|
|
protected
|
procedure SetValue(const AValue:String); override;
|
|
public
|
property List:THashLinkedStringList read FList write FList;
|
|
property KeyPrev:THashStringObject read FKeyPrev write FKeyPrev;
|
|
property KeyNext:THashStringObject read FKeyNext write FKeyNext;
|
|
THashLinkedStringList
[Expand]
THashLinkedStringList = class(TLinkedStringListEx)
Note: A List of TStringObjects with automatic hash buckets
|
|
constructor Create(AKeyBits:Byte);
|
|
public (Public destructor for FPC RTL)
|
destructor Destroy; override;
|
|
private
|
FKeyBits:Byte;
|
|
FKeyMask:LongWord;
|
|
FKeyBuckets:Pointer;
|
|
function KeyLink(AValue:THashStringObject):Boolean;
|
|
function KeyUnlink(AValue:THashStringObject):Boolean;
|
|
protected
|
procedure ClearList; override;
|
|
public
|
function KeyFirst(AKeyHash:LongWord):THashStringObject;
|
|
|
function Add(const S:String):Integer; override;
|
|
procedure Delete(Index:Integer); override;
|
|
function IndexOf(const S:String):Integer; override;
|
|
procedure Insert(Index:Integer; const S:String); override;
|
|
TIntegerList
[Expand]
TIntegerList = class(TObject)
Note: Same as a TStringList but for Integer values
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
FItems:TList;
|
|
function GetItem(Idx:Integer):Integer;
|
|
procedure SetItem(Idx,Value:Integer);
|
|
function GetCount:Integer;
|
|
public
|
property Items[Idx:Integer]:Integer read GetItem write SetItem;
|
|
property Count:Integer read GetCount;
|
|
function Add(AValue:Integer):Integer;
|
|
function Remove(AValue:Integer):Integer;
|
|
procedure Delete(Idx:Integer);
|
|
function IndexOf(AValue:Integer):Integer;
|
|
procedure Clear;
|
|
TDateTimeList
[Expand]
TDateTimeList = class(TObject)
Note: Same as a TStringList but for TDateTime values
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
FItems:TList;
|
|
function GetItem(Idx:Integer):TdateTime;
|
|
procedure SetItem(Idx:Integer; Value:TDateTime);
|
|
function GetCount:Integer;
|
|
public
|
property Items[Idx:Integer]:TDateTime read GetItem write SetItem;
|
|
property Count:Integer read GetCount;
|
|
function Add(AValue:TDateTime):Integer;
|
|
function Remove(AValue:TDateTime):Integer;
|
|
procedure Delete(Idx:Integer);
|
|
function IndexOf(AValue:TDateTime):Integer;
|
|
procedure Clear;
|
|
TMemoryBlock
[Expand]
TMemoryBlock = class(TListObject)
Note: Block object for TMemoryStreamEx
|
|
destructor Destroy; override;
|
|
private
|
|
public
|
Memory:Pointer;
|
Pointer to Allocated Memory Block
|
Size:LongWord;
|
Size of Allocated Memory Block
|
Start:LongWord;
|
Start of Allocated Memory Block in the Stream
|
TMemoryStreamEx
[Expand]
TMemoryStreamEx = class(TStream)
Note: A memory stream which does not Realloc on expand
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
private
|
FRecent:TMemoryBlock;
|
|
FBlocks:TLinkedObjList;
|
|
|
FSize:LongInt;
|
|
FPosition:LongInt;
|
|
FCapacity:LongWord;
|
|
|
function RoundSize(ASize:LongInt):LongWord;
|
|
function GetBlock(AOffset:LongWord):TMemoryBlock;
|
|
function ReadBlock(ABlock:TMemoryBlock; ABuffer:Pointer; AOffset,ACount:LongWord):LongWord;
|
|
function WriteBlock(ABlock:TMemoryBlock; ABuffer:Pointer; AOffset,ACount:LongWord):LongWord;
|
|
|
procedure SetCapacity(ACapacity:LongWord);
|
|
protected
|
procedure SetSize(ASize:LongInt); override;
|
|
public
|
function Read(var ABuffer; ACount:LongInt):LongInt; override;
|
|
function Write(const ABuffer; ACount:LongInt):LongInt; override;
|
|
function Seek(AOffset:LongInt; AOrigin:Word):LongInt; override;
|
|
procedure SaveToStream(AStream:TStream);
|
|
procedure LoadFromStream(AStream:TStream);
|
|
procedure SaveToFile(const AFileName:String);
|
|
procedure LoadFromFile(const AFileName:String);
|
|
procedure Clear;
|
|
TStreamEx
[Expand]
TStreamEx = class(TStream)
Note: A 64bit capable Stream class
|
|
private
|
function GetPositionEx:Int64;
|
|
procedure SetPositionEx(const Pos:Int64);
|
|
function GetSizeEx:Int64;
|
|
protected
|
procedure SetSizeEx(const NewSize:Int64); virtual;
|
|
public
|
property PositionEx:Int64 read GetPositionEx write SetPositionEx;
|
|
property SizeEx:Int64 read GetSizeEx write SetSizeEx;
|
|
function SeekEx(const Offset:Int64; Origin:Word):Int64; virtual; abstract;
|
|
THandleStreamEx
[Expand]
THandleStreamEx = class(TStreamEx)
Note: A 64bit capable Handle Stream class
|
|
constructor Create(AHandle:Integer);
|
|
private
|
FHandle:Integer;
|
|
protected
|
procedure SetSize(NewSize:LongInt); override;
|
|
procedure SetSizeEx(const NewSize:Int64); override;
|
|
public
|
function Read(var Buffer; Count:LongInt):LongInt; override;
|
|
function Write(const Buffer; Count:LongInt):LongInt; override;
|
|
function Seek(Offset:LongInt; Origin:Word):LongInt; override;
|
|
function SeekEx(const Offset:Int64; Origin:Word):Int64; override;
|
|
property Handle:Integer read FHandle;
|
|
TFileStreamEx
[Expand]
TFileStreamEx = class(THandleStreamEx)
Note: A 64bit capable File Stream class
|
|
constructor Create(const FileName:String;Mode:Word);
|
|
destructor Destroy; override;
|
|
private
|
|
public
|
|
TStringItemEx
[Expand]
TStringItemEx = class(TObject)
Note: A String item with Hash for use in TStringListEx
|
|
private
|
FValue:String;
|
|
FData:TObject;
|
|
FHash:LongWord;
|
|
protected
|
procedure SetValue(const AValue:String); virtual;
|
|
public
|
property Value:String read FValue write SetValue;
|
|
property Data:TObject read FData write FData;
|
|
property Hash:LongWord read FHash;
|
|
TStringListEx
[Expand]
TStringListEx = class(TStrings)
Note: A String List class that does not use realloc to grow
Mostly identical methods to TStringList with addition of block list
|
|
Note: Currently does not implement Sorting or Duplicate handling
|
|
constructor Create;
|
|
public (Public destructor for FPC RTL)
|
destructor Destroy; override;
|
|
private
|
FRecent:TStringBlock;
|
|
FBlocks:TLinkedObjList;
|
|
|
FCount:Integer;
|
|
FCapacity:Integer;
|
|
FSorted:Boolean;
|
|
FUpdating:Boolean;
|
|
FDuplicates:TDuplicates;
|
|
FOnChange:TNotifyEvent;
|
|
FOnChanging:TNotifyEvent;
|
|
procedure QuickSort(L,R:Integer);
|
|
procedure SetSorted(Value:Boolean);
|
|
|
function GetBlock(Index:Integer):TStringBlock;
|
|
function AddBlock(Block:TStringBlock; Index:Integer):TStringBlock;
|
|
function DeleteBlock(Block:TStringBlock):Boolean;
|
|
function UpdateBlocks(Block:TStringBlock):Boolean;
|
|
|
function GetItem(Block:TStringBlock; Index:Integer):TStringItemEx;
|
|
function AddItem(Block:TStringBlock; Index:Integer; Item:TStringItemEx):Boolean;
|
|
function DeleteItem(Block:TStringBlock; Index:Integer; Item:TStringItemEx):Boolean;
|
|
protected
|
procedure ClearList; virtual;
|
|
|
procedure Changed; virtual;
|
|
procedure Changing; virtual;
|
|
function Get(Index:Integer):String; override;
|
|
function GetCapacity:Integer; override;
|
|
function GetCount:Integer; override;
|
|
function GetObject(Index:Integer):TObject; override;
|
|
procedure Put(Index:Integer; const S:String); override;
|
|
procedure PutObject(Index:Integer; AObject:TObject); override;
|
|
procedure SetUpdateState(Updating:Boolean); override;
|
|
public
|
function Add(const S:String):Integer; override;
|
|
procedure Clear; override;
|
|
procedure Delete(Index:Integer); override;
|
|
procedure Exchange(Index1,Index2:Integer); override;
|
|
function Find(const S:String; var Index:Integer):Boolean; virtual;
|
|
function IndexOf(const S:String):Integer; override;
|
|
procedure Insert(Index:Integer; const S:String); override;
|
|
procedure Sort; virtual;
|
|
property Duplicates:TDuplicates read FDuplicates write FDuplicates;
|
|
property Sorted:Boolean read FSorted write SetSorted;
|
|
property OnChange:TNotifyEvent read FOnChange write FOnChange;
|
|
property OnChanging:TNotifyEvent read FOnChanging write FOnChanging;
|
|
Public variables
None defined
Function declarations
TimerExEvent
[Expand]
procedure TimerExEvent(TimerEx:TTimerEx);
Description: To be documented
TThreadEx
[Expand]
procedure TThreadEx.Execution;
Description: To be documented
[Expand]
procedure TThreadEx.AfterExecution;
Description: To be documented
[Expand]
procedure TThreadEx.BeforeExecution;
Description: To be documented
[Expand]
procedure TThreadEx.Execute;
Description: To be documented
[Expand]
procedure TThreadEx.TerminateAndWaitFor;
Description: To be documented
TTimerEx
[Expand]
constructor TTimerEx.Create;
Description: To be documented
[Expand]
destructor TTimerEx.Destroy;
Description: To be documented
[Expand]
procedure TTimerEx.SetEnabled(Value:Boolean);
Description: To be documented
[Expand]
procedure TTimerEx.Timer;
Description: To be documented
[Expand]
procedure TTimerEx.StartTimer;
Description: To be documented
[Expand]
procedure TTimerEx.StopTimer;
Description: To be documented
TObjList
[Expand]
constructor TObjList.Create;
Description: To be documented
[Expand]
destructor TObjList.Destroy;
Description: To be documented
[Expand]
procedure TObjList.DestroyListObjects;
Description: To be documented
[Expand]
procedure TObjList.ClearList;
Description: To be documented
TThreadObjList
[Expand]
constructor TThreadObjList.Create;
Description: To be documented
[Expand]
destructor TThreadObjList.Destroy;
Description: To be documented
[Expand]
procedure TThreadObjList.DestroyListObjects;
Description: To be documented
[Expand]
procedure TThreadObjList.ClearList;
Description: To be documented
TLinkedList
[Expand]
constructor TLinkedList.Create;
Description: To be documented
[Expand]
destructor TLinkedList.Destroy;
Description: To be documented
[Expand]
function TLinkedList.GetCount:Integer;
Description: To be documented
[Expand]
function TLinkedList.Link(AValue:TListObject):Boolean;
Description: Link AValue to Prev,Next Siblings and Adjust First/Last
[Expand]
function TLinkedList.LinkEx(APrev,AValue:TListObject):Boolean;
Description: Link AValue after APrev Sibling and Adjust First/Last/Prev/Next
Note
|
If APrev is nil then Link as first value in list
|
[Expand]
function TLinkedList.Unlink(AValue:TListObject):Boolean;
Description: Unlink AValue from Prev,Next Siblings and Adjust First/Last
[Expand]
function TLinkedList.Add(AValue:TListObject):Boolean;
Description: Add AValue to List and link with Siblings
[Expand]
function TLinkedList.Remove(AValue:TListObject):Boolean;
Description: Unlink AValue from Siblings and Remove from List
[Expand]
function TLinkedList.Insert(APrev,AValue:TListObject):Boolean;
Description: To be documented
[Expand]
procedure TLinkedList.Clear;
Description: To be documented
TLinkedObjList
[Expand]
destructor TLinkedObjList.Destroy;
Description: To be documented
[Expand]
procedure TLinkedObjList.ClearList;
Description: To be documented
TThreadLinkedObjList
[Expand]
constructor TThreadLinkedObjList.Create;
Description: To be documented
[Expand]
destructor TThreadLinkedObjList.Destroy;
Description: To be documented
[Expand]
procedure TThreadLinkedObjList.ClearList;
Description: To be documented
[Expand]
procedure TThreadLinkedObjList.LockList;
Description: To be documented
[Expand]
procedure TThreadLinkedObjList.UnlockList;
Description: To be documented
TLinkedTree
[Expand]
constructor TLinkedTree.Create;
Description: To be documented
[Expand]
destructor TLinkedTree.Destroy;
Description: To be documented
[Expand]
function TLinkedTree.GetCount:Integer;
Description: To be documented
[Expand]
function TLinkedTree.Link(AValue,AParent:TTreeObject):Boolean;
Description: To be documented
[Expand]
function TLinkedTree.LinkEx(APrev,AValue,AParent:TTreeObject):Boolean;
Description: Link AValue after APrev Sibling and Adjust FirstChild/LastChild/Prev/Next
Note
|
If APrev is nil then Link as first child in parent or first value if Parent is nil
|
[Expand]
function TLinkedTree.Unlink(AValue:TTreeObject):Boolean;
Description: To be documented
[Expand]
function TLinkedTree.Add(AValue,AParent:TTreeObject):Boolean;
Description: Add AValue to List and Link with Parent and Siblings
[Expand]
function TLinkedTree.Remove(AValue:TTreeObject):Boolean;
Description: Unlink AValue from Parent and Siblings, Remove from List
[Expand]
function TLinkedTree.Insert(APrev,AValue,AParent:TTreeObject):Boolean;
Description: To be documented
[Expand]
procedure TLinkedTree.Move(AValue,AParent:TTreeObject);
Description: To be documented
[Expand]
procedure TLinkedTree.Clear;
Description: To be documented
[Expand]
function TLinkedTree.FirstChild(AParent:TTreeObject):TTreeObject;
Description: To be documented
[Expand]
function TLinkedTree.LastChild(AParent:TTreeObject):TTreeObject;
Description: To be documented
TLinkedObjTree
[Expand]
constructor TLinkedObjTree.Create;
Description: To be documented
[Expand]
destructor TLinkedObjTree.Destroy;
Description: To be documented
[Expand]
procedure TLinkedObjTree.ClearListItems(AParent:TTreeObject);
Description: To be documented
[Expand]
procedure TLinkedObjTree.ClearList;
Description: To be documented
TBtreeObject
[Expand]
procedure TBtreeObject.Clear;
Description: To be documented
TLinkedBtree
[Expand]
constructor TLinkedBtree.Create;
Description: To be documented
[Expand]
destructor TLinkedBtree.Destroy;
Description: To be documented
[Expand]
procedure TLinkedBtree.SetOrder(AOrder:LongWord);
Description: Set a new Order and calculate a new Median value
Note
|
Minimum Order is 5 and minimum Median is 3
|
[Expand]
function TLinkedBtree.PropogateDrop(AEntry:TBtreeObject):Boolean;
Description: To be documented
[Expand]
function TLinkedBtree.PropogateMerge(AEntry:TBtreeObject):Boolean;
Description: To be documented
[Expand]
function TLinkedBtree.PropogateSplit(AEntry:TBtreeObject):Boolean;
Description: To be documented
Note
|
This is currently not used by insert and must be tested before use
|
[Expand]
function TLinkedBtree.GetCount(AEntry:TBtreeObject):LongWord;
Description: Get the count of entries in the node of the supplied entry
Note
|
Does not include the blank key
|
[Expand]
function TLinkedBtree.GetDepth(AEntry:TBtreeObject):LongWord;
Description: Get the depth of the supplied entry in the btree
[Expand]
function TLinkedBtree.GetEnd(AEntry:TBtreeObject):TBtreeObject;
Description: Get the end entry in the node of the supplied entry
Note
|
Includes the blank key which may be the only key
|
[Expand]
function TLinkedBtree.GetStart(AEntry:TBtreeObject):TBtreeObject;
Description: Get the start entry in the node of the supplied entry
Note
|
Includes the blank key which may be the only key
|
[Expand]
function TLinkedBtree.GetBlank(AEntry:TBtreeObject):TBtreeObject;
Description: Get the blank entry in the node of the supplied entry
Blank
|
Blank entry is always the last entry in every node
|
[Expand]
function TLinkedBtree.GetMedian(AEntry:TBtreeObject):TBtreeObject;
Description: Get the median entry in the node of the supplied entry
Note
|
Does not include the blank key
|
[Expand]
function TLinkedBtree.GetDrop(AEntry:TBtreeObject; var ALeft:Boolean):TBtreeObject;
Description: Get the neighbour with appropriate number of keys to drop
Drop
|
Always drop with the Righthand neighbour if available
|
Note
|
Only supported by descendant classes with non balanced nodes
|
[Expand]
function TLinkedBtree.GetMerge(AEntry:TBtreeObject):TBtreeObject;
Description: Get the neighbour with appropriate number of keys to merge
Merge
|
Always merge with the Righthand neighbour if available
|
[Expand]
function TLinkedBtree.GetBorrow(AEntry:TBtreeObject):TBtreeObject;
Description: Get the neighbour with sufficient keys to borrow one
Borrow
|
Always borrow from the Righthand neighbour if available
|
[Expand]
function TLinkedBtree.GetTarget(ADrop:TBtreeObject; ALeft:Boolean):TBtreeObject;
Description: Get the actual target within the neighbour that is appropriate to drop
Note
|
Only supported by descendant classes with non balanced nodes
|
[Expand]
function TLinkedBtree.SetParent(AEntry,AParent:TBtreeObject):Boolean;
Description: Set the parent for all entries in a node and set the child of the parent
Note
|
Includes the blank key which may be the only key
|
[Expand]
function TLinkedBtree.GetLefthand(AEntry:TBtreeObject):TBtreeObject;
Description: Get the lefthand neighbour (Node) of the supplied entries node
[Expand]
function TLinkedBtree.GetRighthand(AEntry:TBtreeObject):TBtreeObject;
Description: Get the righthand neighbour (Node) of the supplied entries node
[Expand]
function TLinkedBtree.GetLeftmost(AEntry:TBtreeObject):TBtreeObject;
Description: Get the leftmost entry in the tree of the supplied entry
[Expand]
function TLinkedBtree.GetRightmost(AEntry:TBtreeObject):TBtreeObject;
Description: Get the rightmost entry in the tree of the supplied entry
Note
|
Does not include the blank key
|
[Expand]
function TLinkedBtree.GetSuccessor(AEntry:TBtreeObject):TBtreeObject;
Description: Get the successor (Right) entry of the supplied entry
Note
|
The returned entry may be a blank key or a real key
|
[Expand]
function TLinkedBtree.GetPredecessor(AEntry:TBtreeObject):TBtreeObject;
Description: Get the predecessor (Left) entry of the supplied entry
Note
|
The returned entry may be a blank key or a real key
|
[Expand]
function TLinkedBtree.GetPosition(AStart,AEntry:TBtreeObject):TBtreeObject;
Description: Get the position where entry should be inserted into the btree
Note
|
The returned entry will be the entry to the right in insert node. The returned entry may be the blank key or may be a real key.
|
[Expand]
function TLinkedBtree.Push(AEntry:TBtreeObject):Boolean;
Description: Push the node containing the supplied entry
Push
|
Push can only occur on the root node
|
Note
|
Will create a new blank as root. All keys will be parented by new blank root.
|
[Expand]
function TLinkedBtree.Split(AEntry:TBtreeObject):Boolean;
Description: Split the node containing the supplied entry
Split
|
Split can propogate all the way to root since median is promoted
|
Note
|
Will promote the median entry to the parent. Keys left of median will be parented by median. Keys right of median will retain current parent. Child of median will parent to new blank on left. Median will be attached to the left of the parent.
|
[Expand]
function TLinkedBtree.Swap(AEntry,ASwap:TBtreeObject; ALeft:Boolean):Boolean;
Description: Swap the supplied entries directly from node to node
Note
|
Entry is always a parent and Swap is always a leaf. No balancing is done as the entry is to be deleted or borrowed.
|
[Expand]
function TLinkedBtree.Drop(AEntry,ADrop,ATarget:TBtreeObject; ALeft:Boolean):Boolean;
Description: Drop the nodes of the supplied entries into one
[Expand]
function TLinkedBtree.Merge(AEntry,AMerge:TBtreeObject):Boolean;
Description: Merge the nodes of the supplied entries into one
[Expand]
function TLinkedBtree.Borrow(AEntry,ABorrow:TBtreeObject):Boolean;
Description: Borrow an entry from the supplied node to balance the tree
[Expand]
function TLinkedBtree.Link(AEntry,ANext:TBtreeObject):Boolean;
Description: Link the object to Prev/Next in linked list
Note
|
If Next is nil then link as last
|
[Expand]
function TLinkedBtree.Unlink(AEntry:TBtreeObject):Boolean;
Description: Unlink the object from Prev/Next in linked list
[Expand]
function TLinkedBtree.LinkBlank(AEntry:TBtreeObject):Boolean;
Description: Link the object to Prev/Next in blank key list
[Expand]
function TLinkedBtree.UnlinkBlank(AEntry:TBtreeObject):Boolean;
Description: Unlink the object from Prev/Next in blank key list
[Expand]
function TLinkedBtree.Attach(AParent,AEntry,ARight:TBtreeObject):Boolean;
Description: Attach the object to Parent/Left/Right in btree
Note
|
If Right is nil then attach as last. If Parent is nil then attach at root.
|
[Expand]
function TLinkedBtree.Detach(AEntry:TBtreeObject):Boolean;
Description: Detach the object from Parent/Left/Right in btree
[Expand]
function TLinkedBtree.PushNode(AEntry:TBtreeObject):Boolean;
Description: Called before a node is pushed following insert of an entry
[Expand]
function TLinkedBtree.SplitNode(AEntry:TBtreeObject):Boolean;
Description: Called before a node is split following insert of an entry
[Expand]
function TLinkedBtree.DropNode(AEntry,ADrop,ATarget:TBtreeObject; ALeft:Boolean):Boolean;
Description: Called before a node is dropped following removal of an entry
[Expand]
function TLinkedBtree.MergeNode(AEntry,AMerge:TBtreeObject):Boolean;
Description: Called before a node is merged following removal of an entry
[Expand]
function TLinkedBtree.BorrowEntry(AEntry,ABorrow:TBtreeObject):Boolean;
Description: Called before an entry is borrowed following removal of an entry
[Expand]
function TLinkedBtree.SwapEntry(AEntry,ASwap:TBtreeObject; ALeft:Boolean):Boolean;
Description: Called before an entry is swapped during a merge or borrow
[Expand]
function TLinkedBtree.SetParentEntry(AEntry,AParent:TBtreeObject):Boolean;
Description: Called after an entry is reparented during a push, split, merge, borrow or swap
[Expand]
function TLinkedBtree.CreateBlank:TBtreeObject;
Description: Create a blank key when a node is added (Split/Empty)
[Expand]
function TLinkedBtree.DeleteBlank(ABlank:TBtreeObject):Boolean;
Description: Delete a blank key when a node is removed (Merge)
[Expand]
function TLinkedBtree.AttachBlank(ABlank:TBtreeObject):Boolean;
Description: Called after a blank entry is attached to a node during split or merge
[Expand]
function TLinkedBtree.DetachBlank(ABlank:TBtreeObject):Boolean;
Description: Called before a blank entry is detached from a node during split or merge
[Expand]
function TLinkedBtree.AttachEntry(AEntry:TBtreeObject):Boolean;
Description: Called after a non blank entry is attached to a node during insert or remove
[Expand]
function TLinkedBtree.DetachEntry(AEntry:TBtreeObject):Boolean;
Description: Called before a non blank entry is detached from a node during insert or remove
[Expand]
function TLinkedBtree.RequirePush(AEntry:TBtreeObject):Boolean;
Description: Called after an entry is inserted to determine if a push is required
Entry
|
Entry is the key that was inserted. Or a key in a parent node of the node where the entry was inserted.
|
Note
|
Only supported by descendant classes with non balanced nodes
|
[Expand]
function TLinkedBtree.RequireSplit(AEntry:TBtreeObject):Boolean;
Description: Called after an entry is inserted to determine if a split is required
Entry
|
Entry is the key that was inserted. Or a key in a parent node of the node where the entry was inserted.
|
[Expand]
function TLinkedBtree.RequireDrop(AEntry:TBtreeObject):Boolean;
Description: Called after an entry is removed to determine if a drop is required
Entry
|
Entry is the start key of the node where the entry was removed. Or a key in a parent node of the node where the entry was removed.
|
Note
|
Only supported by descendant classes with non balanced nodes
|
[Expand]
function TLinkedBtree.RequireMerge(AEntry:TBtreeObject):Boolean;
Description: Called after an entry is removed to determine if a merge is required
Entry
|
Entry is the start key of the node where the entry was removed. Or a key in a parent node of the node where the entry was removed.
|
[Expand]
function TLinkedBtree.RequireBorrow(AEntry:TBtreeObject):Boolean;
Description: Called after an entry is removed to determine if a borrow is required
Entry
|
Entry is the start key of the node where the entry was removed. Or a key in a parent node of the node where the entry was removed.
|
[Expand]
function TLinkedBtree.Compare(AEntry1,AEntry2:TBtreeObject):Integer;
Description: Always returns greater than unless the second entry is a blank key
Note
|
This means keys will end up in added order if no compare is provided
|
[Expand]
function TLinkedBtree.Add(AParent,AEntry:TBtreeObject):Boolean;
Description: Add an entry to the btree without doing the full insert
Entry
|
Entries must be added in btree order to obtain final order
|
Note
|
Both real and blank keys can be added. No events are triggered by Add.
|
[Expand]
function TLinkedBtree.Insert(AEntry:TBtreeObject):Boolean;
Description: Insert an entry in the btree by finding its position
Note
|
Rebalances the tree after inserting the new entry. Blank keys cannot be inserted. Entry must be created by the caller.
|
[Expand]
function TLinkedBtree.Remove(AEntry:TBtreeObject):Boolean;
Description: Remove an entry from the btree by deleting it
Note
|
Rebalances the tree after deleting the entry. Blank keys cannot be removed. Entry must be destroyed by the caller.
|
[Expand]
procedure TLinkedBtree.Clear;
Description: Removes all entries from the btree
[Expand]
procedure TLinkedBtree.Empty;
Description: Removes all entries from the btree and adds a blank root key
[Expand]
procedure TLinkedBtree.Rebuild;
Description: Empties the btree and rebuilds from the linked list
TLinkedObjBtree
[Expand]
constructor TLinkedObjBtree.Create;
Description: To be documented
[Expand]
destructor TLinkedObjBtree.Destroy;
Description: To be documented
[Expand]
procedure TLinkedObjBtree.ClearBtree;
Description: Removes and frees all entries in the btree
[Expand]
procedure TLinkedObjBtree.EmptyBtree;
Description: Removes and frees all entries in the btree and adds a blank root key
THashListObject
[Expand]
procedure THashListObject.SetKeyHash(AKeyHash:LongWord);
Description: To be documented
THashLinkedList
[Expand]
constructor THashLinkedList.Create(AKeyBits:Byte);
Description: To be documented
[Expand]
destructor THashLinkedList.Destroy;
Description: To be documented
[Expand]
function THashLinkedList.KeyLink(AValue:THashListObject):Boolean;
Description: Link AValue to Prev,Next Keys and Adjust First
[Expand]
function THashLinkedList.KeyUnlink(AValue:THashListObject):Boolean;
Description: Unlink AValue from Prev,Next Keys and Adjust First
[Expand]
function THashLinkedList.KeyFirst(AKeyHash:LongWord):THashListObject;
Description: To be documented
[Expand]
function THashLinkedList.Add(AValue:TListObject):Boolean;
Description: Add AValue to List and link with Siblings
[Expand]
function THashLinkedList.Remove(AValue:TListObject):Boolean;
Description: Unlink AValue from Siblings and Remove from List
[Expand]
function THashLinkedList.Insert(APrev,AValue:TListObject):Boolean;
Description: To be documented
[Expand]
procedure THashLinkedList.Clear;
Description: To be documented
THashLinkedObjList
[Expand]
constructor THashLinkedObjList.Create(AKeyBits:Byte);
Description: To be documented
[Expand]
destructor THashLinkedObjList.Destroy;
Description: To be documented
[Expand]
procedure THashLinkedObjList.ClearList;
Description: To be documented
THashTreeObject
[Expand]
constructor THashTreeObject.Create(AKeyBits:Byte);
Description: To be documented
[Expand]
destructor THashTreeObject.Destroy;
Description: To be documented
[Expand]
procedure THashTreeObject.SetKeyHash(AKeyHash:LongWord);
Description: To be documented
[Expand]
function THashTreeObject.KeyLink(AValue:THashTreeObject):Boolean;
Description: Link AValue to Prev,Next Keys and Adjust First
[Expand]
function THashTreeObject.KeyUnlink(AValue:THashTreeObject):Boolean;
Description: Unlink AValue from Prev,Next Keys and Adjust First
[Expand]
function THashTreeObject.KeyFirst(AKeyHash:LongWord):THashTreeObject;
Description: To be documented
THashLinkedTree
[Expand]
constructor THashLinkedTree.Create(AKeyBits:Byte);
Description: To be documented
[Expand]
destructor THashLinkedTree.Destroy;
Description: To be documented
[Expand]
function THashLinkedTree.KeyLink(AValue,AParent:THashTreeObject):Boolean;
Description: Link AValue to Prev,Next Keys and Adjust First
[Expand]
function THashLinkedTree.KeyUnlink(AValue,AParent:THashTreeObject):Boolean;
Description: Unlink AValue from Prev,Next Keys and Adjust First
[Expand]
function THashLinkedTree.KeyFirst(AParent:THashTreeObject; AKeyHash:LongWord):THashTreeObject;
Description: To be documented
[Expand]
function THashLinkedTree.Add(AValue,AParent:TTreeObject):Boolean;
Description: Add AValue to List and Link with Parent and Siblings
[Expand]
function THashLinkedTree.Remove(AValue:TTreeObject):Boolean;
Description: Unlink AValue from Parent and Siblings, Remove from List
[Expand]
function THashLinkedTree.Insert(APrev,AValue,AParent:TTreeObject):Boolean;
Description: To be documented
[Expand]
procedure THashLinkedTree.Move(AValue,AParent:TTreeObject);
Description: To be documented
[Expand]
procedure THashLinkedTree.Clear;
Description: To be documented
THashLinkedObjTree
[Expand]
constructor THashLinkedObjTree.Create(AKeyBits:Byte);
Description: To be documented
[Expand]
destructor THashLinkedObjTree.Destroy;
Description: To be documented
[Expand]
procedure THashLinkedObjTree.ClearListItems(AParent:THashTreeObject);
Description: To be documented
[Expand]
procedure THashLinkedObjTree.ClearList;
Description: To be documented
TStringObject
[Expand]
procedure TStringObject.SetValue(const AValue:String);
Description: To be documented
TLinkedStringList
[Expand]
constructor TLinkedStringList.Create;
Description: To be documented
[Expand]
destructor TLinkedStringList.Destroy;
Description: To be documented
[Expand]
function TLinkedStringList.GetItem(AIndex:Integer):TStringObject;
Description: To be documented
[Expand]
function TLinkedStringList.Link(AValue:TStringObject):Boolean;
Description: Link AValue to Prev,Next Siblings and Adjust First/Last
[Expand]
function TLinkedStringList.LinkEx(APrev,AValue:TStringObject):Boolean;
Description: Link AValue after APrev Sibling and Adjust First/Last/Prev/Next
Note
|
If APrev is nil then Link as first value in list
|
[Expand]
function TLinkedStringList.Unlink(AValue:TStringObject):Boolean;
Description: Unlink AValue from Prev,Next Siblings and Adjust First/Last
[Expand]
procedure TLinkedStringList.ClearList;
Description: To be documented
[Expand]
procedure TLinkedStringList.Changed;
Description: To be documented
[Expand]
procedure TLinkedStringList.Changing;
Description: To be documented
[Expand]
function TLinkedStringList.Get(Index:Integer):String;
Description: To be documented
[Expand]
function TLinkedStringList.GetCount:Integer;
Description: To be documented
[Expand]
function TLinkedStringList.GetObject(Index:Integer):TObject;
Description: To be documented
[Expand]
procedure TLinkedStringList.Put(Index:Integer;const S:String);
Description: To be documented
[Expand]
procedure TLinkedStringList.PutObject(Index:Integer; AObject:TObject);
Description: To be documented
[Expand]
procedure TLinkedStringList.SetUpdateState(Updating:Boolean);
Description: To be documented
[Expand]
function TLinkedStringList.Add(const S:String):Integer;
Description: To be documented
[Expand]
procedure TLinkedStringList.Clear;
Description: To be documented
[Expand]
procedure TLinkedStringList.Delete(Index:Integer);
Description: To be documented
[Expand]
procedure TLinkedStringList.Exchange(Index1,Index2:Integer);
Description: To be documented
[Expand]
function TLinkedStringList.IndexOf(const S:String):Integer;
Description: Uses Counted Index starting from First String Object
[Expand]
procedure TLinkedStringList.Insert(Index:Integer; const S:String);
Description: To be documented
TStringBlock
[Expand]
destructor TStringBlock.Destroy;
Description: To be documented
TLinkedStringListEx
[Expand]
constructor TLinkedStringListEx.Create;
Description: To be documented
[Expand]
destructor TLinkedStringListEx.Destroy;
Description: To be documented
[Expand]
function TLinkedStringListEx.GetBlock(Index:Integer):TStringBlock;
Description: To be documented
[Expand]
function TLinkedStringListEx.AddBlock(Block:TStringBlock; Index:Integer):TStringBlock;
Description: To be documented
Index
|
Starting Index of Block to be Added
|
Block
|
Current Block containing Index or nil
|
[Expand]
function TLinkedStringListEx.DeleteBlock(Block:TStringBlock):Boolean;
Description: To be documented
[Expand]
function TLinkedStringListEx.UpdateBlocks(Block:TStringBlock):Boolean;
Description: To be documented
[Expand]
function TLinkedStringListEx.GetItem(Block:TStringBlock; Index:Integer):TStringObjectEx;
Description: To be documented
[Expand]
function TLinkedStringListEx.AddItem(Block:TStringBlock; Index:Integer; Item:TStringObjectEx):Boolean;
Description: To be documented
[Expand]
function TLinkedStringListEx.DeleteItem(Block:TStringBlock;Index:Integer; Item:TStringObjectEx):Boolean;
Description: To be documented
[Expand]
function TLinkedStringListEx.IndexOfItem(Block:TStringBlock; Item:TStringObjectEx):Integer;
Description: To be documented
[Expand]
function TLinkedStringListEx.Get(Index:Integer):String;
Description: To be documented
[Expand]
function TLinkedStringListEx.GetCapacity:Integer;
Description: To be documented
[Expand]
function TLinkedStringListEx.GetObject(Index:Integer):TObject;
Description: To be documented
[Expand]
procedure TLinkedStringListEx.Put(Index:Integer;const S:String);
Description: To be documented
[Expand]
procedure TLinkedStringListEx.PutObject(Index:Integer; AObject:TObject);
Description: To be documented
[Expand]
function TLinkedStringListEx.Add(const S:String):Integer;
Description: To be documented
[Expand]
procedure TLinkedStringListEx.Clear;
Description: To be documented
[Expand]
procedure TLinkedStringListEx.Delete(Index:Integer);
Description: To be documented
[Expand]
procedure TLinkedStringListEx.Exchange(Index1,Index2:Integer);
Description: To be documented
[Expand]
function TLinkedStringListEx.IndexOf(const S:String):Integer;
Description: Uses IndexOfItem within the Block of the matched String Object
Note
|
Could use Counted Index method of TLinkedStringList instead
|
[Expand]
procedure TLinkedStringListEx.Insert(Index:Integer; const S:String);
Description: To be documented
THashStringObject
[Expand]
procedure THashStringObject.SetHash(AHash:LongWord);
Description: To be documented
[Expand]
procedure THashStringObject.SetValue(const AValue:String);
Description: To be documented
THashLinkedStringList
[Expand]
constructor THashLinkedStringList.Create(AKeyBits:Byte);
Description: To be documented
[Expand]
destructor THashLinkedStringList.Destroy;
Description: To be documented
[Expand]
function THashLinkedStringList.KeyLink(AValue:THashStringObject):Boolean;
Description: Link AValue to Prev,Next Keys and Adjust First
[Expand]
function THashLinkedStringList.KeyUnlink(AValue:THashStringObject):Boolean;
Description: Unlink AValue from Prev,Next Keys and Adjust First
[Expand]
procedure THashLinkedStringList.ClearList;
Description: To be documented
[Expand]
function THashLinkedStringList.KeyFirst(AKeyHash:LongWord):THashStringObject;
Description: To be documented
[Expand]
function THashLinkedStringList.Add(const S:String):Integer;
Description: To be documented
[Expand]
procedure THashLinkedStringList.Delete(Index:Integer);
Description: To be documented
[Expand]
function THashLinkedStringList.IndexOf(const S:String):Integer;
Description: Uses IndexOfItem within the Block of the matched String Object
Note
|
Cannot use Counted Index method due to use of Hash Buckets
|
[Expand]
procedure THashLinkedStringList.Insert(Index:Integer; const S:String);
Description: To be documented
TIntegerList
[Expand]
constructor TIntegerList.Create;
Description: To be documented
[Expand]
destructor TIntegerList.Destroy;
Description: To be documented
[Expand]
function TIntegerList.GetItem(Idx:Integer):Integer;
Description: To be documented
[Expand]
procedure TIntegerList.SetItem(Idx,Value:Integer);
Description: To be documented
[Expand]
function TIntegerList.GetCount:Integer;
Description: To be documented
[Expand]
function TIntegerList.Add(AValue:Integer):Integer;
Description: To be documented
[Expand]
function TIntegerList.Remove(AValue:Integer):Integer;
Description: To be documented
[Expand]
procedure TIntegerList.Delete(Idx:Integer);
Description: To be documented
[Expand]
function TIntegerList.IndexOf(AValue:Integer):Integer;
Description: To be documented
[Expand]
procedure TIntegerList.Clear;
Description: To be documented
TDateTimeList
[Expand]
constructor TDateTimeList.Create;
Description: To be documented
[Expand]
destructor TDateTimeList.Destroy;
Description: To be documented
[Expand]
function TDateTimeList.GetItem(Idx:Integer):TDateTime;
Description: To be documented
[Expand]
procedure TDateTimeList.SetItem(Idx:Integer; Value:TDateTime);
Description: To be documented
[Expand]
function TDateTimeList.GetCount:Integer;
Description: To be documented
[Expand]
function TDateTimeList.Add(AValue:TDateTime):Integer;
Description: To be documented
[Expand]
function TDateTimeList.Remove(AValue:TDateTime):Integer;
Description: To be documented
[Expand]
procedure TDateTimeList.Delete(Idx:Integer);
Description: To be documented
[Expand]
function TDateTimeList.IndexOf(AValue:TDateTime):Integer;
Description: To be documented
[Expand]
procedure TDateTimeList.Clear;
Description: To be documented
TMemoryBlock
[Expand]
destructor TMemoryBlock.Destroy;
Description: To be documented
TMemoryStreamEx
[Expand]
constructor TMemoryStreamEx.Create;
Description: To be documented
[Expand]
destructor TMemoryStreamEx.Destroy;
Description: To be documented
[Expand]
function TMemoryStreamEx.RoundSize(ASize:LongInt):LongWord;
Description: To be documented
[Expand]
function TMemoryStreamEx.GetBlock(AOffset:LongWord):TMemoryBlock;
Description: To be documented
[Expand]
function TMemoryStreamEx.ReadBlock(ABlock:TMemoryBlock; ABuffer:Pointer; AOffset,ACount:LongWord):LongWord;
Description: To be documented
[Expand]
function TMemoryStreamEx.WriteBlock(ABlock:TMemoryBlock; ABuffer:Pointer; AOffset,ACount:LongWord):LongWord;
Description: To be documented
[Expand]
procedure TMemoryStreamEx.SetCapacity(ACapacity:LongWord);
Description: To be documented
[Expand]
procedure TMemoryStreamEx.SetSize(ASize:LongInt);
Description: To be documented
[Expand]
function TMemoryStreamEx.Read(var ABuffer; ACount:LongInt):LongInt;
Description: To be documented
[Expand]
function TMemoryStreamEx.Write(const ABuffer; ACount:LongInt):LongInt;
Description: To be documented
[Expand]
function TMemoryStreamEx.Seek(AOffset:LongInt; AOrigin:Word):LongInt;
Description: To be documented
[Expand]
procedure TMemoryStreamEx.SaveToStream(AStream:TStream);
Description: To be documented
[Expand]
procedure TMemoryStreamEx.LoadFromStream(AStream:TStream);
Description: To be documented
[Expand]
procedure TMemoryStreamEx.SaveToFile(const AFileName:String);
Description: To be documented
[Expand]
procedure TMemoryStreamEx.LoadFromFile(const AFileName:String);
Description: To be documented
[Expand]
procedure TMemoryStreamEx.Clear;
Description: To be documented
TStreamEx
[Expand]
function TStreamEx.GetPositionEx:Int64;
Description: To be documented
[Expand]
procedure TStreamEx.SetPositionEx(const Pos:Int64);
Description: To be documented
[Expand]
function TStreamEx.GetSizeEx:Int64;
Description: To be documented
[Expand]
procedure TStreamEx.SetSizeEx(const NewSize:Int64);
Description: To be documented
THandleStreamEx
[Expand]
constructor THandleStreamEx.Create(AHandle:Integer);
Description: To be documented
[Expand]
procedure THandleStreamEx.SetSize(NewSize:LongInt);
Description: To be documented
[Expand]
procedure THandleStreamEx.SetSizeEx(const NewSize:Int64);
Description: To be documented
[Expand]
function THandleStreamEx.Read(var Buffer; Count:Longint):Longint;
Description: To be documented
[Expand]
function THandleStreamEx.Write(const Buffer; Count:Longint):Longint;
Description: To be documented
[Expand]
function THandleStreamEx.Seek(Offset:Longint; Origin:Word):Longint;
Description: To be documented
[Expand]
function THandleStreamEx.SeekEx(const Offset:Int64; Origin:Word):Int64;
Description: To be documented
TFileStreamEx
[Expand]
constructor TFileStreamEx.Create(const FileName:String; Mode:Word);
Description: To be documented
[Expand]
destructor TFileStreamEx.Destroy;
Description: To be documented
TStringItemEx
[Expand]
procedure TStringItemEx.SetValue(const AValue:String);
Description: To be documented
TStringListEx
[Expand]
constructor TStringListEx.Create;
Description: To be documented
[Expand]
destructor TStringListEx.Destroy;
Description: To be documented
[Expand]
function TStringListEx.GetBlock(Index:Integer):TStringBlock;
Description: To be documented
[Expand]
function TStringListEx.AddBlock(Block:TStringBlock; Index:Integer):TStringBlock;
Description: To be documented
Index
|
Starting Index of Block to be Added
|
Block
|
Current Block containing Index or nil
|
[Expand]
function TStringListEx.DeleteBlock(Block:TStringBlock):Boolean;
Description: To be documented
[Expand]
function TStringListEx.UpdateBlocks(Block:TStringBlock):Boolean;
Description: To be documented
[Expand]
function TStringListEx.GetItem(Block:TStringBlock; Index:Integer):TStringItemEx;
Description: To be documented
[Expand]
function TStringListEx.AddItem(Block:TStringBlock; Index:Integer; Item:TStringItemEx):Boolean;
Description: To be documented
[Expand]
function TStringListEx.DeleteItem(Block:TStringBlock; Index:Integer; Item:TStringItemEx):Boolean;
Description: To be documented
[Expand]
procedure TStringListEx.ClearList;
Description: To be documented
[Expand]
procedure TStringListEx.Changed;
Description: To be documented
[Expand]
procedure TStringListEx.Changing;
Description: To be documented
[Expand]
function TStringListEx.Get(Index:Integer):String;
Description: To be documented
[Expand]
function TStringListEx.GetCapacity:Integer;
Description: To be documented
[Expand]
function TStringListEx.GetCount:Integer;
Description: To be documented
[Expand]
function TStringListEx.GetObject(Index:Integer):TObject;
Description: To be documented
[Expand]
procedure TStringListEx.Put(Index:Integer; const S:String);
Description: To be documented
[Expand]
procedure TStringListEx.PutObject(Index:Integer; AObject:TObject);
Description: To be documented
[Expand]
procedure TStringListEx.SetUpdateState(Updating:Boolean);
Description: To be documented
[Expand]
function TStringListEx.Add(const S:String):Integer;
Description: To be documented
[Expand]
procedure TStringListEx.Clear;
Description: To be documented
[Expand]
procedure TStringListEx.Delete(Index:Integer);
Description: To be documented
[Expand]
procedure TStringListEx.Exchange(Index1,Index2:Integer);
Description: To be documented
[Expand]
function TStringListEx.IndexOf(const S:String):Integer;
Description: Uses Counted Index within the Block of the matched String Object
[Expand]
procedure TStringListEx.Insert(Index:Integer; const S:String);
Description: To be documented
Return to Unit Reference