Webserv
Loading...
Searching...
No Matches
Server.hpp
Go to the documentation of this file.
1#pragma once
2#include "webserv.hpp"
3
4class Server : public Route {
5 string _name;
6 std::map<string, Route *> _routes;
7
8public:
9 std::vector<ip_port_t> _listens;
10 Server(JSONNode *server);
11 ~Server(void);
12 Master *create_master(string str);
13 std::vector<Master *> get_sockets(JSONNode *server);
14 Route *choose_route(string uri);
15 string getName(void);
16};
Definition: Master.hpp:4
Definition: Route.hpp:4
Definition: Server.hpp:4
Route * choose_route(string uri)
Choose the route an uri asked to the server.
Definition: Server.cpp:102
std::vector< Master * > get_sockets(JSONNode *server)
Create server's defined sockets:
Definition: Server.cpp:79
Master * create_master(string str)
Master socket safe creation.
Definition: Server.cpp:56
std::vector< ip_port_t > _listens
The list of listens the server which are linked to the server.
Definition: Server.hpp:9
~Server(void)
Destructor.
Definition: Server.cpp:38
string _name
The server name.
Definition: Server.hpp:5
string getName(void)
Definition: Server.cpp:47
std::map< string, Route * > _routes
The server's routings with a route object as object and his location as key.
Definition: Server.hpp:6