Merge branch 'feature/update-dependencies' into develop

This commit is contained in:
Sergey Abramchuk
2018-05-03 13:03:28 +03:00
1041 changed files with 18759 additions and 6931 deletions

View File

@@ -0,0 +1,24 @@
version: "{branch} (#{build})"
image:
- Visual Studio 2015
environment:
matrix:
- DEBUG: 1
STANDALONE: 1
WARNINGS: 1
- DEBUG: 1
STANDALONE: 1
WARNINGS: 1
WIN9X: 1
- DEBUG: 1
BOOSTDIR: C:\Libraries\boost_1_63_0
WARNINGS: 1
build_script:
- call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
- cd asio\src
- nmake -f Makefile.msc
- nmake -f Makefile.msc check

View File

@@ -0,0 +1,323 @@
language: cpp
sudo: false
cache:
directories:
- ${TRAVIS_BUILD_DIR}/boost_1_64_0
matrix:
include:
#
#---------------------------------------------------------------------------
# Linux / g++-6
#---------------------------------------------------------------------------
#
# Linux / g++-6 / -O2 / standalone
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- CXXFLAGS="-Wall -Wextra -O2"
- CONFIGFLAGS="--with-boost=no"
- MATRIX_EVAL="CC=gcc-6 CXX=g++-6"
compiler: gcc
#
# Linux / g++-6 / -O0 / standalone / handler tracking
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline -DASIO_ENABLE_HANDLER_TRACKING"
- CONFIGFLAGS="--with-boost=no"
- MATRIX_EVAL="CC=gcc-6 CXX=g++-6"
compiler: gcc
#
# Linux / g++-6 / -O0 / standalone / epoll disabled
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline -DASIO_DISABLE_EPOLL"
- CONFIGFLAGS="--with-boost=no"
- MATRIX_EVAL="CC=gcc-6 CXX=g++-6"
compiler: gcc
#
# Linux / g++-6 / -O0 / standalone / separate compilation
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline"
- CONFIGFLAGS="--with-boost=no --enable-separate-compilation"
- MATRIX_EVAL="CC=gcc-6 CXX=g++-6"
compiler: gcc
#
# Linux / g++-6 / -O0 / standalone / separate compilation / handler tracking
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline -DASIO_ENABLE_HANDLER_TRACKING"
- CONFIGFLAGS="--with-boost=no --enable-separate-compilation"
- MATRIX_EVAL="CC=gcc-6 CXX=g++-6"
compiler: gcc
#
# Linux / g++-6 / -O0 / standalone / separate compilation / epoll disabled
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline -DASIO_DISABLE_EPOLL"
- CONFIGFLAGS="--with-boost=no --enable-separate-compilation"
- MATRIX_EVAL="CC=gcc-6 CXX=g++-6"
compiler: gcc
#
# Linux / g++-6 / -O2 / boost 1.64
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- BOOST_DIR="boost_1_64_0"
- BOOST_URL="https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2"
- CXXFLAGS="-Wall -Wextra -O2"
- CONFIGFLAGS=""
- MATRIX_EVAL="CC=gcc-6 CXX=g++-6"
compiler: gcc
#
# Linux / g++-6 / -O0 / boost 1.64 / epoll disabled
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- BOOST_DIR="boost_1_64_0"
- BOOST_URL="https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2"
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline -DASIO_DISABLE_EPOLL"
- CONFIGFLAGS=""
- MATRIX_EVAL="CC=gcc-6 CXX=g++-6"
compiler: gcc
#
# Linux / g++-6 / -O0 / boost 1.64 / separate compilation
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
env:
- BOOST_DIR="boost_1_64_0"
- BOOST_URL="https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2"
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline"
- CONFIGFLAGS="--enable-separate-compilation"
- MATRIX_EVAL="CC=gcc-6 CXX=g++-6"
compiler: gcc
#
#---------------------------------------------------------------------------
# Linux / g++-4.8
#---------------------------------------------------------------------------
#
# Linux / g++-4.8 / -O2 / standalone
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
env:
- CXXFLAGS="-Wall -Wextra -O2"
- CONFIGFLAGS="--with-boost=no"
- MATRIX_EVAL="CC=gcc-4.8 CXX=g++-4.8"
compiler: gcc
#
# Linux / g++-4.8 / -O0 / standalone / separate compilation
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
env:
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline"
- CONFIGFLAGS="--with-boost=no --enable-separate-compilation"
- MATRIX_EVAL="CC=gcc-4.8 CXX=g++-4.8"
compiler: gcc
#
# Linux / g++-4.8 / -O2 / boost 1.64
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
env:
- BOOST_DIR="boost_1_64_0"
- BOOST_URL="https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2"
- CXXFLAGS="-Wall -Wextra -O2"
- CONFIGFLAGS=""
- MATRIX_EVAL="CC=gcc-4.8 CXX=g++-4.8"
compiler: gcc
#
# Linux / g++-4.8 -std=c++11 / -O2 / boost 1.64
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
env:
- BOOST_DIR="boost_1_64_0"
- BOOST_URL="https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2"
- CXXFLAGS="-std=c++11 -Wall -Wextra -O2"
- CONFIGFLAGS=""
- MATRIX_EVAL="CC=gcc-4.8 CXX=g++-4.8"
compiler: gcc
#
#---------------------------------------------------------------------------
# Linux / clang-3.8
#---------------------------------------------------------------------------
#
# Linux / clang-3.8 / -O2 / standalone"
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env:
- CXXFLAGS="-Wall -Wextra -O2"
- CONFIGFLAGS="--with-boost=no"
- MATRIX_EVAL="CC=clang-3.8 CXX=clang++-3.8"
compiler: clang
#
# Linux / clang-3.8 / -O0 / standalone / separate compilation
#
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
env:
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline"
- CONFIGFLAGS="--with-boost=no --enable-separate-compilation"
- MATRIX_EVAL="CC=clang-3.8 CXX=clang++-3.8"
compiler: clang
#
#---------------------------------------------------------------------------
# macOS / xcode8
#---------------------------------------------------------------------------
#
# macOS / xcode8 / -O2 / standalone
#
- os: osx
env:
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline"
- CONFIGFLAGS="--with-boost=no"
osx_image: xcode8
#
# macOS / xcode8 / -O0 / standalone / kqueue disabled
#
- os: osx
env:
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline -DASIO_DISABLE_KQUEUE"
- CONFIGFLAGS="--with-boost=no"
osx_image: xcode8
#
# macOS / xcode8 / -O0 / standalone / separate compilation
#
- os: osx
env:
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline"
- CONFIGFLAGS="--with-boost=no --enable-separate-compilation"
osx_image: xcode8
#
# macOS / xcode8 / -O2 / boost 1.64
#
- os: osx
env:
- BOOST_DIR="boost_1_64_0"
- BOOST_URL="https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2"
- CXXFLAGS="-Wall -Wextra -O2"
- CONFIGFLAGS=""
osx_image: xcode8
#
# macOS / xcode8 / -O0 / boost 1.64 / separate compilation
#
- os: osx
env:
- BOOST_DIR="boost_1_64_0"
- BOOST_URL="https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.bz2"
- CXXFLAGS="-Wall -Wextra -O0 -fno-inline"
- CONFIGFLAGS="--enable-separate-compilation"
osx_image: xcode8
before_install:
- eval "${MATRIX_EVAL}"
install:
- |
if [[ "${BOOST_URL}" != "" ]]; then
if [[ -z "$(ls -A ${BOOST_DIR})" ]]; then
{ travis_retry wget --quiet -O - ${BOOST_URL} | tar -xj; } || exit 1
fi
fi
script:
- cd asio && ./autogen.sh && ./configure $CONFIGFLAGS && make && make check
notifications:
email: false

