pandemonium_engine/modules/web/http/web_server.h

41 lines
691 B
C++
Raw Normal View History

#ifndef WEB_SERVER_H
#define WEB_SERVER_H
2022-06-26 21:34:29 +02:00
#include "core/os/rw_lock.h"
#include "scene/main/node.h"
2022-06-26 21:34:29 +02:00
class WebServerRequest;
class WebNode;
2022-06-26 21:34:29 +02:00
class WebServer : public Node {
GDCLASS(WebServer, Node);
public:
2022-06-26 21:34:29 +02:00
NodePath get_web_root_path() const;
void set_web_root_path(const NodePath &path);
WebNode *get_web_root();
2022-06-26 21:34:29 +02:00
void set_web_root(WebNode *root);
2022-06-26 21:34:29 +02:00
Node *get_web_root_bind();
void set_web_root_bind(Node *root);
2022-06-27 01:03:01 +02:00
void server_handle_request(Ref<WebServerRequest> request);
2022-06-26 21:34:29 +02:00
void request_write_lock();
WebServer();
2022-06-26 21:34:29 +02:00
~WebServer();
protected:
2022-06-26 21:34:29 +02:00
static void _bind_methods();
NodePath _web_root_path;
WebNode *_web_root;
2022-06-26 21:34:29 +02:00
bool _write_lock_requested;
RWLock _rw_lock;
};
2022-06-26 21:34:29 +02:00
#endif