Skip to content

Commit 60af89c

Browse files
committed
Adding inheritance hierarchy for asynchronous tags, and a support metafunction that checks if a tag is asynchronous.
1 parent 204a037 commit 60af89c

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

boost/network/support/is_async.hpp

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

boost/network/tags.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@
1010

1111
namespace boost { namespace network { namespace tags {
1212

13+
struct async {};
14+
1315
struct default_string {};
1416
struct default_wstring {};
1517
struct http_default_8bit_tcp_resolve {};
1618
struct http_default_8bit_udp_resolve {};
1719
struct http_keepalive_8bit_tcp_resolve {};
1820
struct http_keepalive_8bit_udp_resolve {};
1921
struct http_server {};
22+
struct http_async_8bit_udp_resolve : async {};
2023

2124
typedef default_string default_;
2225

0 commit comments

Comments
 (0)