2.9.16
Coherent GT
A modern user interface library for games
Coherent::UIGT::IDiskCache Class Referenceabstract

Interface for persisting cached data from the network. The user is free to use any persistency method for the cached data. More...

#include <Coherent/Coherent/UIGT/IDiskCache.h>

Classes

struct  CacheEntryId
 Describes a disk cache entry. More...
 

Public Member Functions

virtual bool SaveIndex (const void *buffer, unsigned int size)=0
 Called when the Disk cache index has to be saved NB: rewrite the whole index. More...
 
virtual unsigned GetIndexSize () const =0
 Returns the disk cache index size. More...
 
virtual bool LoadIndex (void *buffer, unsigned int *read)=0
 Loads the index of the disk cached. More...
 
virtual bool AppendContent (const CacheEntryId &entry, const void *buffer, unsigned int size)=0
 Called when the content of a cache entry has to be saved NB: Append the data in the file. More...
 
virtual unsigned GetContentSize (const CacheEntryId &entry) const =0
 Returns the cached content entry size. More...
 
virtual bool LoadContent (const CacheEntryId &entry, void *buffer, unsigned int *read)=0
 Loads the cached content entry. More...
 
virtual bool SaveHeaders (const CacheEntryId &entry, const void *buffer, unsigned int size)=0
 Called when the headers of a cache entry has to be saved. More...
 
virtual unsigned GetHeadersSize (const CacheEntryId &entry) const =0
 Returns the cached headers entry size. More...
 
virtual bool LoadHeaders (const CacheEntryId &entry, void *buffer, unsigned int *read)=0
 Loads the cached headers entry. More...
 
virtual double GetEntryTimestamp (const CacheEntryId &entry)=0
 Return the timestamp of last modification of the entry UTC time in seconds, counted from January 1, 1970. More...
 
virtual void DeleteEntry (const CacheEntryId &entry)=0
 Called when an entry must be deleted. Delete both the headers and content for the entry. More...
 
virtual void OnFinishAppendContent (const CacheEntryId &)
 Called after the last append of the content. More...
 

Detailed Description

Interface for persisting cached data from the network. The user is free to use any persistency method for the cached data.

Member Function Documentation

◆ AppendContent()

virtual bool Coherent::UIGT::IDiskCache::AppendContent ( const CacheEntryId entry,
const void *  buffer,
unsigned int  size 
)
pure virtual

Called when the content of a cache entry has to be saved NB: Append the data in the file.

Parameters
entrythe cached entry info
bufferthe data to save
sizethe size of the data
Returns
if the operation was successful

◆ DeleteEntry()

virtual void Coherent::UIGT::IDiskCache::DeleteEntry ( const CacheEntryId entry)
pure virtual

Called when an entry must be deleted. Delete both the headers and content for the entry.

Parameters
entrythe cached entry info

◆ GetContentSize()

virtual unsigned Coherent::UIGT::IDiskCache::GetContentSize ( const CacheEntryId entry) const
pure virtual

Returns the cached content entry size.

Parameters
entrythe cached entry info
Returns
size of the cached content entry

◆ GetEntryTimestamp()

virtual double Coherent::UIGT::IDiskCache::GetEntryTimestamp ( const CacheEntryId entry)
pure virtual

Return the timestamp of last modification of the entry UTC time in seconds, counted from January 1, 1970.

Parameters
entrythe cache entry to return information about
Returns
unix time since last modification

◆ GetHeadersSize()

virtual unsigned Coherent::UIGT::IDiskCache::GetHeadersSize ( const CacheEntryId entry) const
pure virtual

Returns the cached headers entry size.

Parameters
entrythe cached entry info
Returns
size of the cached headers entry

◆ GetIndexSize()

virtual unsigned Coherent::UIGT::IDiskCache::GetIndexSize ( ) const
pure virtual

Returns the disk cache index size.

Returns
size of the disk cache index

◆ LoadContent()

virtual bool Coherent::UIGT::IDiskCache::LoadContent ( const CacheEntryId entry,
void *  buffer,
unsigned int *  read 
)
pure virtual

Loads the cached content entry.

Parameters
entrythe cached entry info
bufferwhere to save the data
readin/out the size of the buffer. Should be set to the byte count of the read data
Returns
if the operation was successful

◆ LoadHeaders()

virtual bool Coherent::UIGT::IDiskCache::LoadHeaders ( const CacheEntryId entry,
void *  buffer,
unsigned int *  read 
)
pure virtual

Loads the cached headers entry.

Parameters
entrythe cached entry info
bufferwhere to save the data
readin/out the size of the buffer. Should be set to the byte count of the read data
Returns
if the operation was successful

◆ LoadIndex()

virtual bool Coherent::UIGT::IDiskCache::LoadIndex ( void *  buffer,
unsigned int *  read 
)
pure virtual

Loads the index of the disk cached.

Parameters
bufferwhere to save the data
readin/out the size of the buffer. Should be set to the byte count of the read data
Returns
if the operation was successful

◆ OnFinishAppendContent()

virtual void Coherent::UIGT::IDiskCache::OnFinishAppendContent ( const CacheEntryId )
inlinevirtual

Called after the last append of the content.

Parameters
entrythe cached entry info

◆ SaveHeaders()

virtual bool Coherent::UIGT::IDiskCache::SaveHeaders ( const CacheEntryId entry,
const void *  buffer,
unsigned int  size 
)
pure virtual

Called when the headers of a cache entry has to be saved.

Parameters
entrythe cached entry info
bufferthe data to save
sizethe size of the data
Returns
if the operation was successful

◆ SaveIndex()

virtual bool Coherent::UIGT::IDiskCache::SaveIndex ( const void *  buffer,
unsigned int  size 
)
pure virtual

Called when the Disk cache index has to be saved NB: rewrite the whole index.

Parameters
bufferthe data to save
sizethe size of the data
Returns
if the operation was successful