PDFium Delphi Component Docs

คุณสมบัติ TextSnapshotCacheHitCount

Component: TPdf  ·  Unit: PDFium
นับจำนวนครั้งที่อ่าน text snapshot แล้วให้บริการจาก snapshot ของหน้าที่เก็บไว้

Syntax

property TextSnapshotCacheHitCount: Int64; // read only

Description

ตัวนับเพิ่มขึ้นหนึ่งทุกครั้งที่เข้าถึง TextPageSnapshot แล้วหน้านั้นมี snapshot ที่ valid อยู่แล้ว hit จะทำให้ slot ของหน้ากลับมาเป็นตัวล่าสุดในลำดับ least-recently-use จับต้อง entry ใน cache governor ที่ใช้ร่วมกัน แล้วคืน deep copy ของ snapshot ที่เก็บไว้

ผู้บริโภคอย่าง GetStructuredText และ GetTextInReadingOrder แบบเรียงตาม physical layout ใช้ snapshot ชุดเดียวกันซ้ำ การอ่านซ้ำของพวกมันจึงถูกนับเป็น hit ในหน้านี้ด้วย

ค่านี้สะสมตลอดอายุของ instance TPdf และไม่เคยรีเซ็ต

Remarks

การอ่านถูกปกป้องด้วย render lock เดียวกับที่ใช้เข้าถึงหน้าของ PDFium ระดับ native

การเปลี่ยน capacity การแก้หน้า การโหลดเอกสารใหม่ และการล้าง cache ไม่กระทบตัวนับ สิ่งเหล่านี้เปลี่ยนแค่สิ่งที่ถูกเก็บไว้ ไม่ใช่สิ่งที่เกิดขึ้นไปแล้ว

เพราะค่าที่คืนทุกตัวเป็น deep copy hit จึงไม่มีทางเปิดให้ผู้เรียกไปแก้สตริงหรืออาร์เรย์ที่เก็บใน cache ได้

Example

Structured := Pdf.GetStructuredText(1, Options);
Structured := Pdf.GetStructuredText(1, Options);
// The second read is served by one cached snapshot

See Also

TextSnapshotCacheMissCount, TextSnapshotCacheCount, TextSnapshotCacheCapacity, TextPageSnapshot, GetStructuredText