📄 absbtree.hpp
字号:
// Borland C++ Builder
// Copyright (c) 1995, 2005 by Borland Software Corporation
// All rights reserved
// (DO NOT EDIT: machine generated header) 'Absbtree.pas' rev: 10.00
#ifndef AbsbtreeHPP
#define AbsbtreeHPP
#pragma delphiheader begin
#pragma option push
#pragma option -w- // All warnings off
#pragma option -Vx // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp> // Pascal unit
#include <Sysinit.hpp> // Pascal unit
#include <Sysutils.hpp> // Pascal unit
#include <Classes.hpp> // Pascal unit
#include <Math.hpp> // Pascal unit
#include <Abspage.hpp> // Pascal unit
#include <Absbaseengine.hpp> // Pascal unit
#include <Absexcept.hpp> // Pascal unit
#include <Absbase.hpp> // Pascal unit
#include <Absconverts.hpp> // Pascal unit
#include <Absmemory.hpp> // Pascal unit
#include <Abstypes.hpp> // Pascal unit
#include <Absvariant.hpp> // Pascal unit
#include <Absconst.hpp> // Pascal unit
//-- user supplied -----------------------------------------------------------
namespace Absbtree
{
//-- type declarations -------------------------------------------------------
#pragma pack(push,1)
struct TABSBTreePageHeader
{
public:
bool IsRoot;
bool IsLeaf;
int LeftPageNo;
int RightPageNo;
bool HasKeys;
bool HasSuffixes;
Word KeyPrefixSize;
Word EntryCount;
Word PagePrefixSize;
} ;
#pragma pack(pop)
typedef TABSBTreePageHeader *PABSBTreePageHeader;
#pragma option push -b-
enum TABSKeyPathPosition { kppUnknown, kppOnKey, kppBeforeKey, kppAfterKey, kppBOF, kppEOF };
#pragma option pop
typedef TABSKeyPathPosition *PABSKeyPathPosition;
struct TABSKeyPathItem
{
public:
int PageNo;
int EntryNo;
int EntryCount;
} ;
class DELPHICLASS TABSKeyPath;
class PASCALIMPLEMENTATION TABSKeyPath : public System::TObject
{
typedef System::TObject inherited;
public:
TABSKeyPathItem Items[32];
int Count;
int ItemNo;
TABSKeyPathPosition PositionType;
int IndexState;
__fastcall TABSKeyPath(void);
void __fastcall Clear(void);
void __fastcall Assign(TABSKeyPath* KeyPath);
void __fastcall AddItem(int aPageNo, int aEntryNo, int aEntryCount);
void __fastcall DeleteLastItem(void);
void __fastcall IncLevel(void);
void __fastcall DecLevel(void);
int __fastcall GetCurrentPageNo(void);
void __fastcall SetCurrentPageNo(int Value);
bool __fastcall PageExists(int aPageNo);
int __fastcall Compare(TABSKeyPath* aKeyPath);
double __fastcall GetApproxRecNoInPercents(void);
__int64 __fastcall GetBitmapRecNoByIndexPosition(int MaxEntriesPerPage);
void __fastcall FillItemsByBitmapRecNo(int RecordNo, int MaxEntriesPerPage);
__property int CurrentPageNo = {read=GetCurrentPageNo, write=SetCurrentPageNo, nodefault};
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~TABSKeyPath(void) { }
#pragma option pop
};
struct TABSKeyPart
{
public:
int OffsetInShortKeyBuffer;
int OffsetInFullKeyBuffer;
int OffsetInRecordBuffer;
int FieldNo;
int ShortSize;
int FullSize;
int AddedSize;
Abstypes::TABSBaseFieldType DataType;
bool Descending;
bool CaseInsensitive;
} ;
typedef DynamicArray<TABSKeyPart > ABSBTree__3;
class DELPHICLASS TABSBTreeKeyRef;
class PASCALIMPLEMENTATION TABSBTreeKeyRef : public System::TObject
{
typedef System::TObject inherited;
private:
int FShortKeySize;
int FFullKeySize;
Word FReferenceSize;
bool FKeyIsReference;
int FCompareFieldCount;
int __fastcall GetPartCount(void);
protected:
virtual void __fastcall SetPartCount(int Value);
public:
DynamicArray<TABSKeyPart > Parts;
char * __fastcall AllocShortKeyBuffer(void);
char * __fastcall AllocFullKeyBuffer(void);
void __fastcall FreeAndNilKeyBuffer(char * &Buffer);
virtual int __fastcall CompareShortKeys(char * KeyBuffer1, char * KeyBuffer2, bool MayUseFullKeys = false, int SessionID = 0xffffffff, char * Reference1 = (void *)(0x0), char * Reference2 = (void *)(0x0)) = 0 ;
virtual int __fastcall CompareFullKeys(char * KeyBuffer1, char * KeyBuffer2) = 0 ;
int __fastcall CompareReferences(char * Reference1, char * Reference2, int Size);
__property int PartCount = {read=GetPartCount, write=SetPartCount, nodefault};
__property int ShortKeySize = {read=FShortKeySize, nodefault};
__property int FullKeySize = {read=FFullKeySize, nodefault};
__property Word ReferenceSize = {read=FReferenceSize, write=FReferenceSize, nodefault};
__property bool KeyIsReference = {read=FKeyIsReference, write=FKeyIsReference, nodefault};
__property int CompareFieldCount = {read=FCompareFieldCount, write=FCompareFieldCount, nodefault};
public:
#pragma option push -w-inl
/* TObject.Create */ inline __fastcall TABSBTreeKeyRef(void) : System::TObject() { }
#pragma option pop
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~TABSBTreeKeyRef(void) { }
#pragma option pop
};
typedef DynamicArray<int > ABSBTree__5;
class DELPHICLASS TABSRecordKeyRef;
class PASCALIMPLEMENTATION TABSRecordKeyRef : public TABSBTreeKeyRef
{
typedef TABSBTreeKeyRef inherited;
private:
char *LRecordBuffer;
void *LTableData;
DynamicArray<int > FCompareLengths;
void __fastcall RetrieveFullKeyByRecordID(const Abstypes::TABSPageItemID &RecordID, char * FullKey, int SessionID);
protected:
virtual void __fastcall SetPartCount(int Value);
public:
__fastcall TABSRecordKeyRef(void);
void __fastcall Assign(Absbase::TABSIndexDef* IndexDef, void * aTableData);
void __fastcall MakeShortKeyFromRecordBuffer(char * RecordBuffer, char * KeyBuffer);
void __fastcall MakeFullKeyFromRecordBuffer(char * RecordBuffer, char * KeyBuffer);
virtual int __fastcall CompareShortKeys(char * KeyBuffer1, char * KeyBuffer2, bool MayUseFullKeys = false, int SessionID = 0xffffffff, char * Reference1 = (void *)(0x0), char * Reference2 = (void *)(0x0));
virtual int __fastcall CompareFullKeys(char * KeyBuffer1, char * KeyBuffer2);
void __fastcall SetPartialCompare(char * RecordBuffer, bool PartialCompare);
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~TABSRecordKeyRef(void) { }
#pragma option pop
};
class DELPHICLASS TABSPageKeyRef;
class PASCALIMPLEMENTATION TABSPageKeyRef : public TABSBTreeKeyRef
{
typedef TABSBTreeKeyRef inherited;
public:
__fastcall TABSPageKeyRef(void);
virtual int __fastcall CompareShortKeys(char * KeyBuffer1, char * KeyBuffer2, bool MayUseFullKeys = false, int SessionID = 0xffffffff, char * Reference1 = (void *)(0x0), char * Reference2 = (void *)(0x0));
virtual int __fastcall CompareFullKeys(char * KeyBuffer1, char * KeyBuffer2);
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~TABSPageKeyRef(void) { }
#pragma option pop
};
class DELPHICLASS TABSBTreePage;
class DELPHICLASS TABSBTreeLeafController;
class DELPHICLASS TABSBTreePageController;
class PASCALIMPLEMENTATION TABSBTreePageController : public System::TObject
{
typedef System::TObject inherited;
protected:
TABSBTreePage* FPage;
TABSBTreeKeyRef* __fastcall GetKeyRef(void);
bool __fastcall CanAddEntry(void);
bool __fastcall IsOverflow(void);
bool __fastcall CanUnderflow(void);
bool __fastcall CanMergeWithPage(TABSBTreePage* Page);
void __fastcall EnlargePageBuffer(void);
int __fastcall CompareKeys(bool MayUseFullKeys, int SessionID, char * Key1, Word Key2Index);
int __fastcall CompareReferences(char * Reference1, Word Reference2Index);
virtual int __fastcall CompareEntries(bool MayUseFullKeys, int SessionID, char * Key1, char * Reference1, Word Entry2Index) = 0 ;
Word __fastcall GetKeyPosition(bool MayUseFullKeys, int SessionID, char * Key, char * Reference, int StartPosition = 0x0, PABSKeyPathPosition PositionType = (void *)(0x0), Abstypes::TABSKeySearchType SearchType = (Abstypes::TABSKeySearchType)(0x2));
void __fastcall InsertEntry(char * Key, char * Reference, int Position);
void __fastcall DeleteEntry(int Position);
void __fastcall RootSplit(int SessionID, TABSKeyPath* KeyPath);
void __fastcall NonRootSplit(int SessionID, TABSKeyPath* KeyPath);
bool __fastcall TryMergeWithPage(int SessionID, int MergePageNo, TABSKeyPath* KeyPath);
bool __fastcall TryMerge(int SessionID, TABSKeyPath* KeyPath);
void __fastcall MergeWithLeftPage(int SessionID, TABSBTreePage* LeftPage, TABSKeyPath* KeyPath);
void __fastcall MergeWithRightPage(int SessionID, TABSBTreePage* RightPage, TABSKeyPath* KeyPath);
public:
__fastcall TABSBTreePageController(TABSBTreePage* aPage);
virtual void __fastcall InsertLeafEntry(int SessionID, char * Key, char * Reference, TABSKeyPath* KeyPath) = 0 ;
virtual bool __fastcall DeleteLeafEntry(int SessionID, char * Key, char * Reference, TABSKeyPath* KeyPath) = 0 ;
virtual void __fastcall FreeAllPages(int SessionID, bool KeepRootPage) = 0 ;
virtual void __fastcall CheckIntegrity(int SessionID, TABSKeyPath* KeyPath) = 0 ;
virtual bool __fastcall FindEntry(int SessionID, char * Key, char * Reference, TABSKeyPath* Position) = 0 ;
virtual bool __fastcall GetFirstPosition(int SessionID, TABSKeyPath* Position) = 0 ;
virtual bool __fastcall GetLastPosition(int SessionID, TABSKeyPath* Position) = 0 ;
virtual bool __fastcall FindByCondition(int SessionID, bool First, char * Key, Abstypes::TABSSearchCondition Operator, TABSKeyPath* Position) = 0 ;
char * __fastcall GetPKey(int KeyPosition);
char * __fastcall GetPReference(int RefPosition);
virtual void __fastcall GetFirstKey(int SessionID, char * Key) = 0 ;
virtual void __fastcall GetLastKey(int SessionID, char * Key) = 0 ;
virtual void __fastcall GetFirstEntry(int SessionID, char * Key, char * Reference) = 0 ;
virtual void __fastcall GetLastEntry(int SessionID, char * Key, char * Reference) = 0 ;
void __fastcall Split(int SessionID, TABSKeyPath* KeyPath);
__property TABSBTreeKeyRef* KeyRef = {read=GetKeyRef};
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~TABSBTreePageController(void) { }
#pragma option pop
};
class PASCALIMPLEMENTATION TABSBTreeLeafController : public TABSBTreePageController
{
typedef TABSBTreePageController inherited;
private:
bool __fastcall FindEntryOnPage(int SessionID, char * Key, char * Reference, int &EntryNo);
bool __fastcall FindFirstByCondition(int SessionID, char * Key, Abstypes::TABSSearchCondition Operator, TABSKeyPath* Position);
bool __fastcall FindLastByCondition(int SessionID, char * Key, Abstypes::TABSSearchCondition Operator, TABSKeyPath* Position);
protected:
virtual int __fastcall CompareEntries(bool MayUseFullKeys, int SessionID, char * Key1, char * Reference1, Word Entry2Index);
public:
virtual void __fastcall InsertLeafEntry(int SessionID, char * Key, char * Reference, TABSKeyPath* KeyPath);
virtual bool __fastcall DeleteLeafEntry(int SessionID, char * Key, char * Reference, TABSKeyPath* KeyPath);
virtual void __fastcall GetFirstKey(int SessionID, char * Key);
virtual void __fastcall GetLastKey(int SessionID, char * Key);
virtual void __fastcall GetFirstEntry(int SessionID, char * Key, char * Reference);
virtual void __fastcall GetLastEntry(int SessionID, char * Key, char * Reference);
virtual bool __fastcall FindEntry(int SessionID, char * Key, char * Reference, TABSKeyPath* Position);
virtual bool __fastcall GetFirstPosition(int SessionID, TABSKeyPath* Position);
virtual bool __fastcall GetLastPosition(int SessionID, TABSKeyPath* Position);
virtual bool __fastcall FindByCondition(int SessionID, bool First, char * Key, Abstypes::TABSSearchCondition Operator, TABSKeyPath* Position);
virtual void __fastcall FreeAllPages(int SessionID, bool KeepRootPage);
virtual void __fastcall CheckIntegrity(int SessionID, TABSKeyPath* KeyPath);
public:
#pragma option push -w-inl
/* TABSBTreePageController.Create */ inline __fastcall TABSBTreeLeafController(TABSBTreePage* aPage) : TABSBTreePageController(aPage) { }
#pragma option pop
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~TABSBTreeLeafController(void) { }
#pragma option pop
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -