rcpp_framework/core/http/http_session.h

45 lines
993 B
C
Raw Normal View History

2021-08-04 20:32:51 +02:00
#ifndef HTTP_SESSION_H
#define HTTP_SESSION_H
#include "core/string.h"
2021-08-04 20:32:51 +02:00
#include "core/object.h"
#include "core/reference.h"
2021-08-04 20:32:51 +02:00
#include <map>
#include <mutex>
class HTTPSession : public Object {
public:
void add_object(const String &key, Object *obj);
void remove_object(const String &key);
Object *get_object(const String &key);
2021-08-04 20:32:51 +02:00
void add_reference(const String &key, const Ref<Reference> &ref);
void remove_reference(const String &key);
Ref<Reference> get_reference(const String &key);
void add_int(const String &key, const int val);
void remove_int(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, int> get_int_data();
2021-08-04 20:32:51 +02:00
HTTPSession();
~HTTPSession();
protected:
std::mutex _mutex;
//todo make something similar to godot's variant. (Or get godot's variant lol)
std::map<String, Object *> _data;
std::map<String, Ref<Reference> > _reference_data;
std::map<String, int> _int_data;
2021-08-04 20:32:51 +02:00
};
#endif