Loading...
Searching...
No Matches
etl::icache< TKey, TValue > Class Template Referenceabstract

## 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
virtual void | write (const TKey &key, const TValue &value)=0
virtual void | flush ()=0

## Protected Types

typedef ETL_OR_STD::pair< TKey, TValue > | key_value_t

## Protected Attributes

bool | write_through
etl::delegate< key_value_t &(void)> * | read_store
etl::delegate< void(const key_value_t &)> * | write_store

## Member Function Documentation

## flush()

template<typename TKey, typename TValue>

virtual void etl::icache< TKey, TValue >::flush | ( |  | ) |

pure virtual

The overridden function should write all changed values to the store.

## read()

template<typename TKey, typename TValue>

virtual const T & etl::icache< TKey, TValue >::read | ( | const TKey & | key | ) | const

pure virtual

Reads from the cache. May read from the store using read_store.

## write()

template<typename TKey, typename TValue>

virtual void etl::icache< TKey, TValue >::write | ( | const TKey & | key,
|  | const TValue & | value )

pure virtual

Writes to the cache. May write to the store using write_store.

## Member Data Documentation

## read_store

template<typename TKey, typename TValue>

etl::delegate<key_value_t&(void)>* etl::icache< TKey, TValue >::read_store

protected

A function that will read a value from the store into the cache.

## write_store

template<typename TKey, typename TValue>

etl::delegate<void(const key_value_t&)>* etl::icache< TKey, TValue >::write_store

protected

A function that will write a value from the cache into the store.

## write_through

template<typename TKey, typename TValue>

bool etl::icache< TKey, TValue >::write_through

protected

If true, the cache should write changed items back to the store immediately. If false then a flush() or destruct will be required.

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

- include/etl/experimental/icache.h