10 #ifndef GUARD_PERST_INTERFACE_H_INCLUDE
11 #define GUARD_PERST_INTERFACE_H_INCLUDE
13 #include <perst/perst-config.h>
24 const PERST_STRING & name) = 0;
29 const PERST_STRING & name =
"") = 0;
34 const PERST_STRING & name,
35 int predicted_count = -1) = 0;
40 const PERST_STRING & name) = 0;
45 const PERST_STRING & name =
"") = 0;
49 arrayIndex ()
const = 0;
62 groupPath ()
const = 0;
67 const PERST_STRING & name) = 0;
72 const PERST_SLIST & name) = 0;
78 const PERST_STRING & name) = 0;
83 const PERST_STRING & name) = 0;
88 const PERST_STRING & name) = 0;
93 const PERST_STRING & name) = 0;
98 const PERST_STRING & name) = 0;
104 const PERST_STRING & name,
105 const PERST_STRING & default_val) {
106 if (hasKey (name))
return valueS (name);
107 else return default_val;
113 const PERST_STRING & name,
114 const PERST_SLIST & default_val) {
115 if (hasKey (name))
return valueSList (name);
116 else return default_val;
122 const PERST_STRING & name,
123 int64_t default_val) {
124 if (hasKey (name))
return valueInt (name);
125 else return default_val;
131 const PERST_STRING & name,
132 uint64_t default_val) {
133 if (hasKey (name))
return valueUInt (name);
134 else return default_val;
140 const PERST_STRING & name,
141 double default_val) {
142 if (hasKey (name))
return valueDbl (name);
143 else return default_val;
150 const PERST_STRING & name,
151 const PERST_STRING & value) = 0;
156 const PERST_STRING & name,
157 const PERST_SLIST & value) = 0;
162 const PERST_STRING & name,
168 const PERST_STRING & name,
174 const PERST_STRING & name,
176 return setValue (name, (int64_t)value);
182 const PERST_STRING & name,
186 #endif // GUARD_PERST_INTERFACE_H_INCLUDE
double valueDbl(const PERST_STRING &name, double default_val)
Get the real value for a key; the value type MUST be real.
Definition: perst_interface.h:139
Interface class for persistent storage.
Definition: perst_interface.h:17
PERST_SLIST valueSList(const PERST_STRING &name, const PERST_SLIST &default_val)
Get the string list for a key; the value type MUST be an array of strings.
Definition: perst_interface.h:112
uint64_t valueUInt(const PERST_STRING &name, uint64_t default_val)
Get the integer value for a key; the value type MUST be integer.
Definition: perst_interface.h:130
int64_t valueInt(const PERST_STRING &name, int64_t default_val)
Get the integer value for a key; the value type MUST be integer.
Definition: perst_interface.h:121
virtual bool setValue(const PERST_STRING &name, int value)
Set the integer value for a key.
Definition: perst_interface.h:173
PERST_STRING valueS(const PERST_STRING &name, const PERST_STRING &default_val)
Get the string value for a key; the value type MUST be string.
Definition: perst_interface.h:103