rcpp_framework/core/http/http_session.h

44 lines
791 B
C
Raw Normal View History

2021-08-04 20:32:51 +02:00
#ifndef HTTP_SESSION_H
#define HTTP_SESSION_H
#include <map>
#include "core/reference.h"
2021-08-04 20:32:51 +02:00
#include "core/string.h"
#include "core/variant.h"
#include "core/threading/mutex.h"
class HTTPSession : public Reference {
RCPP_OBJECT(HTTPSession, Reference);
2021-08-04 20:32:51 +02:00
public:
void add(const String &key, const Variant &value);
void remove(const String &key);
bool has(const String &key);
2021-08-04 20:32:51 +02:00
Variant get(const String &key);
2022-01-09 14:51:04 +01:00
const Variant &get_const(const String &key);
Object *get_object(const String &key);
Ref<Reference> get_reference(const String &key);
int get_int(const String &key);
2021-08-04 20:32:51 +02:00
String session_id;
int id;
2021-08-04 20:32:51 +02:00
void clear();
void reset();
std::map<String, Variant> *get_data();
2021-08-04 20:32:51 +02:00
HTTPSession();
~HTTPSession();
protected:
Mutex _mutex;
2021-08-04 20:32:51 +02:00
std::map<String, Variant> _data;
2021-08-04 20:32:51 +02:00
};
#endif