From d892bfc7af1cb7d4511a3d1c8ac71db61abf6dc4 Mon Sep 17 00:00:00 2001 From: Sudip Bose Date: Fri, 5 Jul 2024 14:16:00 +0530 Subject: [PATCH] Update: Comments on public methods Comments on public APIs changed from primitive type to generic types --- include/memcache.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/memcache.h b/include/memcache.h index 797ef86..0af27dc 100644 --- a/include/memcache.h +++ b/include/memcache.h @@ -105,20 +105,20 @@ class MemCache { ~MemCache(); /* - * get(int key) Gets the value of the key + * get(K key) Gets the value of the key * if the key exists in the cache. Otherwise, returns default value of V. */ V get(K key); /* - * put(int key, int value, int ttl = -1) + * put(K key, V value, int ttl = -1) * Update the value of the key if present, or inserts the key if not already present. * When the cache reaches its capacity, apply eviction policy before inserting a new item. */ void put(K key, V value, unsigned long ttl = 0); /* - * exists(int key): Check for existence of a particular key. + * exists(K key): Check for existence of a particular key. * returns true if found. Otherwise, returns false */ bool exists(K key); @@ -127,7 +127,7 @@ class MemCache { unsigned int size(); /* - * remove(int key): Delete a particular key from the cache. + * remove(K key): Delete a particular key from the cache. * Returns true if key found and removed. Otherwise, returns false */ bool remove(K key); @@ -137,7 +137,7 @@ class MemCache { */ bool clear(); - // resize(int new_capacity): Resize the cache. + // resize(size_t new_capacity): Resize the cache. void resize(size_t new_capacity); };