View File

@@ -15,6 +15,7 @@ test-driver
/doc
/lib
/boostified
/tsified
*.gz
*.bz2
*.zip

View File

@@ -1,4 +1,4 @@
Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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)

View File

@@ -1,4 +1,4 @@
asio version 1.11.0
Released Monday, 16 February 2015.
asio version 1.12.0
Released Sunday, 04 March 2018.
See doc/index.html for API documentation and a tutorial.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -139,6 +139,7 @@ sub copy_source_file
$line =~ s/asio\.examples/boost_asio.examples/g;
$line =~ s/asio\.history/boost_asio.history/g;
$line =~ s/asio\.index/boost_asio.index/g;
$line =~ s/asio\.net_ts/boost_asio.net_ts/g;
$line =~ s/asio\.overview/boost_asio.overview/g;
$line =~ s/asio\.reference/boost_asio.reference/g;
$line =~ s/asio\.tutorial/boost_asio.tutorial/g;
@@ -154,7 +155,7 @@ sub copy_source_file
}
# Conditional replacements.
if ($line =~ /^( *)namespace asio {/)
if ($line =~ /^( *)namespace asio \{/)
{
if ($is_qbk)
{
@@ -242,7 +243,7 @@ sub copy_source_file
{
# Line is removed.
}
elsif ($line =~ /asio::thread/)
elsif ($line =~ /asio::thread\b/)
{
if ($is_test)
{
@@ -269,7 +270,7 @@ sub copy_source_file
print_line($output, $1 . "boost::thread" . $2, $from, $lineno);
}
}
elsif ($line =~ /namespace std {/)
elsif ($line =~ /namespace std \{ *$/)
{
print_line($output, "namespace boost {", $from, $lineno);
print_line($output, "namespace system {", $from, $lineno);
@@ -277,6 +278,7 @@ sub copy_source_file
elsif ($line =~ /std::error_code/)
{
$line =~ s/std::error_code/boost::system::error_code/g;
$line =~ s/asio::/boost::asio::/g if !$is_xsl;
print_line($output, $line, $from, $lineno);
}
elsif ($line =~ /} \/\/ namespace std/)
@@ -381,6 +383,7 @@ sub copy_include_files
"include/asio/ssl/impl",
"include/asio/ssl/old",
"include/asio/ssl/old/detail",
"include/asio/ts",
"include/asio/windows");
foreach my $dir (@dirs)
@@ -428,6 +431,7 @@ sub copy_unit_tests
"src/tests/unit/local",
"src/tests/unit/posix",
"src/tests/unit/ssl",
"src/tests/unit/ts",
"src/tests/unit/windows");
our $boost_dir;
@@ -515,9 +519,15 @@ sub copy_examples
"src/examples/cpp11/chat",
"src/examples/cpp11/echo",
"src/examples/cpp11/executors",
"src/examples/cpp11/fork",
"src/examples/cpp11/futures",
"src/examples/cpp11/handler_tracking",
"src/examples/cpp11/http/server",
"src/examples/cpp11/invocation",
"src/examples/cpp11/iostreams",
"src/examples/cpp11/local",
"src/examples/cpp11/multicast",
"src/examples/cpp11/nonblocking",
"src/examples/cpp11/spawn",
"src/examples/cpp14/executors");
@@ -547,6 +557,7 @@ sub copy_doc
my @files = (
"src/doc/asio.qbk",
"src/doc/examples.qbk",
"src/doc/net_ts.qbk",
"src/doc/reference.xsl",
"src/doc/tutorial.xsl",
glob("src/doc/overview/*.qbk"),

View File

@@ -1,4 +1,4 @@
AC_INIT(asio, [1.11.0])
AC_INIT(asio, [1.12.0])
AC_CONFIG_SRCDIR(include/asio.hpp)
AM_MAINTAINER_MODE
AM_INIT_AUTOMAKE([tar-ustar])
@@ -17,140 +17,18 @@ AC_ARG_WITH(boost,
if test "${withval}" = no; then
STANDALONE="yes"
else
CPPFLAGS="$CPPFLAGS -I${withval}"
CPPFLAGS="$CPPFLAGS -I${withval} -DBOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING"
LIBS="$LIBS -L${withval}/stage/lib"
fi
],
[
BOOSTDIR="`pwd`/../boost_1_55_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
LIBS="$LIBS -L${BOOSTDIR}/stage/lib"
else
BOOSTDIR="`pwd`/../boost_1_54_0"
BOOSTDIR=`ls -1d ../boost_*_*_*/ 2>/dev/null | sort -t "_" -k 2nr -k 3nr -k 4nr | head -n 1 | sed -e 's/\/$//'`
if test "${BOOSTDIR}" != ""; then
BOOSTDIR="`pwd`/${BOOSTDIR}"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
echo "using automatically detected boost from ${BOOSTDIR}"
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR} -DBOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING"
LIBS="$LIBS -L${BOOSTDIR}/stage/lib"
else
BOOSTDIR="`pwd`/../boost_1_53_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_52_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_51_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_50_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_49_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_48_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_47_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_46_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_46_1"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_45_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_44_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_43_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_42_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_41_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_40_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_39_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_38_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_37_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_36_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_35_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_34_1"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_34_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_33_1"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
else
BOOSTDIR="`pwd`/../boost_1_33_0"
if test -d "${BOOSTDIR}"; then
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
])
@@ -179,7 +57,8 @@ fi
AC_ARG_WITH(openssl,
AC_HELP_STRING([--with-openssl=DIR],[location of openssl]),
[
CPPFLAGS="$CPPFLAGS -I${withval}"
CPPFLAGS="$CPPFLAGS -I${withval}/include"
LIBS="$LIBS -L${withval}/lib"
],[])
AC_CHECK_HEADER([openssl/ssl.h],,
@@ -198,6 +77,7 @@ case $host in
*-*-linux*)
CXXFLAGS="$CXXFLAGS -pthread"
LDFLAGS="$LDFLAGS -pthread"
LIBS="$LIBS -lrt"
;;
*-*-solaris*)
if test "$GXX" = yes; then

View File

@@ -322,8 +322,9 @@ nobase_include_HEADERS = \
asio/impl/spawn.hpp \
asio/impl/src.cpp \
asio/impl/src.hpp \
asio/impl/system_context.hpp \
asio/impl/system_context.ipp \
asio/impl/system_executor.hpp \
asio/impl/system_executor.ipp \
asio/impl/thread_pool.hpp \
asio/impl/thread_pool.ipp \
asio/impl/use_future.hpp \
@@ -437,6 +438,7 @@ nobase_include_HEADERS = \
asio/strand.hpp \
asio/streambuf.hpp \
asio/stream_socket_service.hpp \
asio/system_context.hpp \
asio/system_error.hpp \
asio/system_executor.hpp \
asio/system_timer.hpp \

View File

@@ -2,7 +2,7 @@
// asio.hpp
// ~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -62,6 +62,7 @@
#include "asio/handler_continuation_hook.hpp"
#include "asio/handler_invoke_hook.hpp"
#include "asio/handler_type.hpp"
#include "asio/high_resolution_timer.hpp"
#include "asio/io_context.hpp"
#include "asio/io_context_strand.hpp"
#include "asio/io_service.hpp"
@@ -117,11 +118,14 @@
#include "asio/signal_set_service.hpp"
#include "asio/socket_acceptor_service.hpp"
#include "asio/socket_base.hpp"
#include "asio/steady_timer.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/system_timer.hpp"
#include "asio/thread.hpp"
#include "asio/thread_pool.hpp"
#include "asio/time_traits.hpp"

View File

@@ -2,7 +2,7 @@
// associated_allocator.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -116,6 +116,14 @@ 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"

View File

@@ -2,7 +2,7 @@
// associated_executor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -135,6 +135,13 @@ get_associated_executor(const T& t, ExecutionContext& ctx,
typename ExecutionContext::executor_type>::get(t, ctx.get_executor());
}
#if defined(ASIO_HAS_ALIAS_TEMPLATES)
template <typename T, typename Executor = system_executor>
using associated_executor_t = typename associated_executor<T, Executor>::type;
#endif // defined(ASIO_HAS_ALIAS_TEMPLATES)
} // namespace asio
#include "asio/detail/pop_options.hpp"

