2 #include "../acl_cpp_define.hpp" 4 #include "../stdlib/dbuf_pool.hpp" 5 #include "../stdlib/string.hpp" 7 #ifndef ACL_CLIENT_ONLY 53 session(time_t ttl = 0,
const char* sid = NULL);
75 void set_sid(
const char* sid);
91 virtual bool set(
const char*
name,
const char* value);
100 virtual bool set(
const char*
name,
const void* value,
size_t len);
110 virtual bool set_delay(
const char*
name,
const void* value,
size_t len);
120 const char* get(
const char*
name);
141 virtual bool del_delay(
const char*
name);
142 virtual bool del(
const char*
name);
152 bool set_ttl(time_t ttl,
bool delay);
169 virtual bool remove(
void) = 0;
176 virtual bool get_attrs(std::map<string, session_string>& attrs) = 0;
184 virtual bool get_attrs(
const std::vector<string>& names,
185 std::vector<session_string>& values);
192 virtual bool set_attrs(
const std::map<string, session_string>& attrs) = 0;
196 virtual bool set_timeout(time_t ttl) = 0;
200 static void serialize(
const std::map<string, session_string>& attrs,
205 std::map<string, session_string>& attrs);
208 static void attrs_clear(std::map<string, session_string>& attrs);
225 #endif // ACL_CLIENT_ONLY time_t get_ttl(void) const
session_string(const char *s)
HTTP_API void const char * name
void serialize(T &o, string &buf)
std::map< string, session_string > attrs_cache_
bool deserialize(json &j, T &o, string *err=NULL)
std::map< string, session_string > attrs_
session_string(const session_string &ss)
virtual const char * get_sid(void) const
session_string(size_t n=64)
session_string(const string &s)