Skip to content

Commit

Permalink
feat: refine include
Browse files Browse the repository at this point in the history
  • Loading branch information
shuai132 committed Sep 18, 2023
1 parent 6380a60 commit cf59345
Show file tree
Hide file tree
Showing 47 changed files with 54 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "rpc/rpc_core"]
path = rpc/rpc_core
[submodule "include/asio_net/rpc_core"]
path = include/asio_net/rpc_core
url = [email protected]:shuai132/rpc_core.git
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ set(CMAKE_CXX_STANDARD 14)
add_compile_options(-Wall)

add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE .)
target_include_directories(${PROJECT_NAME} INTERFACE include)
if (ASIO_NET_ENABLE_SSL)
target_compile_definitions(${PROJECT_NAME} INTERFACE -DASIO_NET_ENABLE_SSL)
endif ()

if (ASIO_NET_ENABLE_RPC)
target_include_directories(${PROJECT_NAME} INTERFACE
rpc/rpc_core
rpc
include/asio_net/rpc_core/include
)
endif ()

Expand Down
7 changes: 7 additions & 0 deletions include/asio_net.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#include "asio_net/server_discovery.hpp"
#include "asio_net/tcp_client.hpp"
#include "asio_net/tcp_server.hpp"
#include "asio_net/udp_client.hpp"
#include "asio_net/udp_server.hpp"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

#include <utility>

#include "detail/noncopyable.hpp"
#include "noncopyable.hpp"
#include "rpc_core.hpp"
#include "rpc_session.hpp"
#include "tcp_client.hpp"
#include "rpc_session_t.hpp"
#include "tcp_client_t.hpp"

