📄 absdiskengine.hpp
字号:
virtual void __fastcall InternalSetRecNo(Absbase::TABSCursor* Cursor, __int64 RecNo);
virtual __int64 __fastcall InternalGetRecNo(Absbase::TABSCursor* Cursor);
virtual __int64 __fastcall LastAutoincValue(int FieldNo, Absbase::TABSBaseSession* Session);
virtual void __fastcall Rollback(int SessionID);
bool __fastcall LockTable(int SessionID, Abstypes::TABSLockType LockType, int TryCount, int Delay, bool AllowXIRWAfterSIRW = true);
bool __fastcall UnlockTable(int SessionID, Abstypes::TABSLockType LockType, bool IgnoreIfNoLock = false);
bool __fastcall LockRecord(int SessionID, const Abstypes::TABSPageItemID &RecordID, int TryCount, int Delay);
bool __fastcall UnlockRecord(int SessionID, const Abstypes::TABSPageItemID &RecordID);
};
class PASCALIMPLEMENTATION TABSDiskRecordManager : public Absbaseengine::TABSBaseRecordManager
{
typedef Absbaseengine::TABSBaseRecordManager inherited;
private:
Absbtree::TABSBTreeRecordPageIndex* FRecordPageIndex;
Abspage::TABSPageManager* LPageManager;
Absbaseengine::TABSBaseFieldManager* LFieldManager;
TABSInternalDBTransactedAccessFile* LMostUpdatedFile;
int FMaxRecordsOnPage;
DynamicArray<__int64 > FLastAutoIncValues;
int FDiskRecordBufferSize;
char *FTempDiskRecordBuffer;
TABSDiskTableData* LTableData;
bool __fastcall IsRecordPageValid(Abspage::TABSPage* Page);
void __fastcall GetFirstRecord(int SessionID, Abstypes::TABSNavigationInfo &NavigationInfo);
void __fastcall GetLastRecord(int SessionID, Abstypes::TABSNavigationInfo &NavigationInfo);
void __fastcall GetNextRecord(int SessionID, Abstypes::TABSNavigationInfo &NavigationInfo);
void __fastcall GetPriorRecord(int SessionID, Abstypes::TABSNavigationInfo &NavigationInfo);
void __fastcall GetCurrentRecord(int SessionID, Abstypes::TABSNavigationInfo &NavigationInfo);
public:
__fastcall TABSDiskRecordManager(Abspage::TABSPageManager* PageManager, Absbaseengine::TABSBaseFieldManager* FieldManager, TABSInternalDBTransactedAccessFile* MostUpdatedFile, TABSDiskTableData* TableData);
__fastcall virtual ~TABSDiskRecordManager(void);
void __fastcall Init(int RecordBufferSize, int DiskRecordBufferSize, int FieldCount);
void __fastcall LoadMostUpdated(char * Buf, int &Offset);
void __fastcall SaveMostUpdated(char * Buf, int &Offset);
void __fastcall LoadMetadata(Classes::TStream* Stream);
void __fastcall SaveMetadata(Classes::TStream* Stream);
void __fastcall CreateRecordPageIndex(void);
virtual void __fastcall Empty(int SessionID);
void __fastcall Delete(int SessionID);
virtual bool __fastcall AddRecord(int SessionID, char * RecordBuffer, Abstypes::TABSPageItemID &RecordID);
virtual bool __fastcall UpdateRecord(int SessionID, char * RecordBuffer, const Abstypes::TABSPageItemID &RecordID);
virtual bool __fastcall DeleteRecord(int SessionID, Abstypes::TABSPageItemID &RecordID);
virtual void __fastcall GetRecordBuffer(int SessionID, Abstypes::TABSNavigationInfo &NavigationInfo);
virtual int __fastcall CompareRecordID(const Abstypes::TABSPageItemID &RecordID1, const Abstypes::TABSPageItemID &RecordID2);
virtual __int64 __fastcall GetApproximateRecNo(int SessionID, const Abstypes::TABSPageItemID &RecordID);
void __fastcall SetRecNo(int SessionID, __int64 RecNo, Abstypes::TABSPageItemID &RecordID);
void __fastcall GetRecNo(int SessionID, const Abstypes::TABSPageItemID &RecordID, __int64 &RecNo);
void __fastcall RebuildRecordPageIndex(int SessionID);
void __fastcall ValidateRecordPageIndex(int SessionID);
__property Absbtree::TABSBTreeRecordPageIndex* RecordPageIndex = {read=FRecordPageIndex};
};
class DELPHICLASS TABSSmallBlobPage;
class PASCALIMPLEMENTATION TABSSmallBlobPage : public System::TObject
{
typedef System::TObject inherited;
protected:
Abspage::TABSPage* LPage;
void __fastcall SetBlobCount(int Value);
int __fastcall GetBlobCount(void);
Abstypes::PABSDiskBLOBHeader __fastcall BlobHeader(int Index);
char * __fastcall BlobData(int Index);
Word __fastcall GetNewBlobID(void);
public:
__fastcall TABSSmallBlobPage(Abspage::TABSPage* Page);
void __fastcall AddBlob(Abstypes::PABSDiskBLOBCache BlobCache, Abstypes::TABSPageItemID &PageItemID);
void __fastcall DeleteBlob(const Abstypes::TABSPageItemID &PageItemID, int &BlobSize);
void __fastcall ReadBlob(Abstypes::PABSDiskBLOBCache BlobCache, const Abstypes::TABSPageItemID &PageItemID);
__property int BlobCount = {read=GetBlobCount, write=SetBlobCount, nodefault};
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~TABSSmallBlobPage(void) { }
#pragma option pop
};
class DELPHICLASS TABSDTPCTableInfo;
class PASCALIMPLEMENTATION TABSDTPCTableInfo : public System::TObject
{
typedef System::TObject inherited;
private:
int TableID;
int TableSLockCount;
int TableRWLockCount;
bool IsMostUpdatedLoaded;
void __fastcall Clear(void);
public:
int TableState;
__fastcall TABSDTPCTableInfo(int aTableID);
__fastcall virtual ~TABSDTPCTableInfo(void);
void __fastcall TableIsSLocked(void);
void __fastcall TableIsSUnlocked(void);
void __fastcall TableIsRWLocked(void);
void __fastcall TableIsRWUnlocked(void);
bool __fastcall GetIsMostUpdatedLoaded(void);
void __fastcall SetIsMostUpdatedLoaded(int aTableState);
bool __fastcall IsTableLockedFromModification(void);
};
typedef DynamicArray<TABSDTPCTableInfo* > ABSDiskEngine__21;
class PASCALIMPLEMENTATION TABSDTPCSessionInfo : public System::TObject
{
typedef System::TObject inherited;
private:
DynamicArray<TABSDTPCTableInfo* > FTableInfo;
Classes::TList* FWorkTableIDs;
public:
__fastcall TABSDTPCSessionInfo(void);
__fastcall virtual ~TABSDTPCSessionInfo(void);
TABSDTPCTableInfo* __fastcall GetTableInfo(int TableID);
void __fastcall BeginWorkWithTable(int TableID);
void __fastcall EndWorkWithTable(int TableID);
bool __fastcall GetWorkTableState(int &WorkTableState);
};
class DELPHICLASS TABSDTPCSessionInfo;typedef DynamicArray<TABSDTPCSessionInfo* > ABSDiskEngine__41;
typedef DynamicArray<Abstypes::TABSTableListItem > ABSDiskEngine__02;
class PASCALIMPLEMENTATION TABSTableLocksFile : public System::TObject
{
typedef System::TObject inherited;
private:
TABSDiskPageManager* LPageManager;
TABSInternalDBDirectAccessFile* FHandle;
int FMaxSessionCount;
int __fastcall GetStartPageNo(void);
int __fastcall GetTableLockByteNo(int SessionID, Abstypes::TABSLockType LockType);
int __fastcall GetRecordLockByteNo(int SessionID);
int __fastcall GetRecordLockRecordIDByteNo(int SessionID);
public:
__fastcall TABSTableLocksFile(Abspage::TABSPageManager* PageManager);
__fastcall virtual ~TABSTableLocksFile(void);
int __fastcall CreateFile(int aMaxSessionCount);
void __fastcall DeleteFile(void);
void __fastcall OpenFile(int aStartPageNo);
void __fastcall CloseFile(void);
bool __fastcall LockTable(int SessionID, Abstypes::TABSLockType LockType);
bool __fastcall UnlockTable(int SessionID, Abstypes::TABSLockType LockType);
bool __fastcall IsTableLockedByAnyOtherSession(int SessionID, Abstypes::TABSLockType LockType);
bool __fastcall IsTableLockAllowed(int SessionID, Abstypes::TABSLockType LockType, bool AllowXIRWAfterSIRW = true);
bool __fastcall LockRecord(int SessionID, const Abstypes::TABSPageItemID &RecordID);
bool __fastcall UnlockRecord(int SessionID, const Abstypes::TABSPageItemID &RecordID);
bool __fastcall IsRecordLockedByAnyOtherSession(int SessionID, const Abstypes::TABSPageItemID &RecordID);
bool __fastcall LockFile(void);
bool __fastcall UnlockFile(void);
__property int MaxSessionCount = {read=FMaxSessionCount, nodefault};
__property int StartPageNo = {read=GetStartPageNo, nodefault};
};
typedef DynamicArray<Abstypes::TABSSystemDirectoryListItem > ABSDiskEngine__32;
struct TABSTableLock
{
public:
Abstypes::TABSLockType LockType;
int LocksFilePageNo;
int LockCount;
bool HasPhysicalLock;
bool IsXIRWAfterSIRWAllowed;
} ;
typedef TABSTableLock *PABSTableLock;
class DELPHICLASS TABSTableLockList;
class PASCALIMPLEMENTATION TABSTableLockList : public System::TObject
{
typedef System::TObject inherited;
private:
Classes::TList* FLockList;
bool __fastcall FindLock(Abstypes::TABSLockType LockType, int LocksFilePageNo, int &ItemNo)/* overload */;
bool __fastcall FindLock(Abstypes::TABSLockType LockType, int LocksFilePageNo, bool IsXIRWAfterSIRWAllowed, int &ItemNo)/* overload */;
bool __fastcall IsLockStronger(Abstypes::TABSLockType LockType1, Abstypes::TABSLockType LockType2);
public:
__fastcall TABSTableLockList(void);
__fastcall virtual ~TABSTableLockList(void);
void __fastcall AddLock(Abstypes::TABSLockType LockType, int LocksFilePageNo, bool HasPhysicalLock, bool IsXIRWAfterSIRWAllowed = true);
void __fastcall RemoveLock(Abstypes::TABSLockType LockType, int LocksFilePageNo, bool &HasPhysicalLock, bool IgnoreCount);
bool __fastcall LockExists(Abstypes::TABSLockType LockType, int LocksFilePageNo)/* overload */;
bool __fastcall LockExists(Abstypes::TABSLockType LockType, int LocksFilePageNo, bool IsXIRWAfterSIRWAllowed)/* overload */;
bool __fastcall StrongerLockExists(Abstypes::TABSLockType LockType, int LocksFilePageNo);
void __fastcall SetPhysicalLock(int ItemNo);
bool __fastcall IsWeakerNonPhysicalLock(int ItemNo, Abstypes::TABSLockType LockType);
};
typedef bool __fastcall (__closure *TBooleanFunctionForTimeOutCall)(void);
//-- var, const, procedure ---------------------------------------------------
extern PACKAGE AnsiString __fastcall PageTypeToStr(Word PageType);
extern PACKAGE bool __fastcall TryUsingTimeOut(TBooleanFunctionForTimeOutCall Func, int TryCount, int DelayMS);
extern PACKAGE void __fastcall CheckPageType(Word FoundType, Word WantedType, int ErrorCode);
extern PACKAGE bool __fastcall ABSInternalEncryptBuffer(Abssecurity::TABSCryptoAlgorithm CryptoAlg, char * inBuf, int Size, AnsiString Password);
extern PACKAGE bool __fastcall ABSInternalDecryptBuffer(Abssecurity::TABSCryptoAlgorithm CryptoAlg, char * inBuf, int Size, AnsiString Password);
extern PACKAGE bool __fastcall IsOSCriticalError(void);
} /* namespace Absdiskengine */
using namespace Absdiskengine;
#pragma pack(pop)
#pragma option pop
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // Absdiskengine
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -