Skip to content

Commit

Permalink
Update: Comments on public methods
Browse files Browse the repository at this point in the history
Comments on public APIs changed from primitive type to generic types
  • Loading branch information
s-bose7 committed Jul 5, 2024
1 parent 964feb1 commit d892bfc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/memcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);

};
Expand Down

0 comments on commit d892bfc

Please sign in to comment.