move options/constants from Configuration.h to Socket.h v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 30 Jul 2022 11:33:56 +0200
branchv_0
changeset 7 e6f005f3edfe
parent 6 f0c51bc4d164
child 8 3e17086fffea
move options/constants from Configuration.h to Socket.h (avoid dependency from Socket to Configuration)
src/Configuration.h
src/Socket.cpp
src/Socket.h
--- a/src/Configuration.h	Sat Jul 30 02:33:33 2022 +0200
+++ b/src/Configuration.h	Sat Jul 30 11:33:56 2022 +0200
@@ -28,25 +28,6 @@
 namespace out {
 namespace socket {
 
-namespace options {
-static const char OPTION_PROTOCOL[] = "protocol";
-static const char OPTION_ROLE[] = "role";
-static const char OPTION_MODE[] = "mode";
-static const char OPTION_HOST[] = "host";
-static const char OPTION_PORT[] = "port";
-static const char OPTION_PATH[] = "path";
-
-static const char PROTOCOL_TCP[] = "tcp";
-static const char PROTOCOL_UDP[] = "udp";
-static const char PROTOCOL_UDS[] = "uds";
-static const char PROTOCOL_SCTP[] = "sctp";
-
-static const char ROLE_CLIENT[] = "client";
-static const char ROLE_SERVER[] = "server";
-
-static const char MODE_STREAM[] = "stream";
-static const char MODE_DATAGRAM[] = "datagram";
-}
 
 class Configuration {
 public:
--- a/src/Socket.cpp	Sat Jul 30 02:33:33 2022 +0200
+++ b/src/Socket.cpp	Sat Jul 30 11:33:56 2022 +0200
@@ -27,7 +27,6 @@
 #include <regex>
 
 #include "Socket.h"
-#include "Configuration.h"
 
 namespace relpipe {
 namespace out {
--- a/src/Socket.h	Sat Jul 30 02:33:33 2022 +0200
+++ b/src/Socket.h	Sat Jul 30 11:33:56 2022 +0200
@@ -30,6 +30,26 @@
 namespace out {
 namespace socket {
 
+namespace options {
+static const char OPTION_PROTOCOL[] = "protocol";
+static const char OPTION_ROLE[] = "role";
+static const char OPTION_MODE[] = "mode";
+static const char OPTION_HOST[] = "host";
+static const char OPTION_PORT[] = "port";
+static const char OPTION_PATH[] = "path";
+
+static const char PROTOCOL_TCP[] = "tcp";
+static const char PROTOCOL_UDP[] = "udp";
+static const char PROTOCOL_UDS[] = "uds";
+static const char PROTOCOL_SCTP[] = "sctp";
+
+static const char ROLE_CLIENT[] = "client";
+static const char ROLE_SERVER[] = "server";
+
+static const char MODE_STREAM[] = "stream";
+static const char MODE_DATAGRAM[] = "datagram";
+}
+
 class Socket {
 public:
 	virtual ~Socket() = default;