View File

@@ -2,7 +2,7 @@
// async_result.hpp
// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// basic_datagram_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// basic_deadline_timer.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// basic_io_object.hpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// basic_raw_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// basic_seq_packet_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// basic_serial_port.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Rep Invariant Systems, Inc. (info@repinvariant.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@@ -2,7 +2,7 @@
// basic_signal_set.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// basic_socket.hpp
// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -865,6 +865,8 @@ public:
asio::error_code ec;
const protocol_type protocol = peer_endpoint.protocol();
this->get_service().open(this->get_implementation(), protocol, ec);
if (!ec)
async_connect_post_open(protocol, ec);
if (ec)
{
async_completion<ConnectHandler,
@@ -1741,6 +1743,11 @@ protected:
}
private:
// optional user code hook immediately after socket open in async_connect
virtual void async_connect_post_open(const protocol_type& protocol, asio::error_code& ec)
{
}
// Disallow copying and assignment.
basic_socket(const basic_socket&) ASIO_DELETED;
basic_socket& operator=(const basic_socket&) ASIO_DELETED;

View File

@@ -2,7 +2,7 @@
// basic_socket_acceptor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// basic_socket_iostream.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -215,6 +215,8 @@ public:
this->setf(std::ios_base::unitbuf);
}
#if defined(ASIO_HAS_STD_IOSTREAM_MOVE) \
|| defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_socket_iostream from another.
basic_socket_iostream(basic_socket_iostream&& other)
: detail::socket_iostream_base<
@@ -236,6 +238,8 @@ public:
WaitTraits ASIO_SVC_TARG1>::operator=(std::move(other));
return *this;
}
#endif // defined(ASIO_HAS_STD_IOSTREAM_MOVE)
// || defined(GENERATING_DOCUMENTATION)
#endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
#if defined(GENERATING_DOCUMENTATION)

View File

@@ -2,7 +2,7 @@
// basic_socket_streambuf.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// basic_stream_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// basic_streambuf.hpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -232,8 +232,7 @@ public:
*/
void commit(std::size_t n)
{
if (pptr() + n > epptr())
n = epptr() - pptr();
n = std::min<std::size_t>(n, epptr() - pptr());
pbump(static_cast<int>(n));
setg(eback(), gptr(), pptr());
}

View File

@@ -2,7 +2,7 @@
// basic_streambuf_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// basic_waitable_timer.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// bind_executor.hpp
// ~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// buffer.hpp
// ~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -28,13 +28,13 @@
#include "asio/detail/throw_exception.hpp"
#include "asio/detail/type_traits.hpp"
#if defined(ASIO_MSVC)
#if defined(ASIO_MSVC) && (ASIO_MSVC >= 1700)
# if defined(_HAS_ITERATOR_DEBUGGING) && (_HAS_ITERATOR_DEBUGGING != 0)
# if !defined(ASIO_DISABLE_BUFFER_DEBUGGING)
# define ASIO_ENABLE_BUFFER_DEBUGGING
# endif // !defined(ASIO_DISABLE_BUFFER_DEBUGGING)
# endif // defined(_HAS_ITERATOR_DEBUGGING)
#endif // defined(ASIO_MSVC)
#endif // defined(ASIO_MSVC) && (ASIO_MSVC >= 1700)
#if defined(__GNUC__)
# if defined(_GLIBCXX_DEBUG)
@@ -1920,7 +1920,8 @@ inline std::size_t buffer_copy_1(const mutable_buffer& target,
std::size_t target_size = target.size();
std::size_t source_size = source.size();
std::size_t n = target_size < source_size ? target_size : source_size;
memcpy(target.data(), source.data(), n);
if (n > 0)
memcpy(target.data(), source.data(), n);
return n;
}

