-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sailfish009
committed
Sep 26, 2017
0 parents
commit 715c2ac
Showing
478 changed files
with
107,576 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
cmake_minimum_required(VERSION 3.6) | ||
project(asio) | ||
|
||
add_definitions(-DASIO_STANDALONE -DASIO_SEPARATE_COMPILATION) | ||
set(CMAKE_CONFIGURATION_TYPES "Debug" CACHE STRING "" FORCE) | ||
set (CMAKE_CXX_STANDARD 11) | ||
|
||
include_directories(include) | ||
include_directories(include/asio/detail) | ||
include_directories(include/asio/detail/impl) | ||
include_directories(include/asio/generic) | ||
include_directories(include/asio/generic/detail) | ||
include_directories(include/asio/impl) | ||
include_directories(include/asio/ip) | ||
include_directories(include/asio/ip/impl) | ||
include_directories(include/asio/ip/detail) | ||
include_directories(include/asio/local) | ||
include_directories(include/asio/local/detail) | ||
include_directories(include/asio/posix) | ||
# include_directories(include/asio/ssl) | ||
# include_directories(include/asio/ssl/detail) | ||
# include_directories(include/asio/ssl/impl) | ||
include_directories(include/asio/ts) | ||
include_directories(include/asio/windows) | ||
aux_source_directory(src src) | ||
aux_source_directory(include/asio/detail/impl impl1) | ||
aux_source_directory(include/asio/generic/detail/impl impl2) | ||
aux_source_directory(include/asio/impl impl3) | ||
aux_source_directory(include/asio/ip/impl impl4) | ||
aux_source_directory(include/asio/ip/detail/impl impl5) | ||
aux_source_directory(include/asio/local/detail/impl impl6) | ||
# aux_source_directory(include/asio/ssl/detail/impl impl7) | ||
# aux_source_directory(include/asio/ssl/impl impl8) | ||
# set(source ${src} ${impl1} ${impl2} ${impl3} ${impl4} ${impl5} ${impl6} ${impl7} ${impl8}) | ||
set(source ${src} ${impl1} ${impl2} ${impl3} ${impl4} ${impl5} ${impl6} ) | ||
|
||
add_library(asio STATIC ${source}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Boost Software License - Version 1.0 - August 17th, 2003 | ||
|
||
Permission is hereby granted, free of charge, to any person or organization | ||
obtaining a copy of the software and accompanying documentation covered by | ||
this license (the "Software") to use, reproduce, display, distribute, | ||
execute, and transmit the Software, and to prepare derivative works of the | ||
Software, and to permit third-parties to whom the Software is furnished to | ||
do so, all subject to the following: | ||
|
||
The copyright notices in the Software and this entire statement, including | ||
the above license grant, this restriction and the following disclaimer, | ||
must be included in all copies of the Software, in whole or in part, and | ||
all derivative works of the Software, unless such copies or derivative | ||
works are solely in the form of machine-executable object code generated by | ||
a source language processor. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT | ||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE | ||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// asio_ssl.cpp | ||
// ~~~~~~~~~~~~ | ||
// | ||
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
|
||
#include "asio/ssl/impl/src.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except this file | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
// | ||
// asio.hpp | ||
// ~~~~~~~~ | ||
// | ||
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
|
||
#ifndef ASIO_HPP | ||
#define ASIO_HPP | ||
|
||
#if defined(_MSC_VER) && (_MSC_VER >= 1200) | ||
# pragma once | ||
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) | ||
|
||
#include "asio/associated_allocator.hpp" | ||
#include "asio/associated_executor.hpp" | ||
#include "asio/async_result.hpp" | ||
#include "asio/basic_datagram_socket.hpp" | ||
#include "asio/basic_deadline_timer.hpp" | ||
#include "asio/basic_io_object.hpp" | ||
#include "asio/basic_raw_socket.hpp" | ||
#include "asio/basic_seq_packet_socket.hpp" | ||
#include "asio/basic_serial_port.hpp" | ||
#include "asio/basic_signal_set.hpp" | ||
#include "asio/basic_socket_acceptor.hpp" | ||
#include "asio/basic_socket_iostream.hpp" | ||
#include "asio/basic_socket_streambuf.hpp" | ||
#include "asio/basic_stream_socket.hpp" | ||
#include "asio/basic_streambuf.hpp" | ||
#include "asio/basic_waitable_timer.hpp" | ||
#include "asio/bind_executor.hpp" | ||
#include "asio/buffer.hpp" | ||
#include "asio/buffered_read_stream_fwd.hpp" | ||
#include "asio/buffered_read_stream.hpp" | ||
#include "asio/buffered_stream_fwd.hpp" | ||
#include "asio/buffered_stream.hpp" | ||
#include "asio/buffered_write_stream_fwd.hpp" | ||
#include "asio/buffered_write_stream.hpp" | ||
#include "asio/buffers_iterator.hpp" | ||
#include "asio/completion_condition.hpp" | ||
#include "asio/connect.hpp" | ||
#include "asio/coroutine.hpp" | ||
#include "asio/datagram_socket_service.hpp" | ||
#include "asio/deadline_timer_service.hpp" | ||
#include "asio/deadline_timer.hpp" | ||
#include "asio/defer.hpp" | ||
#include "asio/dispatch.hpp" | ||
#include "asio/error.hpp" | ||
#include "asio/error_code.hpp" | ||
#include "asio/execution_context.hpp" | ||
#include "asio/executor.hpp" | ||
#include "asio/executor_work_guard.hpp" | ||
#include "asio/generic/basic_endpoint.hpp" | ||
#include "asio/generic/datagram_protocol.hpp" | ||
#include "asio/generic/raw_protocol.hpp" | ||
#include "asio/generic/seq_packet_protocol.hpp" | ||
#include "asio/generic/stream_protocol.hpp" | ||
#include "asio/handler_alloc_hook.hpp" | ||
#include "asio/handler_continuation_hook.hpp" | ||
#include "asio/handler_invoke_hook.hpp" | ||
#include "asio/handler_type.hpp" | ||
#include "asio/io_context.hpp" | ||
#include "asio/io_context_strand.hpp" | ||
#include "asio/io_service.hpp" | ||
#include "asio/io_service_strand.hpp" | ||
#include "asio/ip/address.hpp" | ||
#include "asio/ip/address_v4.hpp" | ||
#include "asio/ip/address_v4_iterator.hpp" | ||
#include "asio/ip/address_v4_range.hpp" | ||
#include "asio/ip/address_v6.hpp" | ||
#include "asio/ip/address_v6_iterator.hpp" | ||
#include "asio/ip/address_v6_range.hpp" | ||
#include "asio/ip/bad_address_cast.hpp" | ||
#include "asio/ip/basic_endpoint.hpp" | ||
#include "asio/ip/basic_resolver.hpp" | ||
#include "asio/ip/basic_resolver_entry.hpp" | ||
#include "asio/ip/basic_resolver_iterator.hpp" | ||
#include "asio/ip/basic_resolver_query.hpp" | ||
#include "asio/ip/host_name.hpp" | ||
#include "asio/ip/icmp.hpp" | ||
#include "asio/ip/multicast.hpp" | ||
#include "asio/ip/resolver_base.hpp" | ||
#include "asio/ip/resolver_query_base.hpp" | ||
#include "asio/ip/resolver_service.hpp" | ||
#include "asio/ip/tcp.hpp" | ||
#include "asio/ip/udp.hpp" | ||
#include "asio/ip/unicast.hpp" | ||
#include "asio/ip/v6_only.hpp" | ||
#include "asio/is_executor.hpp" | ||
#include "asio/is_read_buffered.hpp" | ||
#include "asio/is_write_buffered.hpp" | ||
#include "asio/local/basic_endpoint.hpp" | ||
#include "asio/local/connect_pair.hpp" | ||
#include "asio/local/datagram_protocol.hpp" | ||
#include "asio/local/stream_protocol.hpp" | ||
#include "asio/packaged_task.hpp" | ||
#include "asio/placeholders.hpp" | ||
#include "asio/posix/basic_descriptor.hpp" | ||
#include "asio/posix/basic_stream_descriptor.hpp" | ||
#include "asio/posix/descriptor.hpp" | ||
#include "asio/posix/descriptor_base.hpp" | ||
#include "asio/posix/stream_descriptor.hpp" | ||
#include "asio/posix/stream_descriptor_service.hpp" | ||
#include "asio/post.hpp" | ||
#include "asio/raw_socket_service.hpp" | ||
#include "asio/read.hpp" | ||
#include "asio/read_at.hpp" | ||
#include "asio/read_until.hpp" | ||
#include "asio/seq_packet_socket_service.hpp" | ||
#include "asio/serial_port.hpp" | ||
#include "asio/serial_port_base.hpp" | ||
#include "asio/serial_port_service.hpp" | ||
#include "asio/signal_set.hpp" | ||
#include "asio/signal_set_service.hpp" | ||
#include "asio/socket_acceptor_service.hpp" | ||
#include "asio/socket_base.hpp" | ||
#include "asio/strand.hpp" | ||
#include "asio/stream_socket_service.hpp" | ||
#include "asio/streambuf.hpp" | ||
#include "asio/system_context.hpp" | ||
#include "asio/system_error.hpp" | ||
#include "asio/system_executor.hpp" | ||
#include "asio/thread.hpp" | ||
#include "asio/thread_pool.hpp" | ||
#include "asio/time_traits.hpp" | ||
#include "asio/use_future.hpp" | ||
#include "asio/uses_executor.hpp" | ||
#include "asio/version.hpp" | ||
#include "asio/wait_traits.hpp" | ||
#include "asio/waitable_timer_service.hpp" | ||
#include "asio/windows/basic_handle.hpp" | ||
#include "asio/windows/basic_object_handle.hpp" | ||
#include "asio/windows/basic_random_access_handle.hpp" | ||
#include "asio/windows/basic_stream_handle.hpp" | ||
#include "asio/windows/object_handle.hpp" | ||
#include "asio/windows/object_handle_service.hpp" | ||
#include "asio/windows/overlapped_handle.hpp" | ||
#include "asio/windows/overlapped_ptr.hpp" | ||
#include "asio/windows/random_access_handle.hpp" | ||
#include "asio/windows/random_access_handle_service.hpp" | ||
#include "asio/windows/stream_handle.hpp" | ||
#include "asio/windows/stream_handle_service.hpp" | ||
#include "asio/write.hpp" | ||
#include "asio/write_at.hpp" | ||
|
||
#endif // ASIO_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
// | ||
// associated_allocator.hpp | ||
// ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
// | ||
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
|
||
#ifndef ASIO_ASSOCIATED_ALLOCATOR_HPP | ||
#define ASIO_ASSOCIATED_ALLOCATOR_HPP | ||
|
||
#if defined(_MSC_VER) && (_MSC_VER >= 1200) | ||
# pragma once | ||
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) | ||
|
||
#include "asio/detail/config.hpp" | ||
#include <memory> | ||
#include "asio/detail/type_traits.hpp" | ||
|
||
#include "asio/detail/push_options.hpp" | ||
|
||
namespace asio { | ||
namespace detail { | ||
|
||
template <typename> | ||
struct associated_allocator_check | ||
{ | ||
typedef void type; | ||
}; | ||
|
||
template <typename T, typename E, typename = void> | ||
struct associated_allocator_impl | ||
{ | ||
typedef E type; | ||
|
||
static type get(const T&, const E& e) ASIO_NOEXCEPT | ||
{ | ||
return e; | ||
} | ||
}; | ||
|
||
template <typename T, typename E> | ||
struct associated_allocator_impl<T, E, | ||
typename associated_allocator_check<typename T::allocator_type>::type> | ||
{ | ||
typedef typename T::allocator_type type; | ||
|
||
static type get(const T& t, const E&) ASIO_NOEXCEPT | ||
{ | ||
return t.get_allocator(); | ||
} | ||
}; | ||
|
||
} // namespace detail | ||
|
||
/// Traits type used to obtain the allocator associated with an object. | ||
/** | ||
* A program may specialise this traits type if the @c T template parameter in | ||
* the specialisation is a user-defined type. The template parameter @c | ||
* Allocator shall be a type meeting the Allocator requirements. | ||
* | ||
* Specialisations shall meet the following requirements, where @c t is a const | ||
* reference to an object of type @c T, and @c a is an object of type @c | ||
* Allocator. | ||
* | ||
* @li Provide a nested typedef @c type that identifies a type meeting the | ||
* Allocator requirements. | ||
* | ||
* @li Provide a noexcept static member function named @c get, callable as @c | ||
* get(t) and with return type @c type. | ||
* | ||
* @li Provide a noexcept static member function named @c get, callable as @c | ||
* get(t,a) and with return type @c type. | ||
*/ | ||
template <typename T, typename Allocator = std::allocator<void> > | ||
struct associated_allocator | ||
{ | ||
/// If @c T has a nested type @c allocator_type, <tt>T::allocator_type</tt>. | ||
/// Otherwise @c Allocator. | ||
#if defined(GENERATING_DOCUMENTATION) | ||
typedef see_below type; | ||
#else // defined(GENERATING_DOCUMENTATION) | ||
typedef typename detail::associated_allocator_impl<T, Allocator>::type type; | ||
#endif // defined(GENERATING_DOCUMENTATION) | ||
|
||
/// If @c T has a nested type @c allocator_type, returns | ||
/// <tt>t.get_allocator()</tt>. Otherwise returns @c a. | ||
static type get(const T& t, | ||
const Allocator& a = Allocator()) ASIO_NOEXCEPT | ||
{ | ||
return detail::associated_allocator_impl<T, Allocator>::get(t, a); | ||
} | ||
}; | ||
|
||
/// Helper function to obtain an object's associated allocator. | ||
/** | ||
* @returns <tt>associated_allocator<T>::get(t)</tt> | ||
*/ | ||
template <typename T> | ||
inline typename associated_allocator<T>::type | ||
get_associated_allocator(const T& t) ASIO_NOEXCEPT | ||
{ | ||
return associated_allocator<T>::get(t); | ||
} | ||
|
||
/// Helper function to obtain an object's associated allocator. | ||
/** | ||
* @returns <tt>associated_allocator<T, Allocator>::get(t, a)</tt> | ||
*/ | ||
template <typename T, typename Allocator> | ||
inline typename associated_allocator<T, Allocator>::type | ||
get_associated_allocator(const T& t, const Allocator& a) ASIO_NOEXCEPT | ||
{ | ||
return associated_allocator<T, Allocator>::get(t, a); | ||
} | ||
|
||
#if defined(ASIO_HAS_ALIAS_TEMPLATES) | ||
|
||
template <typename T, typename Allocator = std::allocator<void> > | ||
using associated_allocator_t | ||
= typename associated_allocator<T, Allocator>::type; | ||
|
||
#endif // defined(ASIO_HAS_ALIAS_TEMPLATES) | ||
|
||
} // namespace asio | ||
|
||
#include "asio/detail/pop_options.hpp" | ||
|
||
#endif // ASIO_ASSOCIATED_ALLOCATOR_HPP |
Oops, something went wrong.