openMSX
Public Member Functions | Public Attributes | List of all members
TTTestData Struct Referencefinal
Inheritance diagram for TTTestData:
Inheritance graph
[legend]
Collaboration diagram for TTTestData:
Collaboration graph
[legend]

Public Member Functions

uint8_t * getData (size_t offset, size_t) override
 Return the requested portion of the to-be-hashed data block.
 
bool isCacheStillValid (time_t &) override
 Because TTH calculation of a large file takes some time (a few 1/10s for a hard disk image) we try to cache previous calculations.
 

Public Attributes

uint8_t * buffer
 

Additional Inherited Members

- Protected Member Functions inherited from openmsx::TTData
 ~TTData ()=default
 

Detailed Description

Definition at line 9 of file TigerTree_test.cc.

Member Function Documentation

◆ getData()

uint8_t * TTTestData::getData ( size_t  offset,
size_t  size 
)
inlineoverridevirtual

Return the requested portion of the to-be-hashed data block.

Special requirement: it should be allowed to temporarily overwrite the byte one position before the returned pointer.

Implements openmsx::TTData.

Definition at line 11 of file TigerTree_test.cc.

References buffer.

◆ isCacheStillValid()

bool TTTestData::isCacheStillValid ( time_t &  time)
inlineoverridevirtual

Because TTH calculation of a large file takes some time (a few 1/10s for a hard disk image) we try to cache previous calculations.

This method makes sure we don't wrongly reuse the data. E.g. after it has been modified (by openmsx or even externally).

Note that the current implementation of the caching is only suited for files. Refactor this if we ever need some different.

Implements openmsx::TTData.

Definition at line 16 of file TigerTree_test.cc.

Member Data Documentation

◆ buffer

uint8_t* TTTestData::buffer

Definition at line 21 of file TigerTree_test.cc.

Referenced by getData(), and TEST_CASE().


The documentation for this struct was generated from the following file: