Embedded Template Library 1.0
|
Public Member Functions | |
void | set_read_function (etl::delegate< key_value_t &(void)> reader_) |
void | set_write_function (etl::delegate< void(const key_value_t &)> writer_) |
void | set_write_through (bool write_through_) |
virtual const T & | read (const TKey &key) const =0 |
Reads from the cache. May read from the store using read_store. | |
virtual void | write (const TKey &key, const TValue &value)=0 |
Writes to the cache. May write to the store using write_store. | |
virtual void | flush ()=0 |
The overridden function should write all changed values to the store. | |
Protected Types | |
typedef ETL_OR_STD::pair< TKey, TValue > | key_value_t |
Protected Attributes | |
bool | write_through |
If true, the cache should write changed items back to the store immediately. If false then a flush() or destruct will be required. | |
etl::delegate< key_value_t &(void)> * | read_store |
A function that will read a value from the store into the cache. | |
etl::delegate< void(const key_value_t &)> * | write_store |
A function that will write a value from the cache into the store. | |