Skip to content

Commit a418cf4

Browse files
committed
Adding server tag and is_server trait.
1 parent 1c2a85f commit a418cf4

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_SUPPORT_IS_SERVER_HPP_20101118
2+
#define BOOST_NETWORK_PROTOCOL_SUPPORT_IS_SERVER_HPP_20101118
3+
4+
// Copyright 2010 Dean Michael Berris.
5+
// Distributed under the Boost Software License, Version 1.0.
6+
// (See accompanying file LICENSE_1_0.txt or copy at
7+
// http://www.boost.org/LICENSE_1_0.txt)
8+
9+
#include <boost/network/protocol/http/tags.hpp>
10+
#include <boost/type_traits/is_base_of.hpp>
11+
12+
namespace boost { namespace network { namespace http {
13+
14+
template <class Tag>
15+
struct is_server :
16+
is_base_of<
17+
tags::server,
18+
Tag
19+
>
20+
{};
21+
22+
} /* http */
23+
24+
} /* network */
25+
26+
} /* boost */
27+
28+
#endif /* BOOST_NETWORK_PROTOCOL_SUPPORT_IS_SERVER_HPP_20101118 */

boost/network/protocol/http/tags.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace boost { namespace network { namespace http { namespace tags {
1313
struct http {};
1414
struct keepalive {};
1515
struct simple {};
16+
struct server {};
1617

1718
using namespace boost::network::tags;
1819

@@ -25,8 +26,8 @@ namespace boost { namespace network { namespace http { namespace tags {
2526
typedef mpl::vector<http, keepalive, sync, udp, default_string> http_keepalive_8bit_udp_resolve_tags;
2627
typedef mpl::vector<http, simple, async, udp, default_string> http_async_8bit_udp_resolve_tags;
2728
typedef mpl::vector<http, simple, async, tcp, default_string> http_async_8bit_tcp_resolve_tags;
28-
typedef mpl::vector<http, simple, sync, pod, default_string> http_server_tags;
29-
typedef mpl::vector<http, simple, async, pod, default_string> http_async_server_tags;
29+
typedef mpl::vector<http, simple, sync, pod, default_string, server> http_server_tags;
30+
typedef mpl::vector<http, simple, async, pod, default_string, server> http_async_server_tags;
3031

3132
BOOST_NETWORK_DEFINE_TAG(http_default_8bit_tcp_resolve);
3233
BOOST_NETWORK_DEFINE_TAG(http_default_8bit_udp_resolve);

0 commit comments

Comments
 (0)