@@ -34,8 +34,6 @@ class ZSwapObject
34
34
/* *
35
35
* Sets the ZSwap enabled value.
36
36
* @param Value New value.
37
- * @exception Raises an instance of std::invalid_argument if cannot set
38
- * the proposed value.
39
37
*/
40
38
void SetZSwapEnabled (const std::string&) const ;
41
39
@@ -48,8 +46,6 @@ class ZSwapObject
48
46
/* *
49
47
* Sets the same filled pages enabled value.
50
48
* @param Value New value.
51
- * @exception Raises an instance of std::invalid_argument if cannot set
52
- * the proposed value.
53
49
*/
54
50
void SetZSwapSameFilledPages (const std::string&) const ;
55
51
@@ -62,8 +58,6 @@ class ZSwapObject
62
58
/* *
63
59
* Sets the maximum pool percentage value.
64
60
* @param Value New value.
65
- * @exception Raises an instance of std::invalid_argument if cannot set
66
- * the proposed value.
67
61
*/
68
62
void SetZSwapMaxPoolPercent (const std::string&) const ;
69
63
@@ -76,8 +70,6 @@ class ZSwapObject
76
70
/* *
77
71
* Sets the compression algorithm name.
78
72
* @param Value New value.
79
- * @exception Raises an instance of std::invalid_argument if cannot set
80
- * the proposed value.
81
73
*/
82
74
void SetZSwapCompressor (const std::string&) const ;
83
75
@@ -90,8 +82,6 @@ class ZSwapObject
90
82
/* *
91
83
* Sets the kernel's zpool type.
92
84
* @param Value New value.
93
- * @exception Raises an instance of std::invalid_argument if cannot set
94
- * the proposed value.
95
85
*/
96
86
void SetZSwapZpool (const std::string&) const ;
97
87
@@ -104,8 +94,6 @@ class ZSwapObject
104
94
/* *
105
95
* Sets the accept threshold percentage value.
106
96
* @param Value New value.
107
- * @exception Raises an instance of std::invalid_argument if cannot set
108
- * the proposed value.
109
97
*/
110
98
void SetZSwapAcceptThresholdPercent (const std::string&) const ;
111
99
@@ -118,8 +106,6 @@ class ZSwapObject
118
106
/* *
119
107
* Sets the non same filled pages enabled value.
120
108
* @param Value New value.
121
- * @exception Raises an instance of std::invalid_argument if cannot set
122
- * the proposed value.
123
109
*/
124
110
void SetZSwapNonSameFilledPages (const std::string&) const ;
125
111
@@ -132,8 +118,6 @@ class ZSwapObject
132
118
/* *
133
119
* Sets the exclusive loads enabled value.
134
120
* @param Value New value.
135
- * @exception Raises an instance of std::invalid_argument if cannot set
136
- * the proposed value.
137
121
*/
138
122
void SetZSwapExclusiveLoads (const std::string&) const ;
139
123
@@ -146,8 +130,6 @@ class ZSwapObject
146
130
/* *
147
131
* Sets the shrinker enabled value.
148
132
* @param Value New value.
149
- * @exception Raises an instance of std::invalid_argument if cannot set
150
- * the proposed value.
151
133
*/
152
134
void SetZSwapShrinkerEnabled (const std::string&) const ;
153
135
@@ -157,31 +139,6 @@ class ZSwapObject
157
139
*/
158
140
bool IsAvailable () const ;
159
141
private:
160
- /* *
161
- * Stores the ZSwap log message template.
162
- */
163
- const std::string ZSwapMessageLog = " Writing a new value \" {1}\" to the \" {0}\" variable." ;
164
-
165
- /* *
166
- * Stores the ZSwap error message template for Y or N values.
167
- */
168
- const std::string ZSwapErrorBool = " The requested value for the \" {0}\" variable is incorrect (only Y or N are supported)." ;
169
-
170
- /* *
171
- * Stores the ZSwap error message template for range values.
172
- */
173
- const std::string ZSwapErrorRange = " The requested value for the \" {0}\" variable is out of range [0..100]." ;
174
-
175
- /* *
176
- * Stores the ZSwap error message template for empty values.
177
- */
178
- const std::string ZSwapErrorEmpty = " The requested value for the \" {0}\" variable is empty." ;
179
-
180
- /* *
181
- * Stores the ZSwap error message template for incorrect kernel version.
182
- */
183
- const std::string ZSwapErrorKernel = " Configuring the \" {0}\" variable is not possible on current kernel!" ;
184
-
185
142
/* *
186
143
* Stores the ZSwap kernel module parameters path.
187
144
*/
@@ -242,36 +199,43 @@ class ZSwapObject
242
199
/* *
243
200
* Reads the value of the ZSwap kernel module by the specified name.
244
201
* @param Name Value name.
245
- * @exception Raises an instance of std::invalid_argument if cannot set
246
- * the proposed value.
247
- * @returns Value.
202
+ * @returns Value or N/A if the variable is not supported.
248
203
*/
249
204
std::string ReadZSwapValue (const std::string&) const ;
250
205
251
206
/* *
252
207
* Prints the log entry to the standard output.
253
- * @param Name Parameter name.
254
- * @param Value Parameter value.
208
+ * @param Name Variable name.
209
+ * @param Value Variable value.
255
210
*/
256
211
void WriteLogEntry (const std::string&, const std::string&) const ;
257
212
258
213
/* *
259
- * Checks if the value is in the [0..100] range .
260
- * @param Value Value to check .
261
- * @returns Check results .
262
- * @retval true If the value is outside the [0..100] range.
263
- * @retval false Otherwise .
214
+ * Checks if the value is Y or N .
215
+ * @param Name Variable name .
216
+ * @param Value Variable value to check .
217
+ * @exception Raises an instance of std::invalid_argument if the
218
+ * value does not match the criteria .
264
219
*/
265
- bool CheckPercent ( const std::string&) const ;
220
+ void CheckValueBool ( const std::string&, const std::string&) const ;
266
221
267
222
/* *
268
- * Checks if the value is Y or N.
269
- * @param Value Value to check.
270
- * @returns Check results.
271
- * @retval true If the value does not meet the specified criteria.
272
- * @retval false Otherwise.
223
+ * Checks if the value is empty.
224
+ * @param Name Variable name.
225
+ * @param Value Variable value to check.
226
+ * @exception Raises an instance of std::invalid_argument if the
227
+ * value does not match the criteria.
228
+ */
229
+ void CheckValueEmpty (const std::string&, const std::string&) const ;
230
+
231
+ /* *
232
+ * Checks if the value is in the [0..100] range.
233
+ * @param Name Variable name.
234
+ * @param Value Variable value to check.
235
+ * @exception Raises an instance of std::invalid_argument if the
236
+ * value does not match the criteria.
273
237
*/
274
- bool CheckEnabled ( const std::string&) const ;
238
+ void CheckValueRange ( const std::string&, const std::string&) const ;
275
239
};
276
240
277
241
#endif // ZSWAPOBJECT_HPP
0 commit comments