Skip to content

Commit

Permalink
-wip refactoring 2
Browse files Browse the repository at this point in the history
  • Loading branch information
kamchatka-volcano committed Jul 14, 2024
1 parent fe30c1b commit c94ed1c
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 25 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,8 @@ endif()

if (ASYNCGI_USE_BOOST_ASIO)
target_compile_definitions(asyncgi PUBLIC "ASYNCGI_USE_BOOST_ASIO")
endif()
endif()

if (ASYNCGI_DISABLE_GLOBAL_HTTP_NAMESPACE)
target_compile_definitions(asyncgi PUBLIC "ASYNCGI_DISABLE_GLOBAL_HTTP_NAMESPACE")
endif ()
2 changes: 0 additions & 2 deletions examples/example_client.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include <asyncgi/asyncgi.h>
#include <iostream>

using namespace asyncgi;

int main()
{
auto io = asyncgi::IO{};
Expand Down
2 changes: 0 additions & 2 deletions examples/example_client_in_processor.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include <asyncgi/asyncgi.h>

namespace http = asyncgi::http;

struct RequestPage{
void operator()(const http::Request&, asyncgi::Responder& responder)
{
Expand Down
1 change: 0 additions & 1 deletion examples/example_guestbook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <optional>
#include <regex>

namespace http = asyncgi::http;
using namespace std::string_literals;

enum class AccessRole {
Expand Down
2 changes: 0 additions & 2 deletions examples/example_hello_world.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include <asyncgi/asyncgi.h>

namespace http = asyncgi::http;

int main()
{
auto io = asyncgi::IO{};
Expand Down
2 changes: 0 additions & 2 deletions examples/example_request_processor.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include <asyncgi/asyncgi.h>

namespace http = asyncgi::http;

http::Response guestBookPage(const http::Request& request)
{
if (request.path() == "/")
Expand Down
2 changes: 0 additions & 2 deletions examples/example_response_dispatching_asio_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ namespace asio = boost::asio;
#include <asio/steady_timer.hpp>
#endif

namespace http = asyncgi::http;

struct DelayedPage {
void operator()(const http::Request&, asyncgi::Responder& responder)
{
Expand Down
2 changes: 0 additions & 2 deletions examples/example_response_wait_future.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include <asyncgi/asyncgi.h>
#include <thread>

using namespace asyncgi;

struct DelayedPage{
void operator()(const http::Request&, asyncgi::Responder& responder)
{
Expand Down
1 change: 0 additions & 1 deletion examples/example_route_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <mutex>
#include <optional>

namespace http = asyncgi::http;
using namespace std::string_literals;

enum class AccessRole {
Expand Down
1 change: 0 additions & 1 deletion examples/example_route_matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <mutex>
#include <optional>

namespace http = asyncgi::http;
using namespace std::string_literals;

enum class AccessRole {
Expand Down
1 change: 0 additions & 1 deletion examples/example_route_params.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <asyncgi/asyncgi.h>
#include <mutex>

using namespace asyncgi;
using namespace std::string_literals;

class GuestBookState {
Expand Down
1 change: 0 additions & 1 deletion examples/example_route_params_user_defined_types.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <asyncgi/asyncgi.h>
#include <mutex>

using namespace asyncgi;
using namespace std::string_literals;

struct MessageNumber {
Expand Down
1 change: 0 additions & 1 deletion examples/example_router.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <asyncgi/asyncgi.h>
#include <mutex>

namespace http = asyncgi::http;
using namespace std::string_literals;

class GuestBookState {
Expand Down
2 changes: 0 additions & 2 deletions examples/example_timer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include <asyncgi/asyncgi.h>

namespace http = asyncgi::http;

struct Greeter{
Greeter(const int& secondsCounter)
: secondsCounter_{&secondsCounter}
Expand Down
4 changes: 4 additions & 0 deletions include/asyncgi/asyncgi.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@
#include "server.h"
#include "timer.h"

#ifndef ASYNCGI_DISABLE_GLOBAL_HTTP_NAMESPACE
namespace http = asyncgi::http;
#endif

#endif //ASYNCGI_H
13 changes: 9 additions & 4 deletions include/asyncgi/asyncgi_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace asyncgi {
class IO;
class Request;
class Responder;
class Server;
class Client;
Expand All @@ -13,13 +12,19 @@ class TaskContext;
class Timer;

namespace http {
class Request;
class Response;
};
}; //namespace http

namespace fastcgi {
struct Request;
struct Response;
class Request;
class Response;
} //namespace fastcgi

} //namespace asyncgi

#ifndef ASYNCGI_DISABLE_GLOBAL_HTTP_NAMESPACE
namespace http = asyncgi::http;
#endif

#endif //ASYNCGI_FWD_H

0 comments on commit c94ed1c

Please sign in to comment.