Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 71d0b6c

Browse files
author
hamidr
committed
Use libevpp from a separate repository
1 parent 0ee9aa3 commit 71d0b6c

File tree

9 files changed

+22
-18
lines changed

9 files changed

+22
-18
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ link_directories(/usr/local/lib)
3030

3131
add_subdirectory(libs/libevpp/)
3232

33-
include_directories(libs/libevpp/includes/)
33+
include_directories(libs/libevpp/includes)
3434

3535

3636
add_library(parser
@@ -54,7 +54,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
5454
set(CMAKE_EXE_LINKER_FLAGS "-s") ## Strip binary
5555
endif()
5656

57-
target_link_libraries(async_redis network)
57+
target_link_libraries(async_redis network parser)
5858

5959
add_executable (a2.out test/main.cpp)
6060
target_link_libraries(a2.out async_redis)

examples/tcp_server.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
#include <unordered_map>
99

1010
namespace async_redis {
11-
namespace tcp_server {
11+
namespace examples {
1212

1313
class tcp_server
1414
{
1515
public:
16-
using tcp_socket = async_redis::network::tcp_socket;
17-
using async_socket = async_redis::network::async_socket;
16+
using tcp_socket = libevpp::network::tcp_socket;
17+
using async_socket = libevpp::network::async_socket;
1818

1919
tcp_server(event_loop::event_loop_ev &event_loop)
2020
: loop_(event_loop), listener_(event_loop) {

includes/connection.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <libevpp/event_loop/event_loop_ev.h>
1010
#include <libevpp/network/async_socket.hpp>
1111

12+
using namespace libevpp;
13+
1214
namespace async_redis
1315
{
1416
class connection

includes/monitor.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#pragma once
22

3-
#include <network/async_socket.hpp>
3+
#include <libevpp/network/async_socket.hpp>
44
#include <parser/base_resp_parser.h>
55

66
#include <unordered_map>
77
#include <list>
88
#include <string>
99

1010
using std::string;
11+
using namespace libevpp;
1112

1213
namespace async_redis
1314
{

includes/sentinel.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
#pragma once
2-
#include <network/async_socket.hpp>
2+
#include <libevpp/network/async_socket.hpp>
33
#include <parser/base_resp_parser.h>
44

55
#include <monitor.hpp>
66
#include <functional>
77
#include <connection.hpp>
8-
// #include <memory>
8+
9+
using namespace libevpp;
910

1011
namespace async_redis {
1112
class sentinel
1213
{
13-
using socket_t = ::async_redis::network::async_socket;
14+
using socket_t = libevpp::network::async_socket;
1415
using connect_cb_t = socket_t::connect_handler_t;
1516

1617
public:

src/connection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include <tuple>
77

88
#include <parser/base_resp_parser.h>
9-
#include <network/tcp_socket.hpp>
10-
#include <network/unix_socket.hpp>
9+
#include <libevpp/network/tcp_socket.hpp>
10+
#include <libevpp/network/unix_socket.hpp>
1111

1212

1313
namespace async_redis

src/monitor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#include <parser/array_parser.h>
44
#include <cassert>
5-
#include "../includes/network/tcp_socket.hpp"
6-
#include "../includes/network/unix_socket.hpp"
5+
#include <libevpp/network/tcp_socket.hpp>
6+
#include <libevpp/network/unix_socket.hpp>
77

88
namespace async_redis
99
{

test/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
#include <event_loop/event_loop_ev.h>
1+
#include <libevpp/event_loop/event_loop_ev.h>
22

33
#include <redis_client.hpp>
44
#include <parser/base_resp_parser.h>
5-
#include <network/tcp_socket.hpp>
6-
#include <network/unix_socket.hpp>
5+
#include <libevpp/network/tcp_socket.hpp>
6+
#include <libevpp/network/unix_socket.hpp>
77
#include <monitor.hpp>
88
#include <sentinel.hpp>
99
#include "../examples/tcp_server.hpp"
1010

1111

12-
typedef async_redis::event_loop::event_loop_ev event_loop_ev;
12+
typedef libevpp::event_loop::event_loop_ev event_loop_ev;
1313

1414
struct monitor_test
1515
{

0 commit comments

Comments
 (0)