RacheSourceRache is a library for resource caches.
More specifically, Rache provides modules implementing caches for resources. These caches are parametrised by cache-policies: replacement policy and maximum size. The caches also provide a clean-up mechanism to deal with resource tear-down.
TRANSFER are caches in which resources can be put and from which resources can be taken. More precisely, caches where the ownership of the resources (the responsibility to clean them up) can be transferred into and out of the cache.
BORROW are caches in which resources can be borrowed but never transferred. In other words, the cache retains ownership of all resources.
All caches of Rache have either the TRANSFER interface (for caches with transfer of ownership) or the BORROW interface (for caches with borrowing of resources). Their behaviour can be tweaked by the parameters below.
REPLACEMENT is for defining the replacement policy of a cache. LRU is for "Least Recently Used", meaning that when a supernumerary item is inserted in the cache, the least recently used item is removed to make room. FIFO is for "First-In, First-Out" meaning that when a supernumerary item is inserted in the cache, the oldest inserted element is removed to make room.
Transfer(R)(H) is a TRANSFER indexed by H and govern by the replacement policy R.
Borrow(R)(H) is a BORROW indexed by H and govern by the replacement policy R.
EmptyTransferMap(H) is a transfer-map module but it only supports the empty map: a map with zero elements.
SingletonTransferMap(H) is a transfer-map module but it only supports singleton maps: maps with at most one element.
EmptyBorrowMap(H) is a borrow-map module but it only supports the empty map: a map with zero elements.
SingletonBorrowMap(H) is a borrow-map module but it only supports singleton maps: maps with at most one element.