Loading...
Searching...
No Matches
Threedim::RecentParseCache< T > Class Template Reference

The last few parses of the files a loader port read. More...

Detailed Description

template<typename T>
class Threedim::RecentParseCache< T >

The last few parses of the files a loader port read.

Undo/redo of a graph edit, or anything else re-initialising the renderers, re-runs a file port: without a cache every step re-parses the whole file on the GUI thread. A parse is immutable once made, so recent results are shared.

Keyed by file name, size, modification time and a hash of the first and last 64 KiB of the bytes read: hashing the whole file on every lookup would cost a full pass over a file of hundreds of megabytes. An entry expires some time after its last use, as the key does not cover the external files (buffers, textures) an asset may reference.

Classes

struct  Key
 

Public Member Functions

std::shared_ptr< const T > find (const Key &k)
 
void store (Key k, std::shared_ptr< const T > data)
 

Static Public Member Functions

static Key key (std::string_view filename, std::string_view bytes)
 

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