Skip to content

Commit 41b34db

Browse files
Merge pull request #40 from PythonGermany/use-forward-declarations-wherever-possible
Use forward declarations wherever possible
2 parents a7a99f3 + b20d1fe commit 41b34db

File tree

22 files changed

+42
-22
lines changed

22 files changed

+42
-22
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ clean:
9191
$(RM) -r $(OBJ_DIR)
9292

9393
fclean: clean
94-
rm -f tools/transformer
9594
$(RM) -r $(BIN_DIR)
9695

9796
re: fclean all

include/config/Config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <string>
55
#include <vector>
66

7-
#include "Context.hpp"
7+
class Context;
88

99
// ----------------------- CONFIG STRUCTURE ------------------------
1010
typedef struct token_s {

include/config/Init.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef INIT_HPP
22
#define INIT_HPP
33

4-
#include "Context.hpp"
4+
class Context;
55

66
class Init {
77
private:

include/http/Http.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
#include <fstream>
55

66
#include "AConnection.hpp"
7-
#include "File.hpp"
87
#include "Request.hpp"
98
#include "Response.hpp"
10-
#include "VirtualHost.hpp"
9+
10+
class VirtualHost;
11+
class Context;
12+
class File;
1113

1214
// WEBSERV_CONFIG ----------- HTTP VALUES --------------------------
1315
#define PROTOCOL "HTTP"

include/output/Log.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define LOG_HPP
33

44
#include <fstream>
5-
#include <iostream>
65
#include <ostream>
76
#include <string>
87

include/poll/AConnection.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#ifndef ACONNECTION_HPP
22
#define ACONNECTION_HPP
33

4-
#include <fcntl.h>
4+
#include <sys/time.h>
55

6-
#include <istream>
76
#include <queue>
87
#include <string>
98
#include <vector>
109

1110
#include "Address.hpp"
12-
#include "CallbackPointer.hpp"
13-
#include "timeval.hpp"
11+
#include "IFileDescriptor.hpp"
12+
13+
class CallbackPointer;
1414

1515
// WEBSERV_CONFIG ----------- ACONNECTION VALUES -------------------
1616
/**

include/poll/Address.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
#ifndef ADDRESS_HPP
22
#define ADDRESS_HPP
33

4-
#include <netdb.h>
54
#include <netinet/in.h>
6-
#include <sys/socket.h>
75

8-
#include <cerrno>
9-
#include <cstdlib>
10-
#include <cstring>
116
#include <ostream>
127
#include <set>
138
#include <string>

include/poll/CallbackPointer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef CALLBACKPOINTER_HPP
22
#define CALLBACKPOINTER_HPP
33

4-
#include "IFileDescriptor.hpp"
4+
class IFileDescriptor;
55

66
class CallbackPointer {
77
public:

include/poll/IFileDescriptor.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#ifndef IFILEDESCRIPTOR_HPP
22
#define IFILEDESCRIPTOR_HPP
33

4-
#include <poll.h>
5-
4+
struct pollfd;
65
class CallbackPointer;
76

87
#define POLLINACTIVE POLLERR

include/poll/ListenSocket.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
#define LISTENSOCKET_HPP
44

55
#include "Address.hpp"
6-
#include "CallbackPointer.hpp"
6+
#include "IFileDescriptor.hpp"
7+
8+
class CallbackPointer;
79

810
class ListenSocket : public IFileDescriptor {
911
public:

0 commit comments

Comments
 (0)