View File

@@ -2,7 +2,7 @@
// buffered_read_stream.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// buffered_read_stream_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// buffered_stream.hpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// buffered_stream_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// buffered_write_stream.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// buffered_write_stream_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// buffers_iterator.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// completion_condition.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// connect.hpp
// ~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// coroutine.hpp
// ~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -289,7 +289,7 @@ private:
bail_out_of_coroutine: \
break; \
} \
else case 0:
else /* fall-through */ case 0:
#define ASIO_CORO_YIELD_IMPL(n) \
for (_coro_value = (n);;) \
@@ -301,12 +301,12 @@ private:
else \
switch (_coro_value ? 0 : 1) \
for (;;) \
case -1: if (_coro_value) \
/* fall-through */ case -1: if (_coro_value) \
goto terminate_coroutine; \
else for (;;) \
case 1: if (_coro_value) \
/* fall-through */ case 1: if (_coro_value) \
goto bail_out_of_coroutine; \
else case 0:
else /* fall-through */ case 0:
#define ASIO_CORO_FORK_IMPL(n) \
for (_coro_value = -(n);; _coro_value = (n)) \

View File

@@ -2,7 +2,7 @@
// datagram_socket_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// deadline_timer.hpp
// ~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// deadline_timer_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// defer.hpp
// ~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/array.hpp
// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/array_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/assert.hpp
// ~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/atomic_count.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/base_from_completion_cond.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/bind_handler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -223,6 +223,363 @@ inline binder2<typename decay<Handler>::type, Arg1, Arg2> bind_handler(
ASIO_MOVE_CAST(Handler)(handler), arg1, arg2);
}
template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
class binder3
{
public:
template <typename T>
binder3(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3)
: handler_(ASIO_MOVE_CAST(T)(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3)
{
}
binder3(Handler& handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3)
: handler_(ASIO_MOVE_CAST(Handler)(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3)
{
}
#if defined(ASIO_HAS_MOVE)
binder3(const binder3& other)
: handler_(other.handler_),
arg1_(other.arg1_),
arg2_(other.arg2_),
arg3_(other.arg3_)
{
}
binder3(binder3&& other)
: handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)),
arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)),
arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_))
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
handler_(static_cast<const Arg1&>(arg1_),
static_cast<const Arg2&>(arg2_), static_cast<const Arg3&>(arg3_));
}
void operator()() const
{
handler_(arg1_, arg2_, arg3_);
}
//private:
Handler handler_;
Arg1 arg1_;
Arg2 arg2_;
Arg3 arg3_;
};
template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
inline void* asio_handler_allocate(std::size_t size,
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
inline void asio_handler_deallocate(void* pointer, std::size_t size,
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
inline bool asio_handler_is_continuation(
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
return asio_handler_cont_helpers::is_continuation(
this_handler->handler_);
}
template <typename Function, typename Handler,
typename Arg1, typename Arg2, typename Arg3>
inline void asio_handler_invoke(Function& function,
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
}
template <typename Function, typename Handler,
typename Arg1, typename Arg2, typename Arg3>
inline void asio_handler_invoke(const Function& function,
binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
{
asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
inline binder3<typename decay<Handler>::type, Arg1, Arg2, Arg3> bind_handler(
ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1, const Arg2& arg2,
const Arg3& arg3)
{
return binder3<typename decay<Handler>::type, Arg1, Arg2, Arg3>(0,
ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3);
}
template <typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
class binder4
{
public:
template <typename T>
binder4(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3, const Arg4& arg4)
: handler_(ASIO_MOVE_CAST(T)(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3),
arg4_(arg4)
{
}
binder4(Handler& handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3, const Arg4& arg4)
: handler_(ASIO_MOVE_CAST(Handler)(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3),
arg4_(arg4)
{
}
#if defined(ASIO_HAS_MOVE)
binder4(const binder4& other)
: handler_(other.handler_),
arg1_(other.arg1_),
arg2_(other.arg2_),
arg3_(other.arg3_),
arg4_(other.arg4_)
{
}
binder4(binder4&& other)
: handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)),
arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)),
arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_)),
arg4_(ASIO_MOVE_CAST(Arg4)(other.arg4_))
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
handler_(static_cast<const Arg1&>(arg1_),
static_cast<const Arg2&>(arg2_), static_cast<const Arg3&>(arg3_),
static_cast<const Arg4&>(arg4_));
}
void operator()() const
{
handler_(arg1_, arg2_, arg3_, arg4_);
}
//private:
Handler handler_;
Arg1 arg1_;
Arg2 arg2_;
Arg3 arg3_;
Arg4 arg4_;
};
template <typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline void* asio_handler_allocate(std::size_t size,
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
}
template <typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline void asio_handler_deallocate(void* pointer, std::size_t size,
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
}
template <typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline bool asio_handler_is_continuation(
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
return asio_handler_cont_helpers::is_continuation(
this_handler->handler_);
}
template <typename Function, typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline void asio_handler_invoke(Function& function,
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
}
template <typename Function, typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline void asio_handler_invoke(const Function& function,
binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
{
asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
}
template <typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4>
inline binder4<typename decay<Handler>::type, Arg1, Arg2, Arg3, Arg4>
bind_handler(ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3, const Arg4& arg4)
{
return binder4<typename decay<Handler>::type, Arg1, Arg2, Arg3, Arg4>(0,
ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3, arg4);
}
template <typename Handler, typename Arg1, typename Arg2,
typename Arg3, typename Arg4, typename Arg5>
class binder5
{
public:
template <typename T>
binder5(int, ASIO_MOVE_ARG(T) handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
: handler_(ASIO_MOVE_CAST(T)(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3),
arg4_(arg4),
arg5_(arg5)
{
}
binder5(Handler& handler, const Arg1& arg1, const Arg2& arg2,
const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
: handler_(ASIO_MOVE_CAST(Handler)(handler)),
arg1_(arg1),
arg2_(arg2),
arg3_(arg3),
arg4_(arg4),
arg5_(arg5)
{
}
#if defined(ASIO_HAS_MOVE)
binder5(const binder5& other)
: handler_(other.handler_),
arg1_(other.arg1_),
arg2_(other.arg2_),
arg3_(other.arg3_),
arg4_(other.arg4_),
arg5_(other.arg5_)
{
}
binder5(binder5&& other)
: handler_(ASIO_MOVE_CAST(Handler)(other.handler_)),
arg1_(ASIO_MOVE_CAST(Arg1)(other.arg1_)),
arg2_(ASIO_MOVE_CAST(Arg2)(other.arg2_)),
arg3_(ASIO_MOVE_CAST(Arg3)(other.arg3_)),
arg4_(ASIO_MOVE_CAST(Arg4)(other.arg4_)),
arg5_(ASIO_MOVE_CAST(Arg5)(other.arg5_))
{
}
#endif // defined(ASIO_HAS_MOVE)
void operator()()
{
handler_(static_cast<const Arg1&>(arg1_),
static_cast<const Arg2&>(arg2_), static_cast<const Arg3&>(arg3_),
static_cast<const Arg4&>(arg4_), static_cast<const Arg5&>(arg5_));
}
void operator()() const
{
handler_(arg1_, arg2_, arg3_, arg4_, arg5_);
}
//private:
Handler handler_;
Arg1 arg1_;
Arg2 arg2_;
Arg3 arg3_;
Arg4 arg4_;
Arg5 arg5_;
};
template <typename Handler, typename Arg1, typename Arg2,
typename Arg3, typename Arg4, typename Arg5>
inline void* asio_handler_allocate(std::size_t size,
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
return asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2,
typename Arg3, typename Arg4, typename Arg5>
inline void asio_handler_deallocate(void* pointer, std::size_t size,
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2,
typename Arg3, typename Arg4, typename Arg5>
inline bool asio_handler_is_continuation(
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
return asio_handler_cont_helpers::is_continuation(
this_handler->handler_);
}
template <typename Function, typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4, typename Arg5>
inline void asio_handler_invoke(Function& function,
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
}
template <typename Function, typename Handler, typename Arg1,
typename Arg2, typename Arg3, typename Arg4, typename Arg5>
inline void asio_handler_invoke(const Function& function,
binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
{
asio_handler_invoke_helpers::invoke(
function, this_handler->handler_);
}
template <typename Handler, typename Arg1, typename Arg2,
typename Arg3, typename Arg4, typename Arg5>
inline binder5<typename decay<Handler>::type, Arg1, Arg2, Arg3, Arg4, Arg5>
bind_handler(ASIO_MOVE_ARG(Handler) handler, const Arg1& arg1,
const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
{
return binder5<typename decay<Handler>::type, Arg1, Arg2, Arg3, Arg4, Arg5>(0,
ASIO_MOVE_CAST(Handler)(handler), arg1, arg2, arg3, arg4, arg5);
}
#if defined(ASIO_HAS_MOVE)
template <typename Handler, typename Arg1>

View File

@@ -2,7 +2,7 @@
// detail/buffer_resize_guard.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/buffer_sequence_adapter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/buffered_stream_storage.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/call_stack.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/chrono.hpp
// ~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/chrono_time_traits.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/completion_handler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/concurrency_hint.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/conditionally_enabled_event.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/conditionally_enabled_mutex.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/config.hpp
// ~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -161,6 +161,11 @@
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
# if defined(ASIO_MSVC)
# if (_MSC_VER >= 1900)
# define ASIO_HAS_VARIADIC_TEMPLATES 1
# endif // (_MSC_VER >= 1900)
# endif // defined(ASIO_MSVC)
# endif // !defined(ASIO_DISABLE_VARIADIC_TEMPLATES)
#endif // !defined(ASIO_HAS_VARIADIC_TEMPLATES)
@@ -178,6 +183,11 @@
# define ASIO_DELETED = delete
# endif // __has_feature(__cxx_deleted_functions__)
# endif // defined(__clang__)
# if defined(ASIO_MSVC)
# if (_MSC_VER >= 1900)
# define ASIO_DELETED = delete
# endif // (_MSC_VER >= 1900)
# endif // defined(ASIO_MSVC)
# if !defined(ASIO_DELETED)
# define ASIO_DELETED
# endif // !defined(ASIO_DELETED)
@@ -198,6 +208,11 @@
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
# if defined(ASIO_MSVC)
# if (_MSC_VER >= 1900)
# define ASIO_HAS_CONSTEXPR 1
# endif // (_MSC_VER >= 1900)
# endif // defined(ASIO_MSVC)
# endif // !defined(ASIO_DISABLE_CONSTEXPR)
#endif // !defined(ASIO_HAS_CONSTEXPR)
#if !defined(ASIO_CONSTEXPR)
@@ -264,6 +279,29 @@
# endif // !defined(ASIO_DISABLE_DECLTYPE)
#endif // !defined(ASIO_HAS_DECLTYPE)
// Support alias templates on compilers known to allow it.
#if !defined(ASIO_HAS_ALIAS_TEMPLATES)
# if !defined(ASIO_DISABLE_ALIAS_TEMPLATES)
# if defined(__clang__)
# if __has_feature(__cxx_alias_templates__)
# define ASIO_HAS_ALIAS_TEMPLATES 1
# endif // __has_feature(__cxx_alias_templates__)
# endif // defined(__clang__)
# if defined(__GNUC__)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# if defined(__GXX_EXPERIMENTAL_CXX0X__)
# define ASIO_HAS_ALIAS_TEMPLATES 1
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
# if defined(ASIO_MSVC)
# if (_MSC_VER >= 1900)
# define ASIO_HAS_ALIAS_TEMPLATES 1
# endif // (_MSC_VER >= 1900)
# endif // defined(ASIO_MSVC)
# endif // !defined(ASIO_DISABLE_ALIAS_TEMPLATES)
#endif // !defined(ASIO_HAS_ALIAS_TEMPLATES)
// Standard library support for system errors.
#if !defined(ASIO_HAS_STD_SYSTEM_ERROR)
# if !defined(ASIO_DISABLE_STD_SYSTEM_ERROR)
@@ -405,11 +443,11 @@
# endif // (__cplusplus >= 201103)
# endif // defined(__clang__)
# if defined(__GNUC__)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# if defined(__GXX_EXPERIMENTAL_CXX0X__)
# define ASIO_HAS_STD_ATOMIC 1
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
# if defined(ASIO_MSVC)
# if (_MSC_VER >= 1700)
@@ -585,16 +623,16 @@
# define ASIO_HAS_CXX11_ALLOCATORS 1
# endif // (__cplusplus >= 201103)
# elif defined(__GNUC__)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# if defined(__GXX_EXPERIMENTAL_CXX0X__)
# define ASIO_HAS_CXX11_ALLOCATORS 1
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
# if defined(ASIO_MSVC)
# if (_MSC_VER >= 1700)
# if (_MSC_VER >= 1800)
# define ASIO_HAS_CXX11_ALLOCATORS 1
# endif // (_MSC_VER >= 1700)
# endif // (_MSC_VER >= 1800)
# endif // defined(ASIO_MSVC)
# endif // !defined(ASIO_DISABLE_CXX11_ALLOCATORS)
#endif // !defined(ASIO_HAS_CXX11_ALLOCATORS)
@@ -736,24 +774,47 @@
#if !defined(ASIO_HAS_STD_STRING_VIEW)
# if !defined(ASIO_DISABLE_STD_STRING_VIEW)
# if defined(__clang__)
# if (__cplusplus >= 201103)
# if (__cplusplus >= 201402)
# if __has_include(<experimental/string_view>)
# define ASIO_HAS_STD_STRING_VIEW 1
# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
# endif // __has_include(<experimental/string_view>)
# endif // (__cplusplus >= 201103)
# endif // (__cplusplus >= 201402)
# endif // defined(__clang__)
# if defined(__GNUC__)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)
# if (__cplusplus >= 201300)
# if (__cplusplus >= 201402)
# define ASIO_HAS_STD_STRING_VIEW 1
# define ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
# endif // (__cplusplus >= 201300)
# endif // (__cplusplus >= 201402)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
# if defined(ASIO_MSVC)
# if (_MSC_VER >= 1910 && _HAS_CXX17)
# define ASIO_HAS_STD_STRING_VIEW
# endif // (_MSC_VER >= 1910)
# endif // defined(ASIO_MSVC)
# endif // !defined(ASIO_DISABLE_STD_STRING_VIEW)
#endif // !defined(ASIO_HAS_STD_STRING_VIEW)
// Standard library support for iostream move construction and assignment.
#if !defined(ASIO_HAS_STD_IOSTREAM_MOVE)
# if !defined(ASIO_DISABLE_STD_IOSTREAM_MOVE)
# if defined(__GNUC__)
# if (__GNUC__ > 4)
# if defined(__GXX_EXPERIMENTAL_CXX0X__)
# define ASIO_HAS_STD_IOSTREAM_MOVE 1
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
# endif // (__GNUC__ > 4)
# endif // defined(__GNUC__)
# if defined(ASIO_MSVC)
# if (_MSC_VER >= 1700)
# define ASIO_HAS_STD_IOSTREAM_MOVE 1
# endif // (_MSC_VER >= 1700)
# endif // defined(ASIO_MSVC)
# endif // !defined(ASIO_DISABLE_STD_IOSTREAM_MOVE)
#endif // !defined(ASIO_HAS_STD_IOSTREAM_MOVE)
// Windows App target. Windows but with a limited API.
#if !defined(ASIO_WINDOWS_APP)
# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0603)
@@ -1279,8 +1340,16 @@
#endif // defined(ASIO_NO_DEPRECATED)
// Newer gcc, clang need special treatment to suppress unused typedef warnings.
#if defined(__clang__) && (__clang_major__ >= 7)
# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
#if defined(__clang__)
# if defined(__apple_build_version__)
# if (__clang_major__ >= 7)
# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
# endif // (__clang_major__ >= 7)
# elif ((__clang_major__ == 3) && (__clang_minor__ >= 6)) \
|| (__clang_major__ > 3)
# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
# endif // ((__clang_major__ == 3) && (__clang_minor__ >= 6))
// || (__clang_major__ > 3)
#elif defined(__GNUC__)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
# define ASIO_UNUSED_TYPEDEF __attribute__((__unused__))

View File

@@ -2,7 +2,7 @@
// detail/consuming_buffers.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -26,19 +26,37 @@
namespace asio {
namespace detail {
// Helper template to determine the maximum number of prepared buffers.
template <typename Buffers>
struct prepared_buffers_max
{
enum { value = buffer_sequence_adapter_base::max_buffers };
};
template <typename Elem, std::size_t N>
struct prepared_buffers_max<boost::array<Elem, N> >
{
enum { value = N };
};
#if defined(ASIO_HAS_STD_ARRAY)
template <typename Elem, std::size_t N>
struct prepared_buffers_max<std::array<Elem, N> >
{
enum { value = N };
};
#endif // defined(ASIO_HAS_STD_ARRAY)
// A buffer sequence used to represent a subsequence of the buffers.
template <typename Buffer>
template <typename Buffer, std::size_t MaxBuffers>
struct prepared_buffers
{
typedef Buffer value_type;
typedef const Buffer* const_iterator;
enum
{
max_buffers = buffer_sequence_adapter_base::max_buffers < 8
? buffer_sequence_adapter_base::max_buffers : 8
};
enum { max_buffers = MaxBuffers < 16 ? MaxBuffers : 16 };
prepared_buffers() : count(0) {}
const_iterator begin() const { return elems; }
@@ -53,14 +71,18 @@ template <typename Buffer, typename Buffers, typename Buffer_Iterator>
class consuming_buffers
{
public:
typedef prepared_buffers<Buffer, prepared_buffers_max<Buffers>::value>
prepared_buffers_type;
// Construct to represent the entire list of buffers.
explicit consuming_buffers(const Buffers& buffers)
: buffers_(buffers),
total_size_(asio::buffer_size(buffers)),
total_consumed_(0),
next_elem_(0),
next_elem_offset_(0)
{
using asio::buffer_size;
total_size_ = buffer_size(buffers);
}
// Determine if we are at the end of the buffers.
@@ -70,9 +92,9 @@ public:
}
// Get the buffer for a single transfer, with a size.
prepared_buffers<Buffer> prepare(std::size_t max_size)
prepared_buffers_type prepare(std::size_t max_size)
{
prepared_buffers<Buffer> result;
prepared_buffers_type result;
Buffer_Iterator next = asio::buffer_sequence_begin(buffers_);
Buffer_Iterator end = asio::buffer_sequence_end(buffers_);

View File

@@ -2,7 +2,7 @@
// detail/cstddef.hpp
// ~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/cstdint.hpp
// ~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/date_time_fwd.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/deadline_timer_service.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/dependent_type.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/descriptor_ops.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/descriptor_read_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/descriptor_write_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/dev_poll_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -101,15 +101,21 @@ public:
ASIO_DECL void cancel_ops(socket_type descriptor, per_descriptor_data&);
// Cancel any operations that are running against the descriptor and remove
// its registration from the reactor.
// its registration from the reactor. The reactor resources associated with
// the descriptor must be released by calling cleanup_descriptor_data.
ASIO_DECL void deregister_descriptor(socket_type descriptor,
per_descriptor_data&, bool closing);
// Cancel any operations that are running against the descriptor and remove
// its registration from the reactor.
// Remove the descriptor's registration from the reactor. The reactor
// resources associated with the descriptor must be released by calling
// cleanup_descriptor_data.
ASIO_DECL void deregister_internal_descriptor(
socket_type descriptor, per_descriptor_data&);
// Perform any post-deregistration cleanup tasks associated with the
// descriptor data.
ASIO_DECL void cleanup_descriptor_data(per_descriptor_data&);
// Add a new timer queue to the reactor.
template <typename Time_Traits>
void add_timer_queue(timer_queue<Time_Traits>& queue);
@@ -139,7 +145,7 @@ public:
typename timer_queue<Time_Traits>::per_timer_data& source);
// Run /dev/poll once until interrupted or events are ready to be dispatched.
ASIO_DECL void run(bool block, op_queue<operation>& ops);
ASIO_DECL void run(long usec, op_queue<operation>& ops);
// Interrupt the select loop.
ASIO_DECL void interrupt();

View File

@@ -2,7 +2,7 @@
// detail/epoll_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -67,6 +67,7 @@ public:
ASIO_DECL descriptor_state(bool locking);
void set_ready_events(uint32_t events) { task_result_ = events; }
void add_ready_events(uint32_t events) { task_result_ |= events; }
ASIO_DECL operation* perform_io(uint32_t events);
ASIO_DECL static void do_complete(
void* owner, operation* base,
@@ -127,14 +128,22 @@ public:
per_descriptor_data& descriptor_data);
// Cancel any operations that are running against the descriptor and remove
// its registration from the reactor.
// its registration from the reactor. The reactor resources associated with
// the descriptor must be released by calling cleanup_descriptor_data.
ASIO_DECL void deregister_descriptor(socket_type descriptor,
per_descriptor_data& descriptor_data, bool closing);
// Remote the descriptor's registration from the reactor.
// Remove the descriptor's registration from the reactor. The reactor
// resources associated with the descriptor must be released by calling
// cleanup_descriptor_data.
ASIO_DECL void deregister_internal_descriptor(
socket_type descriptor, per_descriptor_data& descriptor_data);
// Perform any post-deregistration cleanup tasks associated with the
// descriptor data.
ASIO_DECL void cleanup_descriptor_data(
per_descriptor_data& descriptor_data);
// Add a new timer queue to the reactor.
template <typename Time_Traits>
void add_timer_queue(timer_queue<Time_Traits>& timer_queue);

View File

@@ -2,7 +2,7 @@
// detail/event.hpp
// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/eventfd_select_interrupter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@@ -2,7 +2,7 @@
// detail/executor_op.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -31,11 +31,12 @@ template <typename Handler, typename Alloc,
class executor_op : public Operation
{
public:
ASIO_DEFINE_HANDLER_ALLOCATOR_PTR(executor_op, Alloc);
ASIO_DEFINE_HANDLER_ALLOCATOR_PTR(executor_op);
executor_op(Handler& h, const Alloc& allocator)
template <typename H>
executor_op(ASIO_MOVE_ARG(H) h, const Alloc& allocator)
: Operation(&executor_op::do_complete),
handler_(ASIO_MOVE_CAST(Handler)(h)),
handler_(ASIO_MOVE_CAST(H)(h)),
allocator_(allocator)
{
}
@@ -46,7 +47,8 @@ public:
{
// Take ownership of the handler object.
executor_op* o(static_cast<executor_op*>(base));
ptr p = { o->allocator_, o, o };
Alloc allocator(o->allocator_);
ptr p = { detail::addressof(allocator), o, o };
ASIO_HANDLER_COMPLETION((*o));

View File

@@ -2,7 +2,7 @@
// detail/fd_set_adapter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/fenced_block.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/functional.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/gcc_arm_fenced_block.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/gcc_hppa_fenced_block.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/gcc_sync_fenced_block.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/gcc_x86_fenced_block.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/global.hpp
// ~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/handler_alloc_helpers.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -18,6 +18,7 @@
#include "asio/detail/config.hpp"
#include "asio/detail/memory.hpp"
#include "asio/detail/noncopyable.hpp"
#include "asio/detail/recycling_allocator.hpp"
#include "asio/associated_allocator.hpp"
#include "asio/handler_alloc_hook.hpp"
@@ -120,17 +121,34 @@ public:
Handler& handler_;
};
template <typename Handler, typename Allocator>
struct get_hook_allocator
{
typedef Allocator type;
static type get(Handler&, const Allocator& a)
{
return a;
}
};
template <typename Handler, typename T>
struct get_hook_allocator<Handler, std::allocator<T> >
{
typedef hook_allocator<Handler, T> type;
static type get(Handler& handler, const std::allocator<T>&)
{
return type(handler);
}
};
} // namespace detail
} // namespace asio
#define ASIO_DEFINE_HANDLER_PTR(op) \
struct ptr \
{ \
typedef typename ::asio::associated_allocator<Handler, \
::asio::detail::hook_allocator<Handler, \
void> >::type associated_allocator_type; \
typedef ASIO_REBIND_ALLOC( \
associated_allocator_type, op) allocator_type; \
Handler* h; \
op* v; \
op* p; \
@@ -140,16 +158,18 @@ public:
} \
static op* allocate(Handler& handler) \
{ \
allocator_type a(::asio::associated_allocator<Handler, \
::asio::detail::hook_allocator<Handler, void> >::get(handler, \
::asio::detail::hook_allocator<Handler, void>(handler))); \
typedef typename ::asio::associated_allocator< \
Handler>::type associated_allocator_type; \
typedef typename ::asio::detail::get_hook_allocator< \
Handler, associated_allocator_type>::type hook_allocator_type; \
ASIO_REBIND_ALLOC(hook_allocator_type, op) a( \
::asio::detail::get_hook_allocator< \
Handler, associated_allocator_type>::get( \
handler, ::asio::get_associated_allocator(handler))); \
return a.allocate(1); \
} \
void reset() \
{ \
allocator_type a(::asio::associated_allocator<Handler, \
::asio::detail::hook_allocator<Handler, void> >::get(*h, \
::asio::detail::hook_allocator<Handler, void>(*h))); \
if (p) \
{ \
p->~op(); \
@@ -157,6 +177,14 @@ public:
} \
if (v) \
{ \
typedef typename ::asio::associated_allocator< \
Handler>::type associated_allocator_type; \
typedef typename ::asio::detail::get_hook_allocator< \
Handler, associated_allocator_type>::type hook_allocator_type; \
ASIO_REBIND_ALLOC(hook_allocator_type, op) a( \
::asio::detail::get_hook_allocator< \
Handler, associated_allocator_type>::get( \
*h, ::asio::get_associated_allocator(*h))); \
a.deallocate(static_cast<op*>(v), 1); \
v = 0; \
} \
@@ -164,16 +192,24 @@ public:
} \
/**/
#define ASIO_DEFINE_HANDLER_ALLOCATOR_PTR(op, alloc) \
#define ASIO_DEFINE_HANDLER_ALLOCATOR_PTR(op) \
struct ptr \
{ \
ASIO_REBIND_ALLOC(alloc, op) a; \
const Alloc* a; \
void* v; \
op* p; \
~ptr() \
{ \
reset(); \
} \
static op* allocate(const Alloc& a) \
{ \
typedef typename ::asio::detail::get_recycling_allocator< \
Alloc>::type recycling_allocator_type; \
ASIO_REBIND_ALLOC(recycling_allocator_type, op) a1( \
::asio::detail::get_recycling_allocator<Alloc>::get(a)); \
return a1.allocate(1); \
} \
void reset() \
{ \
if (p) \
@@ -183,7 +219,11 @@ public:
} \
if (v) \
{ \
a.deallocate(static_cast<op*>(v), 1); \
typedef typename ::asio::detail::get_recycling_allocator< \
Alloc>::type recycling_allocator_type; \
ASIO_REBIND_ALLOC(recycling_allocator_type, op) a1( \
::asio::detail::get_recycling_allocator<Alloc>::get(*a)); \
a1.deallocate(static_cast<op*>(v), 1); \
v = 0; \
} \
} \

View File

@@ -2,7 +2,7 @@
// detail/handler_cont_helpers.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/handler_invoke_helpers.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/handler_tracking.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/handler_type_requirements.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -508,6 +508,10 @@ struct handler_type_requirements
handler_type, handler) \
typedef int ASIO_UNUSED_TYPEDEF
#define ASIO_MOVE_ACCEPT_HANDLER_CHECK( \
handler_type, handler, socket_type) \
typedef int ASIO_UNUSED_TYPEDEF
#define ASIO_CONNECT_HANDLER_CHECK( \
handler_type, handler) \
typedef int ASIO_UNUSED_TYPEDEF

View File

@@ -2,7 +2,7 @@
// detail/handler_work.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/hash_map.hpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/impl/buffer_sequence_adapter.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/impl/descriptor_ops.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/impl/dev_poll_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/impl/dev_poll_reactor.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -67,7 +67,8 @@ void dev_poll_reactor::shutdown()
scheduler_.abandon_operations(ops);
}
void dev_poll_reactor::notify_fork(asio::io_context::fork_event fork_ev)
void dev_poll_reactor::notify_fork(
asio::execution_context::fork_event fork_ev)
{
if (fork_ev == asio::execution_context::fork_child)
{
@@ -234,13 +235,18 @@ void dev_poll_reactor::deregister_internal_descriptor(
op_queue_[i].cancel_operations(descriptor, ops, ec);
}
void dev_poll_reactor::cleanup_descriptor_data(
dev_poll_reactor::per_descriptor_data&)
{
}
void dev_poll_reactor::run(long usec, op_queue<operation>& ops)
{
asio::detail::mutex::scoped_lock lock(mutex_);
// We can return immediately if there's no work to do and the reactor is
// not supposed to block.
if (!block && op_queue_[read_op].empty() && op_queue_[write_op].empty()
if (usec == 0 && op_queue_[read_op].empty() && op_queue_[write_op].empty()
&& op_queue_[except_op].empty() && timer_queues_.all_empty())
return;

View File

@@ -2,7 +2,7 @@
// detail/impl/epoll_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/impl/epoll_reactor.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)
@@ -383,10 +383,16 @@ void epoll_reactor::deregister_descriptor(socket_type descriptor,
context(), static_cast<uintmax_t>(descriptor),
reinterpret_cast<uintmax_t>(descriptor_data)));
free_descriptor_state(descriptor_data);
descriptor_data = 0;
scheduler_.post_deferred_completions(ops);
// Leave descriptor_data set so that it will be freed by the subsequent
// call to cleanup_descriptor_data.
}
else
{
// We are shutting down, so prevent cleanup_descriptor_data from freeing
// the descriptor_data object and let the destructor free it instead.
descriptor_data = 0;
}
}
@@ -416,6 +422,22 @@ void epoll_reactor::deregister_internal_descriptor(socket_type descriptor,
context(), static_cast<uintmax_t>(descriptor),
reinterpret_cast<uintmax_t>(descriptor_data)));
// Leave descriptor_data set so that it will be freed by the subsequent
// call to cleanup_descriptor_data.
}
else
{
// We are shutting down, so prevent cleanup_descriptor_data from freeing
// the descriptor_data object and let the destructor free it instead.
descriptor_data = 0;
}
}
void epoll_reactor::cleanup_descriptor_data(
per_descriptor_data& descriptor_data)
{
if (descriptor_data)
{
free_descriptor_state(descriptor_data);
descriptor_data = 0;
}
@@ -462,6 +484,7 @@ void epoll_reactor::run(long usec, op_queue<operation>& ops)
// Ignore.
}
# endif // defined(ASIO_HAS_TIMERFD)
else
{
unsigned event_mask = 0;
if ((events[i].events & EPOLLIN) != 0)
@@ -512,8 +535,15 @@ void epoll_reactor::run(long usec, op_queue<operation>& ops)
// don't call work_started() here. This still allows the scheduler to
// stop if the only remaining operations are descriptor operations.
descriptor_state* descriptor_data = static_cast<descriptor_state*>(ptr);
descriptor_data->set_ready_events(events[i].events);
ops.push(descriptor_data);
if (!ops.is_enqueued(descriptor_data))
{
descriptor_data->set_ready_events(events[i].events);
ops.push(descriptor_data);
}
else
{
descriptor_data->add_ready_events(events[i].events);
}
}
}

View File

@@ -2,7 +2,7 @@
// detail/impl/eventfd_select_interrupter.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying

View File

@@ -2,7 +2,7 @@
// detail/impl/handler_tracking.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// 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)

View File

@@ -2,7 +2,7 @@
// detail/impl/kqueue_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2005 Stefan Arentz (stefan at soze dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying

Some files were not shown because too many files have changed in this diff Show More