mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -15,20 +15,18 @@
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
template<class Key, class Value, class HashContainer = std::unordered_map<Key, Value>>
|
||||
template <class Key, class Value, class HashContainer = std::unordered_map<Key, Value>>
|
||||
class FifoCache
|
||||
{
|
||||
template <typename K, typename V> friend class FifoCacheTest;
|
||||
template <typename K, typename V>
|
||||
friend class FifoCacheTest;
|
||||
|
||||
public:
|
||||
using Loader = std::function<void(Key const & key, Value & value)>;
|
||||
|
||||
/// \param capacity maximum size of the cache in number of items.
|
||||
/// \param loader Function which is called if it's necessary to load a new item for the cache.
|
||||
FifoCache(size_t capacity, Loader const & loader)
|
||||
: m_fifo(capacity), m_capacity(capacity), m_loader(loader)
|
||||
{
|
||||
}
|
||||
FifoCache(size_t capacity, Loader const & loader) : m_fifo(capacity), m_capacity(capacity), m_loader(loader) {}
|
||||
|
||||
/// \brief Loads value, if it's necessary, by |key| with |m_loader|, puts it to cache and
|
||||
/// returns the reference to the value to |m_map|.
|
||||
|
||||
Reference in New Issue
Block a user