@@ -33,12 +33,12 @@ class DiskCache;
3333
3434/* *
3535 * @brief A default cache that provides an in-memory LRU cache and persistence
36- * of the cached key-value pairs.
36+ * of cached key-value pairs.
3737 *
3838 * @note By default, the downloaded data is cached only in memory.
3939 * To enable the persistent cache, define
40- * `olp::cache::CacheSettings::disk_path`. On iOS, the path is relative to the
41- * application data folder.
40+ * `olp::cache::CacheSettings::disk_path`. On iOS, the path is relative to
41+ * the application data folder.
4242 *
4343 * The default maximum size of the persistent cache is 32 MB. If the entire
4444 * available disk space should be used, set
@@ -55,86 +55,98 @@ class CORE_API DefaultCache : public KeyValueCache {
5555 public:
5656 /* ! The storage open result type */
5757 enum StorageOpenResult {
58- Success, /* !< operation succeeded */
59- OpenDiskPathFailure /* !< disk cache failure */
58+ Success, /* !< The operation succeeded. */
59+ OpenDiskPathFailure /* !< The disk cache failure. */
6060 };
6161
6262 /* *
63- * @brief Parameterized constructor.
64- * @param settings Settings for the cache.
63+ * @brief Creates the `DefaultCache` instance.
64+ *
65+ * @param settings The cache settings.
6566 */
6667 DefaultCache (const CacheSettings& settings = CacheSettings());
6768 ~DefaultCache () override ;
6869
6970 /* *
70- * @brief Opens the cache to start read/ write operations.
71+ * @brief Opens the cache to start read and write operations.
7172 *
72- * @return StorageOpenResult if there were problems opening any of the
73- * provided pathes on the disk.
73+ * @return ` StorageOpenResult` if there are problems opening any of
74+ * the provided paths on the disk.
7475 */
7576 StorageOpenResult Open ();
7677
7778 /* *
78- * @brief Closes the cache for use .
79+ * @brief Closes the cache.
7980 */
8081 void Close ();
8182
8283 /* *
83- * @brief Clears the contents of the cache.
84- * @return Returns true if the operation is successfull, false otherwise.
84+ * @brief Clears the cache content.
85+ *
86+ * @return True if the operation is successful; false otherwise.
8587 */
8688 bool Clear ();
8789
8890 /* *
89- * @brief Stores the key-value pair into the cache.
90- * @param key Key for this value
91- * @param value The value of any type
92- * @param encoder A method provided to encode the specified value into a
93- * string
94- * @param expiry Time in seconds to when pair will expire
95- * @return Returns true if the operation is successfull, false otherwise.
91+ * @brief Stores the key-value pair in the cache.
92+ *
93+ * @param key The key for this value.
94+ * @param value The value of any type.
95+ * @param encoder Encodes the specified value into a string.
96+ * @param expiry The expiry time (in seconds) of the key-value pair.
97+ *
98+ * @return True if the operation is successful; false otherwise.
9699 */
97100 bool Put (const std::string& key, const boost::any& value,
98101 const Encoder& encoder, time_t expiry) override ;
99102
100103 /* *
101- * @brief Stores the raw binary data as value into the cache.
102- * @param key Key for this value
103- * @param value binary data to be stored
104- * @param expiry Time in seconds to when pair will expire
105- * @return Returns true if the operation is successfull, false otherwise.
104+ * @brief Stores the raw binary data as a value in the cache.
105+ *
106+ * @param key The key for this value.
107+ * @param value The binary data that should be stored.
108+ * @param expiry The expiry time (in seconds) of the key-value pair.
109+ *
110+ * @return True if the operation is successful; false otherwise.
106111 */
107112 bool Put (const std::string& key, const KeyValueCache::ValueTypePtr value,
108113 time_t expiry) override ;
109114
110115 /* *
111116 * @brief Gets the key-value pair from the cache.
112- * @param key Key to look for
113- * @param decoder A method is provided to decode a value from a string if
114- * needed
117+ *
118+ * @param key The key that is used to look for the key-value pair.
119+ * @param decoder Decodes the value from a string.
120+ *
121+ * @return The key-value pair.
115122 */
116123 boost::any Get (const std::string& key, const Decoder& decoder) override ;
117124
118125 /* *
119126 * @brief Gets the key and binary data from the cache.
120- * @param key Key to look for
127+ *
128+ * @param key The key that is used to look for the binary data.
129+ *
130+ * @return The key and binary data.
121131 */
122132 KeyValueCache::ValueTypePtr Get (const std::string& key) override ;
123133
124134 /* *
125135 * @brief Removes the key-value pair from the cache.
126- * @param key Key for the value to remove from cache
127136 *
128- * @return Returns true if the operation is successfull, false otherwise.
137+ * @param key The key for the value.
138+ *
139+ * @return True if the operation is successful; false otherwise.
129140 */
130141 bool Remove (const std::string& key) override ;
131142
132143 /* *
133- * @brief Removes the values with the keys matching the given
144+ * @brief Removes the values with the keys that match the given
134145 * prefix from the cache.
135- * @param prefix Prefix to look for
136146 *
137- * @return Returns true on removal, false otherwise.
147+ * @param prefix The prefix that matches the keys.
148+ *
149+ * @return True if the values are removed; false otherwise.
138150 */
139151 bool RemoveKeysWithPrefix (const std::string& prefix) override ;
140152
0 commit comments