namespace asio_net {
namespace detail {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <utility>

#include "asio.hpp"
#include "rpc_session.hpp"
#include "tcp_server.hpp"
#include "rpc_session_t.hpp"
#include "tcp_server_t.hpp"

namespace asio_net {
namespace detail {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <utility>

#include "detail/noncopyable.hpp"
#include "detail/tcp_channel_t.hpp"
#include "noncopyable.hpp"
#include "rpc_core.hpp"
#include "tcp_channel_t.hpp"

namespace asio_net {
namespace detail {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <deque>
#include <utility>

#include "../config.h"
#include "asio.hpp"
#include "config.h"
#include "log.h"
#include "message.hpp"
#include "noncopyable.hpp"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <utility>

#include "../config.h"
#include "asio.hpp"
#include "config.h"
#include "tcp_channel_t.hpp"

namespace asio_net {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions include/asio_net/rpc_core
Submodule rpc_core added at 4d51c8
1 change: 1 addition & 0 deletions rpc/rpc_server.hpp → include/asio_net/rpc_server.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "detail/rpc_server_t.hpp"
#include "rpc_session.hpp"

namespace asio_net {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
"build": {
"srcDir": "_",
"flags": [
"-I .",
"-I rpc",
"-I rpc/rpc_core"
"-I include",
"-I asio_net/rpc_core/include"
]
}
}
1 change: 0 additions & 1 deletion rpc/rpc_core
Submodule rpc_core deleted from d9b138
4 changes: 2 additions & 2 deletions test/domain_rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <cstdlib>
#include <thread>

#include "asio_net/rpc_client.hpp"
#include "asio_net/rpc_server.hpp"
#include "assert_def.h"
#include "log.h"
#include "rpc_client.hpp"
#include "rpc_server.hpp"

using namespace asio_net;

Expand Down
4 changes: 2 additions & 2 deletions test/domain_tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <cstdlib>
#include <thread>

#include "asio_net/tcp_client.hpp"
#include "asio_net/tcp_server.hpp"
#include "assert_def.h"
#include "log.h"
#include "tcp_client.hpp"
#include "tcp_server.hpp"

using namespace asio_net;

Expand Down
4 changes: 2 additions & 2 deletions test/domain_udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <cstdlib>
#include <thread>

#include "asio_net/udp_client.hpp"
#include "asio_net/udp_server.hpp"
#include "assert_def.h"
#include "log.h"
#include "udp_client.hpp"
#include "udp_server.hpp"

using namespace asio_net;

Expand Down
4 changes: 2 additions & 2 deletions test/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <cstdlib>
#include <thread>

#include "asio_net/rpc_client.hpp"
#include "asio_net/rpc_server.hpp"
#include "assert_def.h"
#include "log.h"
#include "rpc_client.hpp"
#include "rpc_server.hpp"

using namespace asio_net;

Expand Down
2 changes: 1 addition & 1 deletion test/rpc_c.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <cstdio>

#include "asio_net/rpc_client.hpp"
#include "log.h"
#include "rpc_client.hpp"

using namespace asio_net;

Expand Down
2 changes: 1 addition & 1 deletion test/rpc_c_open_close.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <cstdio>

#include "asio_net/rpc_client.hpp"
#include "log.h"
#include "rpc_client.hpp"

using namespace asio_net;

Expand Down
4 changes: 2 additions & 2 deletions test/rpc_reconnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#include <cstdlib>
#include <thread>

#include "asio_net/rpc_client.hpp"
#include "asio_net/rpc_server.hpp"
#include "log.h"
#include "rpc_client.hpp"
#include "rpc_server.hpp"

using namespace asio_net;

Expand Down
2 changes: 1 addition & 1 deletion test/rpc_s.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <cstdio>

#include "asio_net/rpc_server.hpp"
#include "log.h"
#include "rpc_server.hpp"

using namespace asio_net;

Expand Down
4 changes: 2 additions & 2 deletions test/rpc_ssl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <cstdlib>
#include <thread>

#include "asio_net/rpc_client.hpp"
#include "asio_net/rpc_server.hpp"
#include "assert_def.h"
#include "log.h"
#include "rpc_client.hpp"
#include "rpc_server.hpp"

using namespace asio_net;

Expand Down
2 changes: 1 addition & 1 deletion test/server_discovery.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "server_discovery.hpp"
#include "asio_net/server_discovery.hpp"

#include <cstdio>

Expand Down
4 changes: 2 additions & 2 deletions test/tcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <cstdlib>
#include <thread>

#include "asio_net/tcp_client.hpp"
#include "asio_net/tcp_server.hpp"
#include "assert_def.h"
#include "log.h"
#include "tcp_client.hpp"
#include "tcp_server.hpp"

using namespace asio_net;

Expand Down
4 changes: 2 additions & 2 deletions test/tcp_bigdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#include <cstdlib>
#include <thread>

#include "asio_net/tcp_client.hpp"
#include "asio_net/tcp_server.hpp"
#include "assert_def.h"
#include "log.h"
#include "tcp_client.hpp"
#include "tcp_server.hpp"

using namespace asio_net;

Expand Down
2 changes: 1 addition & 1 deletion test/tcp_c.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "asio_net/tcp_client.hpp"
#include "log.h"
#include "tcp_client.hpp"

using namespace asio_net;

Expand Down
4 changes: 2 additions & 2 deletions test/tcp_reconnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#include <cstdlib>
#include <thread>

#include "asio_net/tcp_client.hpp"
#include "asio_net/tcp_server.hpp"
#include "assert_def.h"
#include "log.h"
#include "tcp_client.hpp"
#include "tcp_server.hpp"

using namespace asio_net;

Expand Down
2 changes: 1 addition & 1 deletion test/tcp_s.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "asio_net/tcp_server.hpp"
#include "assert_def.h"
#include "log.h"
#include "tcp_server.hpp"

using namespace asio_net;

Expand Down
2 changes: 1 addition & 1 deletion test/tcp_ssl_c.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "asio_net/tcp_client.hpp"
#include "log.h"
#include "tcp_client.hpp"

using namespace asio_net;

Expand Down
2 changes: 1 addition & 1 deletion test/tcp_ssl_s.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "asio_net/tcp_server.hpp"
#include "assert_def.h"
#include "log.h"
#include "tcp_server.hpp"

using namespace asio_net;

Expand Down
4 changes: 2 additions & 2 deletions test/udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#include <cstdlib>
#include <thread>

#include "asio_net/udp_client.hpp"
#include "asio_net/udp_server.hpp"
#include "assert_def.h"
#include "log.h"
#include "udp_client.hpp"
#include "udp_server.hpp"

using namespace asio_net;

Expand Down
2 changes: 1 addition & 1 deletion test/udp_c.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "asio_net/udp_client.hpp"
#include "log.h"
#include "udp_client.hpp"

using namespace asio_net;

Expand Down
2 changes: 1 addition & 1 deletion test/udp_s.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "asio_net/udp_server.hpp"
#include "log.h"
#include "udp_server.hpp"

using namespace asio_net;

Expand Down

0 comments on commit cf59345

Please sign in to comment.