Skip to content

Commit ef532ff

Browse files
committed
Added boost ASIO.
1 parent 140703c commit ef532ff

File tree

403 files changed

+87161
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

403 files changed

+87161
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ Things to note
1414
-----------------
1515

1616
* iostreams does not use bzip TODO compiler flag or edited the code? We don't want to be changing boost.
17+
* asio does not have the asio/impl/src.cpp
1718

1819
Module status
1920
--------------
2021
Modules are added as required or via contributions. Currently we have:
2122

23+
* asio
2224
* bind
2325
* concept
2426
* config

asio/pom.xml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>org.boost</groupId>
7+
<artifactId>parent</artifactId>
8+
<version>1.5.7</version>
9+
</parent>
10+
11+
<artifactId>asio</artifactId>
12+
<packaging>nar</packaging>
13+
<name>Boost :: ASIO</name>
14+
<description>Boost ASIO networking library</description>
15+
16+
<build>
17+
<plugins>
18+
<plugin>
19+
<groupId>com.github.maven-nar</groupId>
20+
<artifactId>nar-maven-plugin</artifactId>
21+
<extensions>true</extensions>
22+
<configuration>
23+
<libraries>
24+
<library>
25+
<type>shared</type>
26+
</library>
27+
</libraries>
28+
<cpp>
29+
<options combine.children="append">
30+
</options>
31+
</cpp>
32+
</configuration>
33+
</plugin>
34+
</plugins>
35+
</build>
36+
37+
<dependencies>
38+
<dependency>
39+
<groupId>org.boost</groupId>
40+
<artifactId>core</artifactId>
41+
<type>nar</type>
42+
<version>${project.version}</version>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.boost</groupId>
46+
<artifactId>system</artifactId>
47+
<type>nar</type>
48+
<version>${project.version}</version>
49+
</dependency>
50+
</dependencies>
51+
52+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
//
2+
// async_result.hpp
3+
// ~~~~~~~~~~~~~~~~
4+
//
5+
// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6+
//
7+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9+
//
10+
11+
#ifndef BOOST_ASIO_ASYNC_RESULT_HPP
12+
#define BOOST_ASIO_ASYNC_RESULT_HPP
13+
14+
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15+
# pragma once
16+
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17+
18+
#include <boost/asio/detail/config.hpp>
19+
#include <boost/asio/handler_type.hpp>
20+
21+
#include <boost/asio/detail/push_options.hpp>
22+
23+
namespace boost {
24+
namespace asio {
25+
26+
/// An interface for customising the behaviour of an initiating function.
27+
/**
28+
* This template may be specialised for user-defined handler types.
29+
*/
30+
template <typename Handler>
31+
class async_result
32+
{
33+
public:
34+
/// The return type of the initiating function.
35+
typedef void type;
36+
37+
/// Construct an async result from a given handler.
38+
/**
39+
* When using a specalised async_result, the constructor has an opportunity
40+
* to initialise some state associated with the handler, which is then
41+
* returned from the initiating function.
42+
*/
43+
explicit async_result(Handler&)
44+
{
45+
}
46+
47+
/// Obtain the value to be returned from the initiating function.
48+
type get()
49+
{
50+
}
51+
};
52+
53+
namespace detail {
54+
55+
// Helper template to deduce the true type of a handler, capture a local copy
56+
// of the handler, and then create an async_result for the handler.
57+
template <typename Handler, typename Signature>
58+
struct async_result_init
59+
{
60+
explicit async_result_init(BOOST_ASIO_MOVE_ARG(Handler) orig_handler)
61+
: handler(BOOST_ASIO_MOVE_CAST(Handler)(orig_handler)),
62+
result(handler)
63+
{
64+
}
65+
66+
typename handler_type<Handler, Signature>::type handler;
67+
async_result<typename handler_type<Handler, Signature>::type> result;
68+
};
69+
70+
template <typename Handler, typename Signature>
71+
struct async_result_type_helper
72+
{
73+
typedef typename async_result<
74+
typename handler_type<Handler, Signature>::type
75+
>::type type;
76+
};
77+
78+
} // namespace detail
79+
} // namespace asio
80+
} // namespace boost
81+
82+
#include <boost/asio/detail/pop_options.hpp>
83+
84+
#if defined(GENERATING_DOCUMENTATION)
85+
# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \
86+
void_or_deduced
87+
#elif defined(_MSC_VER) && (_MSC_VER < 1500)
88+
# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \
89+
typename ::boost::asio::detail::async_result_type_helper<h, sig>::type
90+
#else
91+
# define BOOST_ASIO_INITFN_RESULT_TYPE(h, sig) \
92+
typename ::boost::asio::async_result< \
93+
typename ::boost::asio::handler_type<h, sig>::type>::type
94+
#endif
95+
96+
#endif // BOOST_ASIO_ASYNC_RESULT_HPP

0 commit comments

Comments
 (0)