openMSX
Public Member Functions | Protected Member Functions | List of all members
openmsx::TTData Class Referenceabstract

The TigerTree class will query the to-be-hashed data via this abstract interface. More...

#include <TigerTree.hh>

Inheritance diagram for openmsx::TTData:
Inheritance graph
[legend]

Public Member Functions

virtual uint8_t * getData (size_t offset, size_t size)=0
 Return the requested portion of the to-be-hashed data block.
 
virtual bool isCacheStillValid (time_t &time)=0
 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.
 

Protected Member Functions

 ~TTData ()=default
 

Detailed Description

The TigerTree class will query the to-be-hashed data via this abstract interface.

This allows to e.g. fetch the data from a file.

Definition at line 43 of file TigerTree.hh.

Constructor & Destructor Documentation

◆ ~TTData()

openmsx::TTData::~TTData ( )
protecteddefault

Member Function Documentation

◆ getData()

virtual uint8_t * openmsx::TTData::getData ( size_t  offset,
size_t  size 
)
pure virtual

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.

Implemented in TTTestData.

◆ isCacheStillValid()

virtual bool openmsx::TTData::isCacheStillValid ( time_t &  time)
pure virtual

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.

Implemented in TTTestData.


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