Convert to use quickbook-based documentation.
This commit is contained in:
parent
e92592d059
commit
745a7c22f4
@ -15,4 +15,5 @@ MAINTAINERCLEANFILES = \
|
||||
asio-*.tar.gz
|
||||
|
||||
EXTRA_DIST = \
|
||||
LICENSE_1_0.txt
|
||||
LICENSE_1_0.txt \
|
||||
doc
|
||||
|
@ -16,17 +16,22 @@ AC_ARG_WITH(boost,
|
||||
CPPFLAGS="$CPPFLAGS -I${withval}"
|
||||
],
|
||||
[
|
||||
BOOSTDIR="`pwd`/../boost_1_34_0"
|
||||
BOOSTDIR="`pwd`/../boost_1_34_1"
|
||||
if test -d "${BOOSTDIR}"; then
|
||||
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
|
||||
else
|
||||
BOOSTDIR="`pwd`/../boost_1_33_1"
|
||||
BOOSTDIR="`pwd`/../boost_1_34_0"
|
||||
if test -d "${BOOSTDIR}"; then
|
||||
CPPFLAGS="$CPPFLAGS -I${BOOSTDIR}"
|
||||
else
|
||||
BOOSTDIR="`pwd`/../boost_1_33_0"
|
||||
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
|
||||
@ -78,7 +83,7 @@ case $host in
|
||||
WINDOWS=yes
|
||||
;;
|
||||
*-pc-cygwin*)
|
||||
CXXFLAGS="$CXXFLAGS -D__USE_W32_SOCKETS -D_WIN32_WINNT=0x0500"
|
||||
CXXFLAGS="$CXXFLAGS -D__USE_W32_SOCKETS -D_WIN32_WINNT=0x0501"
|
||||
LIBS="$LIBS -lws2_32 -lmswsock"
|
||||
WINDOWS=yes
|
||||
;;
|
||||
@ -96,20 +101,9 @@ if test "$GXX" = yes; then
|
||||
CXXFLAGS="$CXXFLAGS -ftemplate-depth-256"
|
||||
fi
|
||||
|
||||
AC_CHECK_PROG(DOXYGEN_FOUND,doxygen,yes)
|
||||
AM_CONDITIONAL(HAVE_DOXYGEN,test x$DOXYGEN_FOUND = xyes)
|
||||
AC_CHECK_PROG(HAVE_DOT,dot,YES,NO)
|
||||
AC_SUBST(HAVE_DOT)
|
||||
AM_CONDITIONAL(WINDOWS_TARGET,test x$WINDOWS != xno)
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
include/Makefile
|
||||
src/Makefile
|
||||
src/doc/Makefile
|
||||
src/doc/design.dox
|
||||
src/doc/examples.dox
|
||||
src/doc/index.html
|
||||
src/doc/building.html
|
||||
src/doc/reference.dox
|
||||
src/doc/tutorial.dox])
|
||||
src/Makefile])
|
||||
|
@ -27,17 +27,17 @@ namespace placeholders {
|
||||
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
/// An argument placeholder, for use with @ref boost_bind, that corresponds to
|
||||
/// An argument placeholder, for use with boost::bind(), that corresponds to
|
||||
/// the error argument of a handler for any of the asynchronous functions.
|
||||
unspecified error;
|
||||
|
||||
/// An argument placeholder, for use with @ref boost_bind, that corresponds to
|
||||
/// An argument placeholder, for use with boost::bind(), that corresponds to
|
||||
/// the bytes_transferred argument of a handler for asynchronous functions such
|
||||
/// as asio::basic_stream_socket::async_write_some or
|
||||
/// asio::async_write.
|
||||
unspecified bytes_transferred;
|
||||
|
||||
/// An argument placeholder, for use with @ref boost_bind, that corresponds to
|
||||
/// An argument placeholder, for use with boost::bind(), that corresponds to
|
||||
/// the iterator argument of a handler for asynchronous functions such as
|
||||
/// asio::basic_resolver::resolve.
|
||||
unspecified iterator;
|
||||
|
@ -1,7 +1,5 @@
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
|
||||
SUBDIRS = doc
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
tests/performance/client \
|
||||
tests/performance/server \
|
||||
|
@ -1,9 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
design.dox
|
||||
examples.dox
|
||||
index.html
|
||||
building.html
|
||||
reference.dox
|
||||
tutorial.dox
|
||||
*.doxytags
|
||||
bin
|
||||
html
|
||||
|
53
asio/src/doc/Jamfile.v2
Normal file
53
asio/src/doc/Jamfile.v2
Normal file
@ -0,0 +1,53 @@
|
||||
#
|
||||
# Copyright (c) 2003-2007 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)
|
||||
#
|
||||
|
||||
project asio-doc ;
|
||||
|
||||
using quickbook ;
|
||||
|
||||
xml asio : asio.qbk ;
|
||||
|
||||
boostbook standalone
|
||||
:
|
||||
asio
|
||||
:
|
||||
<xsl:param>boost.image.src=asio.png
|
||||
<xsl:param>boost.image.alt="asio C++ library"
|
||||
<xsl:param>boost.image.w=250
|
||||
<xsl:param>boost.image.h=60
|
||||
<xsl:param>nav.layout=none
|
||||
<xsl:param>navig.graphics.path=""
|
||||
<xsl:param>admon.graphics.path=""
|
||||
<xsl:param>chapter.autolabel=0
|
||||
<xsl:param>chunk.section.depth=8
|
||||
<xsl:param>chunk.first.sections=1
|
||||
<xsl:param>toc.section.depth=2
|
||||
<xsl:param>toc.max.depth=1
|
||||
<xsl:param>generate.section.toc.level=1
|
||||
<xsl:param>generate.toc="chapter nop section nop"
|
||||
;
|
||||
|
||||
install html
|
||||
:
|
||||
/boost//doc/html/boostbook.css
|
||||
/boost//doc/html/images/blank.png
|
||||
/boost//doc/html/images/caution.png
|
||||
/boost//doc/html/images/draft.png
|
||||
/boost//doc/html/images/home.png
|
||||
/boost//doc/html/images/important.png
|
||||
/boost//doc/html/images/next_disabled.png
|
||||
/boost//doc/html/images/next.png
|
||||
/boost//doc/html/images/note.png
|
||||
/boost//doc/html/images/prev_disabled.png
|
||||
/boost//doc/html/images/prev.png
|
||||
/boost//doc/html/images/tip.png
|
||||
/boost//doc/html/images/up_disabled.png
|
||||
/boost//doc/html/images/up.png
|
||||
/boost//doc/html/images/warning.png
|
||||
design/proactor.png
|
||||
asio.png
|
||||
;
|
@ -1,139 +0,0 @@
|
||||
if HAVE_DOXYGEN
|
||||
|
||||
noinst_DATA = \
|
||||
../../doc/index.html \
|
||||
../../doc/building.html \
|
||||
../../doc/asio.css \
|
||||
../../doc/reference/asio.css \
|
||||
../../doc/reference/index.html \
|
||||
../../doc/design/asio.css \
|
||||
../../doc/design/index.html \
|
||||
../../doc/examples/asio.css \
|
||||
../../doc/examples/index.html \
|
||||
../../doc/tutorial/asio.css \
|
||||
../../doc/tutorial/index.html
|
||||
|
||||
doc: \
|
||||
delete_doc \
|
||||
../../doc/index.html \
|
||||
../../doc/building.html \
|
||||
../../doc/asio.css \
|
||||
../../doc/reference/asio.css \
|
||||
../../doc/reference/index.html \
|
||||
../../doc/design/asio.css \
|
||||
../../doc/design/index.html \
|
||||
../../doc/examples/asio.css \
|
||||
../../doc/examples/index.html \
|
||||
../../doc/tutorial/asio.css \
|
||||
../../doc/tutorial/index.html
|
||||
|
||||
delete_doc:
|
||||
-rm -rf ../../doc
|
||||
|
||||
../../doc/index.html: index.html.in
|
||||
mkdir -p ../../doc
|
||||
cp $(srcdir)/index.html ../../doc/index.html
|
||||
|
||||
../../doc/building.html: building.html.in
|
||||
mkdir -p ../../doc
|
||||
cp $(srcdir)/building.html ../../doc/building.html
|
||||
|
||||
../../doc/asio.css: asio.css
|
||||
mkdir -p ../../doc
|
||||
cp $(srcdir)/asio.css ../../doc/asio.css
|
||||
|
||||
../../doc/reference/asio.css: asio.css
|
||||
mkdir -p ../../doc/reference
|
||||
cp $(srcdir)/asio.css ../../doc/reference/asio.css
|
||||
|
||||
../../doc/reference/index.html: reference.dox.in
|
||||
mkdir -p ../../doc/reference
|
||||
doxygen reference.dox
|
||||
|
||||
../../doc/design/asio.css: asio.css
|
||||
mkdir -p ../../doc/design
|
||||
cp $(srcdir)/asio.css ../../doc/design/asio.css
|
||||
|
||||
../../doc/design/index.html: design.dox.in
|
||||
mkdir -p ../../doc/design
|
||||
doxygen design.dox
|
||||
|
||||
../../doc/examples/asio.css: asio.css
|
||||
mkdir -p ../../doc/examples
|
||||
cp $(srcdir)/asio.css ../../doc/examples/asio.css
|
||||
|
||||
../../doc/examples/index.html: examples.dox.in
|
||||
mkdir -p ../../doc/examples
|
||||
doxygen examples.dox
|
||||
|
||||
../../doc/tutorial/asio.css: asio.css
|
||||
mkdir -p ../../doc/tutorial
|
||||
cp $(srcdir)/asio.css ../../doc/tutorial/asio.css
|
||||
|
||||
../../doc/tutorial/index.html: tutorial.dox.in
|
||||
mkdir -p ../../doc/tutorial
|
||||
doxygen tutorial.dox
|
||||
|
||||
EXTRA_DIST = \
|
||||
../../doc/index.html \
|
||||
../../doc/building.html \
|
||||
../../doc/asio.css \
|
||||
../../doc/reference/index.html \
|
||||
../../doc/design/index.html \
|
||||
../../doc/examples/index.html \
|
||||
../../doc/tutorial/index.html \
|
||||
../../doc \
|
||||
asio.css \
|
||||
design_header.htm \
|
||||
design_footer.htm \
|
||||
examples_dox.txt \
|
||||
examples_header.htm \
|
||||
examples_footer.htm \
|
||||
external.doxytags \
|
||||
reference_dox.txt \
|
||||
reference_header.htm \
|
||||
reference_footer.htm \
|
||||
release_checklist.htm \
|
||||
tutorial_header.htm \
|
||||
tutorial_footer.htm \
|
||||
design/buffers_dox.txt \
|
||||
design/closeascancel_dox.txt \
|
||||
design/glossary_dox.txt \
|
||||
design/handlers_dox.txt \
|
||||
design/implementation_dox.txt \
|
||||
design/index_dox.txt \
|
||||
design/proactor.dot \
|
||||
design/proactor_dox.txt \
|
||||
design/services_dox.txt \
|
||||
design/threads_dox.txt \
|
||||
../examples/tutorial/daytime_dox.txt \
|
||||
../examples/tutorial/index_dox.txt \
|
||||
../examples/tutorial/timer_dox.txt
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
../../doc/*.html \
|
||||
../../doc/*.css \
|
||||
../../doc/reference/*.html \
|
||||
../../doc/reference/*.gif \
|
||||
../../doc/reference/*.png \
|
||||
../../doc/reference/*.css \
|
||||
../../doc/reference/*.dot \
|
||||
../../doc/reference/*.md5 \
|
||||
../../doc/reference/*.map \
|
||||
../../doc/examples/*.html \
|
||||
../../doc/examples/*.gif \
|
||||
../../doc/examples/*.png \
|
||||
../../doc/examples/*.css \
|
||||
../../doc/examples/*.dot \
|
||||
../../doc/examples/*.md5 \
|
||||
../../doc/examples/*.map \
|
||||
../../doc/tutorial/*.html \
|
||||
../../doc/tutorial/*.gif \
|
||||
../../doc/tutorial/*.png \
|
||||
../../doc/tutorial/*.css \
|
||||
../../doc/tutorial/*.dot \
|
||||
../../doc/tutorial/*.md5 \
|
||||
../../doc/tutorial/*.map \
|
||||
Makefile.in
|
||||
|
||||
endif
|
@ -1,376 +0,0 @@
|
||||
BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
}
|
||||
BODY,TD {
|
||||
font-size: 90%;
|
||||
}
|
||||
H1 {
|
||||
text-align: center;
|
||||
font-size: 160%;
|
||||
}
|
||||
H2 {
|
||||
font-size: 120%;
|
||||
}
|
||||
H3 {
|
||||
font-size: 100%;
|
||||
}
|
||||
CAPTION { font-weight: bold }
|
||||
DIV.sidebar {
|
||||
width: 210px;
|
||||
background-color: #e8eef2;
|
||||
border: 1px solid #84b0c7;
|
||||
text-align: center;
|
||||
margin: 2px;
|
||||
margin-bottom: 20px;
|
||||
padding: 2px;
|
||||
line-height: 140%;
|
||||
}
|
||||
DIV.sidebar TABLE TR TD {
|
||||
font-size: 80%;
|
||||
}
|
||||
DIV.sidebar UL {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
DIV.qindex {
|
||||
width: 100%;
|
||||
background-color: #e8eef2;
|
||||
border: 1px solid #84b0c7;
|
||||
text-align: center;
|
||||
margin: 2px;
|
||||
padding: 2px;
|
||||
line-height: 140%;
|
||||
}
|
||||
DIV.nav {
|
||||
width: 100%;
|
||||
background-color: #e8eef2;
|
||||
border: 1px solid #84b0c7;
|
||||
text-align: center;
|
||||
margin: 2px;
|
||||
padding: 2px;
|
||||
line-height: 140%;
|
||||
}
|
||||
DIV.navtab {
|
||||
background-color: #e8eef2;
|
||||
border: 1px solid #84b0c7;
|
||||
text-align: center;
|
||||
margin: 2px;
|
||||
margin-right: 15px;
|
||||
padding: 2px;
|
||||
}
|
||||
TD.navtab {
|
||||
font-size: 70%;
|
||||
}
|
||||
A.qindex {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
color: #1A419D;
|
||||
}
|
||||
A.qindex:visited {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
color: #1A419D
|
||||
}
|
||||
A.qindex:hover {
|
||||
text-decoration: none;
|
||||
background-color: #ddddff;
|
||||
}
|
||||
A.qindexHL {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
background-color: #6666cc;
|
||||
color: #ffffff;
|
||||
border: 1px double #9295C2;
|
||||
}
|
||||
A.qindexHL:hover {
|
||||
text-decoration: none;
|
||||
background-color: #6666cc;
|
||||
color: #ffffff;
|
||||
}
|
||||
A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
|
||||
A.el { text-decoration: none; font-weight: bold }
|
||||
A.elRef { text-decoration: none; font-weight: bold }
|
||||
A.code:link { text-decoration: none; font-weight: normal; color: #0000FF}
|
||||
A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF}
|
||||
A.codeRef:link { text-decoration: none; font-weight: normal; color: #0000FF}
|
||||
A.codeRef:visited { text-decoration: none; font-weight: normal; color: #0000FF}
|
||||
A:hover { text-decoration: none; background-color: #f2f2ff }
|
||||
DL.el { margin-left: -1cm }
|
||||
.fragment {
|
||||
font-family: monospace, fixed;
|
||||
font-size: 95%;
|
||||
}
|
||||
PRE.fragment {
|
||||
border: 1px solid #CCCCCC;
|
||||
background-color: #f5f5f5;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
margin-left: 2px;
|
||||
margin-right: 8px;
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
|
||||
|
||||
DIV.groupHeader {
|
||||
margin-left: 16px;
|
||||
margin-top: 12px;
|
||||
margin-bottom: 6px;
|
||||
font-weight: bold;
|
||||
}
|
||||
DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% }
|
||||
BODY {
|
||||
background: white;
|
||||
color: black;
|
||||
margin-right: 20px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
TD.indexkey {
|
||||
background-color: #e8eef2;
|
||||
font-weight: bold;
|
||||
padding-right : 10px;
|
||||
padding-top : 2px;
|
||||
padding-left : 10px;
|
||||
padding-bottom : 2px;
|
||||
margin-left : 0px;
|
||||
margin-right : 0px;
|
||||
margin-top : 2px;
|
||||
margin-bottom : 2px;
|
||||
border: 1px solid #CCCCCC;
|
||||
}
|
||||
TD.indexvalue {
|
||||
background-color: #e8eef2;
|
||||
font-style: italic;
|
||||
padding-right : 10px;
|
||||
padding-top : 2px;
|
||||
padding-left : 10px;
|
||||
padding-bottom : 2px;
|
||||
margin-left : 0px;
|
||||
margin-right : 0px;
|
||||
margin-top : 2px;
|
||||
margin-bottom : 2px;
|
||||
border: 1px solid #CCCCCC;
|
||||
}
|
||||
TR.memlist {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
P.formulaDsp { text-align: center; }
|
||||
IMG.formulaDsp { }
|
||||
IMG.formulaInl { vertical-align: middle; }
|
||||
SPAN.keyword { color: #008000 }
|
||||
SPAN.keywordtype { color: #604020 }
|
||||
SPAN.keywordflow { color: #e08000 }
|
||||
SPAN.comment { color: #800000 }
|
||||
SPAN.preprocessor { color: #806020 }
|
||||
SPAN.stringliteral { color: #002080 }
|
||||
SPAN.charliteral { color: #008080 }
|
||||
.mdescLeft {
|
||||
padding: 0px 8px 4px 8px;
|
||||
font-size: 80%;
|
||||
font-style: italic;
|
||||
background-color: #FAFAFA;
|
||||
border-top: 1px none #E0E0E0;
|
||||
border-right: 1px none #E0E0E0;
|
||||
border-bottom: 1px none #E0E0E0;
|
||||
border-left: 1px none #E0E0E0;
|
||||
margin: 0px;
|
||||
}
|
||||
.mdescRight {
|
||||
padding: 0px 8px 4px 8px;
|
||||
font-size: 80%;
|
||||
font-style: italic;
|
||||
background-color: #FAFAFA;
|
||||
border-top: 1px none #E0E0E0;
|
||||
border-right: 1px none #E0E0E0;
|
||||
border-bottom: 1px none #E0E0E0;
|
||||
border-left: 1px none #E0E0E0;
|
||||
margin: 0px;
|
||||
}
|
||||
.memItemLeft {
|
||||
padding: 1px 0px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-top-style: solid;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-size: 80%;
|
||||
}
|
||||
.memItemRight {
|
||||
padding: 1px 8px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-top-style: solid;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-size: 80%;
|
||||
}
|
||||
.memTemplItemLeft {
|
||||
padding: 1px 0px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-top-style: none;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-size: 80%;
|
||||
}
|
||||
.memTemplItemRight {
|
||||
padding: 1px 8px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-top-style: none;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-size: 80%;
|
||||
}
|
||||
.memTemplParams {
|
||||
padding: 1px 0px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-top-style: solid;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
color: #606060;
|
||||
background-color: #FAFAFA;
|
||||
font-size: 80%;
|
||||
}
|
||||
.search { color: #003399;
|
||||
font-weight: bold;
|
||||
}
|
||||
FORM.search {
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
INPUT.search { font-size: 75%;
|
||||
color: #000080;
|
||||
font-weight: normal;
|
||||
background-color: #e8eef2;
|
||||
}
|
||||
TD.tiny { font-size: 75%;
|
||||
}
|
||||
a {
|
||||
color: #1A41A8;
|
||||
}
|
||||
a:visited {
|
||||
color: #2A3798;
|
||||
}
|
||||
a.anchor { text-decoration: none; color: black; }
|
||||
a.anchor:hover { text-decoration: none; background-color: white; }
|
||||
.dirtab { padding: 4px;
|
||||
border-collapse: collapse;
|
||||
border: 1px solid #84b0c7;
|
||||
}
|
||||
TH.dirtab { background: #e8eef2;
|
||||
font-weight: bold;
|
||||
}
|
||||
HR { height: 1px;
|
||||
border: none;
|
||||
border-top: 1px solid black;
|
||||
}
|
||||
|
||||
/* Style for detailed member documentation */
|
||||
.memtemplate {
|
||||
font-size: 80%;
|
||||
color: #606060;
|
||||
font-weight: normal;
|
||||
}
|
||||
.memnav {
|
||||
background-color: #e8eef2;
|
||||
border: 1px solid #84b0c7;
|
||||
text-align: center;
|
||||
margin: 2px;
|
||||
margin-right: 15px;
|
||||
padding: 2px;
|
||||
}
|
||||
.memitem {
|
||||
padding: 4px;
|
||||
background-color: #eef3f5;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #dedeee;
|
||||
-moz-border-radius: 8px 8px 8px 8px;
|
||||
}
|
||||
.memname {
|
||||
white-space: nowrap;
|
||||
font-weight: bold;
|
||||
}
|
||||
.memdoc{
|
||||
padding-left: 10px;
|
||||
}
|
||||
.memproto {
|
||||
background-color: #d5e1e8;
|
||||
width: 100%;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #84b0c7;
|
||||
font-weight: bold;
|
||||
-moz-border-radius: 8px 8px 8px 8px;
|
||||
}
|
||||
.paramkey {
|
||||
text-align: right;
|
||||
}
|
||||
.paramtype {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.paramname {
|
||||
color: #602020;
|
||||
font-style: italic;
|
||||
}
|
||||
/* End Styling for detailed member documentation */
|
||||
|
||||
/* for the tree view */
|
||||
.ftvtree {
|
||||
font-family: sans-serif;
|
||||
margin:0.5em;
|
||||
}
|
||||
.directory { font-size: 9pt; font-weight: bold; }
|
||||
.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; }
|
||||
.directory > h3 { margin-top: 0; }
|
||||
.directory p { margin: 0px; white-space: nowrap; }
|
||||
.directory div { display: none; margin: 0px; }
|
||||
.directory img { vertical-align: -30%; }
|
BIN
asio/src/doc/asio.png
Normal file
BIN
asio/src/doc/asio.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
92
asio/src/doc/asio.qbk
Normal file
92
asio/src/doc/asio.qbk
Normal file
@ -0,0 +1,92 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[library Asio
|
||||
[quickbook 1.4]
|
||||
[copyright 2003 - 2007 Christopher M. Kohlhoff]
|
||||
[purpose Networking library]
|
||||
[license
|
||||
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])
|
||||
]
|
||||
[category template]
|
||||
[category generic]
|
||||
[last-revision $Date: 2007-10-22 23:00:36 $]
|
||||
]
|
||||
|
||||
[template mdash[] '''— ''']
|
||||
[def __POSIX__ /POSIX/]
|
||||
[def __Windows__ /Windows/]
|
||||
[def __accept__ [@http://www.opengroup.org/onlinepubs/000095399/functions/accept.html `accept()`]]
|
||||
[def __connect__ [@http://www.opengroup.org/onlinepubs/000095399/functions/connect.html `connect()`]]
|
||||
[def __getpeername__ [@http://www.opengroup.org/onlinepubs/000095399/functions/getpeername.html `getpeername()`]]
|
||||
[def __getsockname__ [@http://www.opengroup.org/onlinepubs/000095399/functions/getsockname.html `getsockname()`]]
|
||||
[def __getsockopt__ [@http://www.opengroup.org/onlinepubs/000095399/functions/getsockopt.html `getsockopt()`]]
|
||||
[def __ioctl__ [@http://www.opengroup.org/onlinepubs/000095399/functions/ioctl.html `ioctl()`]]
|
||||
[def __recvfrom__ [@http://www.opengroup.org/onlinepubs/000095399/functions/recvfrom.html `recvfrom()`]]
|
||||
[def __sendto__ [@http://www.opengroup.org/onlinepubs/000095399/functions/sendto.html `sendto()`]]
|
||||
[def __setsockopt__ [@http://www.opengroup.org/onlinepubs/000095399/functions/setsockopt.html `setsockopt()`]]
|
||||
[def __socket__ [@http://www.opengroup.org/onlinepubs/000095399/functions/socket.html `socket()`]]
|
||||
|
||||
[/=============================================================================]
|
||||
|
||||
Asio is a cross-platform C++ library for network programming that provides
|
||||
developers with a consistent asynchronous I/O model using a modern C++
|
||||
approach.
|
||||
|
||||
[variablelist
|
||||
[
|
||||
[
|
||||
[link asio.using Using Asio]
|
||||
]
|
||||
[
|
||||
How to use Asio in your applications. Includes information on
|
||||
library dependencies and supported platforms.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.tutorial Tutorial]
|
||||
]
|
||||
[
|
||||
A tutorial that introduces the fundamental concepts required to use
|
||||
Asio, and shows how to use Asio to develop simple client and
|
||||
server programs.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.examples Examples]
|
||||
]
|
||||
[
|
||||
Examples that illustrate the use of Asio in more complex applications.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.reference Reference]
|
||||
]
|
||||
[
|
||||
Detailed class and function reference.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.design Design]
|
||||
]
|
||||
[
|
||||
Rationale and design information for Asio.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[include using.qbk]
|
||||
[include tutorial.qbk]
|
||||
[include examples.qbk]
|
||||
[include reference.qbk]
|
||||
[include design.qbk]
|
5
asio/src/doc/boost_bind_dox.txt
Normal file
5
asio/src/doc/boost_bind_dox.txt
Normal file
@ -0,0 +1,5 @@
|
||||
/**
|
||||
\page boost_bind boost::bind
|
||||
See the <a href="http://www.boost.org/libs/bind/bind.html">Boost: bind.hpp
|
||||
documentation</a> for more information on how to use <tt>boost::bind</tt>.
|
||||
*/
|
@ -1,193 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>asio C++ library: Building the Tests and Examples</title>
|
||||
<link href="asio.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<div class="qindex">
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<b>asio @VERSION@</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
<a class="qindex" href="index.html">Home</a> |
|
||||
<a class="qindex" href="reference/index.html">Reference</a> |
|
||||
<a class="qindex" href="tutorial/index.html">Tutorial</a> |
|
||||
<a class="qindex" href="examples/index.html">Examples</a> |
|
||||
<a class="qindex" href="design/index.html">Design</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h1>Building the Tests and Examples</h1>
|
||||
|
||||
<h2>Building on Linux or UNIX</h2>
|
||||
|
||||
<p>
|
||||
If the boost directory (e.g. the directory called <tt>boost_1_33_0</tt>)
|
||||
is in the same directory as the asio source kit, then you may configure
|
||||
asio by simply going:
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<tt>./configure</tt>
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
in the root directory of the asio source kit. Note that configure will
|
||||
always use the most recent boost version it knows about (i.e. 1.33.0) in
|
||||
preference to earlier versions, if there is more than one version
|
||||
present.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If the boost directory is in some other location, then you need to
|
||||
specify this directory when running configure:
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<tt>./configure --with-boost=<BOOSTDIR></tt>
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
When specifying the boost directory in this way you should ensure that
|
||||
you use an absolute path.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To build, simply run <tt>make</tt> in the root directory of the asio
|
||||
source kit. To test that asio is working correctly, run <tt>make
|
||||
check</tt> after a successful build.
|
||||
</p>
|
||||
|
||||
<h2>Building on Win32</h2>
|
||||
|
||||
<h3>Building with MSVC</h3>
|
||||
|
||||
<p>
|
||||
To build using the MSVC 7.1 or MSVC 8.0 command line compiler, perform the
|
||||
following steps in a Command Prompt window:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
If you are using a version of boost other than 1.33.0, or if the boost
|
||||
directory (i.e. the directory called <tt>boost_1_33_0</tt>) is not in
|
||||
the same directory as the asio source kit, then specify the location of
|
||||
boost by running a command similar to <tt>set
|
||||
BOOSTDIR=<i>path_to_boost</i></tt>. Ensure that you specify an absolute
|
||||
path.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Change to the asio <tt>src</tt> directory.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Execute the command <tt>nmake -f Makefile.msc</tt>.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Execute the command <tt>nmake -f Makefile.msc check</tt> to run a suite
|
||||
of tests to confirm that asio is working correctly.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3>Building with Borland C++</h3>
|
||||
|
||||
<p>
|
||||
To build using the Borland C++ Builder 6 command line compiler, perform
|
||||
the following steps in a Command Prompt window:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
If you are using a version of boost other than 1.33.0, or if the boost
|
||||
directory (i.e. the directory called <tt>boost_1_33_0</tt>) is not in
|
||||
the same directory as the asio source kit, then specify the location of
|
||||
boost by running a command similar to <tt>set
|
||||
BOOSTDIR=<i>path_to_boost</i></tt>. Ensure that you specify an absolute
|
||||
path.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Change to the asio <tt>src</tt> directory.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Execute the command <tt>make -f Makefile.bor</tt>.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Execute the command <tt>make -f Makefile.bor check</tt> to run a suite
|
||||
of tests to confirm that asio is working correctly.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3>Building with MinGW</h3>
|
||||
|
||||
<p>
|
||||
To build using the MinGW g++ compiler from the command line, perform the
|
||||
following steps in a Command Prompt window:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
If you are using a version of boost other than 1.33.0, or if the boost
|
||||
directory (i.e. the directory called <tt>boost_1_33_0</tt>) is not in
|
||||
the same directory as the asio source kit, then specify the location of
|
||||
boost by running a command similar to <tt>set
|
||||
BOOSTDIR=<i>path_to_boost</i></tt>. Ensure that you specify an absolute
|
||||
path using <i>forward slashes</i> (i.e.
|
||||
<tt>c:/projects/boost_1_33_0</tt> rather than
|
||||
<tt>c:\projects\boost_1_33_0</tt>).
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Change to the asio <tt>src</tt> directory.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Execute the command <tt>make -f Makefile.mgw</tt>.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Execute the command <tt>make -f Makefile.mgw check</tt> to run a suite
|
||||
of tests to confirm that asio is working correctly.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Note: the above instructions do not work when building inside MSYS. If
|
||||
you want to build using MSYS, you should use <tt>export</tt> rather than
|
||||
<tt>set</tt> to specify the location of boost.
|
||||
</p>
|
||||
|
||||
<div class="qindex">
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<b>asio @VERSION@</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
<a class="qindex" href="index.html">Home</a> |
|
||||
<a class="qindex" href="reference/index.html">Reference</a> |
|
||||
<a class="qindex" href="tutorial/index.html">Tutorial</a> |
|
||||
<a class="qindex" href="examples/index.html">Examples</a> |
|
||||
<a class="qindex" href="design/index.html">Design</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
104
asio/src/doc/design.qbk
Normal file
104
asio/src/doc/design.qbk
Normal file
@ -0,0 +1,104 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:design Design Notes]
|
||||
|
||||
[variablelist
|
||||
[
|
||||
[
|
||||
[link asio.design.rationale Rationale]
|
||||
]
|
||||
[
|
||||
Design rationale for the Asio library.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.design.async Asynchronous operations]
|
||||
]
|
||||
[
|
||||
Support for asynchronous operations in the Asio library is based on
|
||||
the Proactor pattern. This design note outlines the advantages and
|
||||
disadvantages of this approach.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.design.allocation Custom memory allocation]
|
||||
]
|
||||
[
|
||||
Describes the custom memory allocation support in Asio.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.design.buffers Buffers]
|
||||
]
|
||||
[
|
||||
Examines the buffer abstraction used by asio in order to support
|
||||
scatter-gather operations.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.design.eof Why EOF is an error]
|
||||
]
|
||||
[
|
||||
Discusses why the end-of-file condition should be an error code.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.design.line_based Line-based protocols]
|
||||
]
|
||||
[
|
||||
Outlines Asio's support for line-based protocols.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.design.threads Threads]
|
||||
]
|
||||
[
|
||||
An implementation of Asio for a particular platform may make use of
|
||||
one or more additional threads to emulate asynchronicity. This design
|
||||
note discusses design rules applied to the use of threads in this way.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.design.strands Strands]
|
||||
]
|
||||
[
|
||||
Describes the "strand" abstraction provided by Asio to ease
|
||||
concurrent programming and provide scalability across multiple
|
||||
processors.
|
||||
]
|
||||
]
|
||||
[
|
||||
[
|
||||
[link asio.design.implementation Platform-specific implementation]
|
||||
]
|
||||
[
|
||||
This design note lists platform-specific implementation details, such as
|
||||
the default demultiplexing mechanism, the number of threads created
|
||||
internally, and when threads are created.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[include design/rationale.qbk]
|
||||
[include design/async.qbk]
|
||||
[include design/allocation.qbk]
|
||||
[include design/buffers.qbk]
|
||||
[include design/eof.qbk]
|
||||
[include design/line_based.qbk]
|
||||
[include design/threads.qbk]
|
||||
[include design/strands.qbk]
|
||||
[include design/implementation.qbk]
|
||||
|
||||
[endsect]
|
51
asio/src/doc/design/allocation.qbk
Normal file
51
asio/src/doc/design/allocation.qbk
Normal file
@ -0,0 +1,51 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:allocation Custom Memory Allocation]
|
||||
|
||||
Many asynchronous operations need to allocate an object to store state
|
||||
associated with the operation. For example, a Win32 implementation needs
|
||||
`OVERLAPPED`-derived objects to pass to Win32 API functions.
|
||||
|
||||
Furthermore, programs typically contain easily identifiable chains of
|
||||
asynchronous operations. A half duplex protocol implementation (e.g. an HTTP
|
||||
server) would have a single chain of operations per client (receives followed
|
||||
by sends). A full duplex protocol implementation would have two chains
|
||||
executing in parallel. Programs should be able to leverage this knowledge to
|
||||
reuse memory for all asynchronous operations in a chain.
|
||||
|
||||
Given a copy of a user-defined `Handler` object `h`, if the implementation
|
||||
needs to allocate memory associated with that handler it will execute the code:
|
||||
|
||||
void* pointer = asio_handler_allocate(size, &h);
|
||||
|
||||
Similarly, to deallocate the memory it will execute:
|
||||
|
||||
asio_handler_deallocate(pointer, size, &h);
|
||||
|
||||
These functions are located using argument-dependent lookup. The implementation
|
||||
provides default implementations of the above functions in the `asio` namespace:
|
||||
|
||||
void* asio_handler_allocate(size_t, ...);
|
||||
void asio_handler_deallocate(void*, size_t, ...);
|
||||
|
||||
which are implemented in terms of `::operator new()` and `::operator delete()`
|
||||
respectively.
|
||||
|
||||
The implementation guarantees that the deallocation will occur before the
|
||||
associated handler is invoked, which means the memory is ready to be reused for
|
||||
any new asynchronous operations started by the handler.
|
||||
|
||||
The custom memory allocation functions may be called from any user-created
|
||||
thread that is calling a library function. The implementation guarantees that,
|
||||
for the asynchronous operations included the library, the implementation will
|
||||
not make concurrent calls to the memory allocation functions for that handler.
|
||||
The implementation will insert appropriate memory barriers to ensure correct
|
||||
memory visibility should allocation functions need to be called from different
|
||||
threads.
|
||||
|
||||
[endsect]
|
185
asio/src/doc/design/async.qbk
Normal file
185
asio/src/doc/design/async.qbk
Normal file
@ -0,0 +1,185 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:async Asynchronous Operations]
|
||||
|
||||
The proposed library offers side-by-side support for synchronous and
|
||||
asynchronous operations. The asynchronous support is based on the Proactor
|
||||
design pattern [link asio.design.async.references \[POSA2\]], and the
|
||||
advantages and disadvantages of this approach, when compared to a
|
||||
synchronous-only or Reactor approach, are outlined below.
|
||||
|
||||
[heading Proactor and Asio]
|
||||
|
||||
Let us examine how the Proactor design pattern is implemented in Asio,
|
||||
without reference to platform-specific details.
|
||||
|
||||
[$proactor.png]
|
||||
|
||||
[*Proactor design pattern (adapted from \[POSA2\])]
|
||||
|
||||
[mdash] Asynchronous Operation
|
||||
|
||||
[:Defines an operation that is executed asynchronously, such as an asynchronous
|
||||
read or write on a socket.]
|
||||
|
||||
[mdash] Asynchronous Operation Processor
|
||||
|
||||
[:Executes asynchronous operations and queues events on a completion event
|
||||
queue when operations complete. From a high-level point of view, services like
|
||||
asio::stream_socket_service are asynchronous operation processors.]
|
||||
|
||||
[mdash] Completion Event Queue
|
||||
|
||||
[:Buffers completion events until they are dequeued by an asynchronous event
|
||||
demultiplexer.]
|
||||
|
||||
[mdash] Completion Handler
|
||||
|
||||
[:Processes the result of an asynchronous operation. These are function
|
||||
objects, often created using `boost::bind`.]
|
||||
|
||||
[mdash] Asynchronous Event Demultiplexer
|
||||
|
||||
[:Blocks waiting for events to occur on the completion event queue, and returns
|
||||
a completed event to its caller.]
|
||||
|
||||
[mdash] Proactor
|
||||
|
||||
[:Calls the asynchronous event demultiplexer to dequeue events, and dispatches
|
||||
the completion handler (i.e. invokes the function object) associated with the
|
||||
event. This abstraction is represented by `asio::io_service`.]
|
||||
|
||||
[mdash] Initiator
|
||||
|
||||
[:Application-specific code that starts asynchronous operations. The initiator
|
||||
interacts with an asynchronous operation processor via a high-level interface
|
||||
such as `asio::basic_stream_socket`, which in turn delegates to a service like
|
||||
`asio::stream_socket_service`.]
|
||||
|
||||
[heading Implementation Using Reactor]
|
||||
|
||||
On many platforms, Asio implements the Proactor design pattern in terms
|
||||
of a Reactor, such as `select`, `epoll` or `kqueue`. This implementation
|
||||
approach corresponds to the Proactor design pattern as follows:
|
||||
|
||||
[mdash] Asynchronous Operation Processor
|
||||
|
||||
[:A reactor implemented using `select`, `epoll` or `kqueue`. When the reactor
|
||||
indicates that the resource is ready to perform the operation, the processor
|
||||
executes the asynchronous operation and enqueues the associated completion
|
||||
handler on the completion event queue.]
|
||||
|
||||
[mdash] Completion Event Queue
|
||||
|
||||
[:A linked list of completion handlers (i.e. function objects).]
|
||||
|
||||
[mdash] Asynchronous Event Demultiplexer
|
||||
|
||||
[:This is implemented by waiting on an event or condition variable until a
|
||||
completion handler is available in the completion event queue.]
|
||||
|
||||
[heading Implementation Using Windows Overlapped I/O]
|
||||
|
||||
On Windows NT, 2000 and XP, Asio takes advantage of overlapped I/O to
|
||||
provide an efficient implementation of the Proactor design pattern. This
|
||||
implementation approach corresponds to the Proactor design pattern as follows:
|
||||
|
||||
[mdash] Asynchronous Operation Processor
|
||||
|
||||
[:This is implemented by the operating system. Operations are initiated by
|
||||
calling an overlapped function such as `AcceptEx`.]
|
||||
|
||||
[mdash] Completion Event Queue
|
||||
|
||||
[:This is implemented by the operating system, and is associated with an I/O
|
||||
completion port. There is one I/O completion port for each asio::io_service
|
||||
instance.]
|
||||
|
||||
[mdash] Asynchronous Event Demultiplexer
|
||||
|
||||
[:Called by Asio to dequeue events and their associated completion
|
||||
handlers.]
|
||||
|
||||
[heading Advantages]
|
||||
|
||||
[mdash] Portability.
|
||||
|
||||
[:Many operating systems offer a native asynchronous I/O API (such as
|
||||
overlapped I/O on __Windows__) as the preferred option for developing high
|
||||
performance network applications. The proposed library may be implemented in
|
||||
terms of native asynchronous I/O. However, if native support is not available,
|
||||
the library may also be implemented using synchronous event demultiplexors that
|
||||
typify the Reactor pattern, such as __POSIX__ `select()`.]
|
||||
|
||||
[mdash] Decoupling threading from concurrency.
|
||||
|
||||
[:Long-duration operations are performed asynchronously by the implementation
|
||||
on behalf of the application. Consequently applications do not need to spawn
|
||||
many threads in order to increase concurrency.]
|
||||
|
||||
[mdash] Performance and scalability.
|
||||
|
||||
[:Implementation strategies such as thread-per-connection (which a
|
||||
synchronous-only approach would require) can degrade system performance, due to
|
||||
increased context switching, synchronisation and data movement among CPUs. With
|
||||
asynchronous operations it is possible to avoid the cost of context switching
|
||||
by minimising the number of operating system threads [mdash] typically a
|
||||
limited resource [mdash] and only activating the logical threads of control
|
||||
that have events to process.]
|
||||
|
||||
[mdash] Simplified application synchronisation.
|
||||
|
||||
[:Asynchronous operation completion handlers can be written as though they
|
||||
exist in a single-threaded environment, and so application logic can be
|
||||
developed with little or no concern for synchronisation issues.]
|
||||
|
||||
[mdash] Function composition.
|
||||
|
||||
[:Function composition refers to the implementation of functions to provide a
|
||||
higher-level operation, such as sending a message in a particular format. Each
|
||||
function is implemented in terms of multiple calls to lower-level read or write
|
||||
operations.]
|
||||
|
||||
[:For example, consider a protocol where each message consists of a
|
||||
fixed-length header followed by a variable length body, where the length of the
|
||||
body is specified in the header. A hypothetical read_message operation could be
|
||||
implemented using two lower-level reads, the first to receive the header and,
|
||||
once the length is known, the second to receive the body.]
|
||||
|
||||
[:To compose functions in an asynchronous model, asynchronous operations can be
|
||||
chained together. That is, a completion handler for one operation can initiate
|
||||
the next. Starting the first call in the chain can be encapsulated so that the
|
||||
caller need not be aware that the higher-level operation is implemented as a
|
||||
chain of asynchronous operations.]
|
||||
|
||||
[:The ability to compose new operations in this way simplifies the development
|
||||
of higher levels of abstraction above a networking library, such as functions
|
||||
to support a specific protocol.]
|
||||
|
||||
[heading Disadvantages]
|
||||
|
||||
[mdash] Program complexity.
|
||||
|
||||
[:It is more difficult to develop applications using asynchronous mechanisms
|
||||
due to the separation in time and space between operation initiation and
|
||||
completion. Applications may also be harder to debug due to the inverted flow
|
||||
of control.]
|
||||
|
||||
[mdash] Memory usage.
|
||||
|
||||
[:Buffer space must be committed for the duration of a read or write operation,
|
||||
which may continue indefinitely, and a separate buffer is required for each
|
||||
concurrent operation. The Reactor pattern, on the other hand, does not require
|
||||
buffer space until a socket is ready for reading or writing.]
|
||||
|
||||
[heading References]
|
||||
|
||||
\[POSA2\] D. Schmidt et al, ['Pattern Oriented Software Architecture, Volume
|
||||
2]. Wiley, 2000.
|
||||
|
||||
[endsect]
|
58
asio/src/doc/design/buffers.qbk
Normal file
58
asio/src/doc/design/buffers.qbk
Normal file
@ -0,0 +1,58 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:buffers Buffers]
|
||||
|
||||
To allow the development of efficient network applications, Asio includes
|
||||
support for scatter-gather operations. These operations involve one or more
|
||||
buffers (where each buffer is a contiguous region of memory):
|
||||
|
||||
* A scatter-read receives data into multiple buffers.
|
||||
* A gather-write transmits multiple buffers.
|
||||
|
||||
Therefore we require an abstraction to represent a collection of buffers. The
|
||||
approach used in Asio is to define a type (actually two types) to
|
||||
represent a single buffer. These can be stored in a container, which may be
|
||||
passed to the scatter-gather operations.
|
||||
|
||||
A buffer, as a contiguous region of memory, can be represented by an address
|
||||
and size in bytes. There is a distinction between modifiable memory (called
|
||||
mutable in Asio) and non-modifiable memory (where the latter is
|
||||
created from the storage for a const-qualified variable). These two types could
|
||||
therefore be defined as follows:
|
||||
|
||||
typedef std::pair<void*, std::size_t> mutable_buffer;
|
||||
typedef std::pair<const void*, std::size_t> const_buffer;
|
||||
|
||||
Here, a mutable_buffer would be convertible to a const_buffer, but conversion
|
||||
in the opposite direction is not valid.
|
||||
|
||||
However, Asio does not use the above definitions, but instead defines two
|
||||
classes: `mutable_buffer` and `const_buffer`. The goal of these is to provide
|
||||
an opaque representation of contiguous memory, where:
|
||||
|
||||
* Types behave as std::pair would in conversions. That is, a `mutable_buffer` is
|
||||
convertible to a `const_buffer`, but the opposite conversion is disallowed.
|
||||
|
||||
* There is protection against buffer overruns. Given a buffer instance, a user
|
||||
can only create another buffer representing the same range of memory or a
|
||||
sub-range of it. To provide further safety, the library also includes
|
||||
mechanisms for automatically determining the size of a buffer from an array,
|
||||
`boost::array` or `std::vector` of POD elements, or from a `std::string`.
|
||||
|
||||
* Type safety violations must be explicitly requested using the `buffer_cast`
|
||||
function. In general an application should never need to do this, but it is
|
||||
required by the library implementation to pass the raw memory to the
|
||||
underlying operating system functions.
|
||||
|
||||
Finally, multiple buffers can be passed to scatter-gather operations (such as
|
||||
`asio::read` or `asio::write`) by putting the buffer objects
|
||||
into a container. The `MutableBufferSequence` and `ConstBufferSequence`
|
||||
concepts have been defined so that containers such as `std::vector`,
|
||||
`std::list`, `std::vector` or `boost::array` can be used.
|
||||
|
||||
[endsect]
|
@ -1,52 +0,0 @@
|
||||
/**
|
||||
\page designbuffers Buffers
|
||||
|
||||
To allow the development of efficient network applications, the asio library
|
||||
provides support for scatter-gather operations. These operations involve one or
|
||||
more buffers (where each buffer is a contiguous region of memory):
|
||||
|
||||
\li A <b>scatter-read</b> receives data into multiple buffers.
|
||||
\li A <b>gather-write</b> transmits multiple buffers.
|
||||
|
||||
Therefore we require an abstraction to represent a collection of buffers. The
|
||||
approach asio uses is to define a type (actually two types) to represent a
|
||||
single buffer. These can be stored in a container, which may be passed to the
|
||||
scatter-gather operations.
|
||||
|
||||
A buffer, as a contiguous region of memory, can be represented by an address
|
||||
and size in bytes. There is a distinction between modifiable memory (called
|
||||
mutable in asio) and non-modifiable memory (where the latter is created from
|
||||
the storage for a const-qualified variable). These two types could therefore be
|
||||
defined as follows:
|
||||
|
||||
\code
|
||||
typedef std::pair<void*, std::size_t> mutable_buffer;
|
||||
typedef std::pair<const void*, std::size_t> const_buffer;
|
||||
\endcode
|
||||
|
||||
Here, a mutable_buffer would be convertible to a const_buffer, but conversion
|
||||
in the opposite direction is not valid.
|
||||
|
||||
However, the asio library does not use the above definitions, but instead
|
||||
defines two classes: asio::mutable_buffer and asio::const_buffer. The goal of
|
||||
these is to provide an opaque representation of contiguous memory, where:
|
||||
|
||||
\li Types behave as std::pair would in conversions. That is, a mutable_buffer is
|
||||
convertible to a const_buffer, but the opposite conversion is disallowed.
|
||||
\li There is protection against buffer overruns. Given a buffer instance, a
|
||||
user can only create another buffer representing the same range of memory or a
|
||||
sub-range of it. To provide further safety, the library also includes
|
||||
mechanisms for automatically determining the size of a buffer from an array,
|
||||
boost::array or std::vector of POD elements.
|
||||
\li Type safety violations must be explicitly requested using the
|
||||
asio::buffer_cast function. In general an application should never need to do
|
||||
this, but it is required by the asio implementation to pass the raw memory to
|
||||
the underlying operating system functions.
|
||||
|
||||
Finally, multiple buffers can be passed to scatter-gather operations (such as
|
||||
\ref read or \ref write) by putting the buffer objects into a container. The
|
||||
Mutable_Buffers and Const_Buffers concepts have been defined so that containers
|
||||
such as std::vector, std::list, std::vector or boost::array can be used. See
|
||||
the documentation for \ref buffer for examples.
|
||||
|
||||
*/
|
@ -1,15 +0,0 @@
|
||||
/**
|
||||
\page designcloseascancel Close as Cancel
|
||||
|
||||
In asio, asynchronous socket operations can be cancelled by closing the socket.
|
||||
There is no separate cancel operation for a socket, nor is there a way to
|
||||
cancel individual operations. This approach was selected as the best balance
|
||||
between utility, portability and efficiency.
|
||||
|
||||
For example, although Win32 provides a CancelIo function which can be used to
|
||||
cancel outstanding operations, this only works if CancelIo is invoked from the
|
||||
thread that initiated the operation. This restriction was considered too
|
||||
onerous for a portable networking library. Closing the socket will cancel the
|
||||
operation from any thread.
|
||||
|
||||
*/
|
17
asio/src/doc/design/eof.qbk
Normal file
17
asio/src/doc/design/eof.qbk
Normal file
@ -0,0 +1,17 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:eof Why EOF is an error]
|
||||
|
||||
* The end of a stream can cause `read`, `async_read`, `read_until` or
|
||||
`async_read_until` functions to violate their contract. E.g.
|
||||
a read of N bytes may finish early due to EOF.
|
||||
|
||||
* An EOF error may be used to distinguish the end of a stream from a successful
|
||||
read of size 0.
|
||||
|
||||
[endsect]
|
@ -1,29 +0,0 @@
|
||||
/**
|
||||
\page designglossary Glossary
|
||||
|
||||
@section designglossary_io_service IO_Service
|
||||
Contains the asio library's implementation of the Proactor design pattern. Acts
|
||||
as a registry of available services, and as a thread pool for dispatching
|
||||
handlers associated with completed asynchronous operations.
|
||||
|
||||
@section designglossary_handler Handler
|
||||
A function object, typically one invoked when an asynchronous operations
|
||||
completes. Referred to as "Completion Handler" in the Proactor design pattern.
|
||||
|
||||
@section designglossary_proactor Proactor
|
||||
A design pattern for asynchronous event demultiplexing. A Proactor executes long
|
||||
running operations asynchronously, and invokes completion handlers with the
|
||||
result of the operation when they finish.
|
||||
|
||||
@section designglossary_reactor Reactor
|
||||
A design pattern for synchronous event demultiplexing. A Reactor associates
|
||||
event handlers with operating system resources (such as sockets) and notifies
|
||||
the event handlers when the resource is ready to perform an operation (e.g.
|
||||
ready to read or write without blocking). It is the responsibility of an event
|
||||
handler to perform the actual operation.
|
||||
|
||||
@section designglossary_service Service
|
||||
An object, registered with an IO_Service, responsible for implementing
|
||||
asynchronous operations.
|
||||
|
||||
*/
|
@ -1,34 +0,0 @@
|
||||
/**
|
||||
\page designhandlers Handlers
|
||||
|
||||
All asynchronous operations take a function object that will be called when the
|
||||
operation completes. The type of the function object is a template parameter,
|
||||
like so:
|
||||
|
||||
@code
|
||||
template <typename Handler>
|
||||
void async_wait(Handler handler);
|
||||
@endcode
|
||||
|
||||
An alternative approach might have been to make the callback parameter a
|
||||
boost::function object:
|
||||
|
||||
@code
|
||||
void async_wait(boost::function<void(error&)> f);
|
||||
@endcode
|
||||
|
||||
This approach was not used because of the performance penalty incurred by using
|
||||
boost::function objects, as each function object's implementation contains a
|
||||
dynamically allocated object.
|
||||
|
||||
Some asynchronous operations must already allocate an object with a lifetime of
|
||||
the duration of the operation. For example, the Win32 backend creates objects
|
||||
that are derived from the OVERLAPPED structure. These dynamically allocated
|
||||
objects can contain a copy of the handler object, and if a boost::function was
|
||||
used it would entail two memory allocations instead of one.
|
||||
|
||||
The chosen design still allows the user to pass boost::function objects as
|
||||
their callback handler. It also permits a backend implementation that is
|
||||
implemented using boost::function objects, but doesn't require it.
|
||||
|
||||
*/
|
215
asio/src/doc/design/implementation.qbk
Normal file
215
asio/src/doc/design/implementation.qbk
Normal file
@ -0,0 +1,215 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:implementation Platform-Specific Implementation]
|
||||
|
||||
This design note lists platform-specific implementation details, such as the
|
||||
default demultiplexing mechanism, the number of threads created internally, and
|
||||
when threads are created.
|
||||
|
||||
|
||||
[heading Linux Kernel 2.4]
|
||||
|
||||
Demultiplexing mechanism:
|
||||
|
||||
* Uses `select` for demultiplexing. This means that the number of file
|
||||
descriptors in the process cannot be permitted to exceed `FD_SETSIZE`.
|
||||
|
||||
Threads:
|
||||
|
||||
* Demultiplexing using `select` is performed in one of the threads that calls
|
||||
`io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
|
||||
`io_service::poll_one()`.
|
||||
|
||||
* An additional thread per `io_service` is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`.
|
||||
|
||||
|
||||
[heading Linux Kernel 2.6]
|
||||
|
||||
Demultiplexing mechanism:
|
||||
|
||||
* Uses `epoll` for demultiplexing.
|
||||
|
||||
Threads:
|
||||
|
||||
* Demultiplexing using `epoll` is performed in one of the threads that calls
|
||||
`io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
|
||||
`io_service::poll_one()`.
|
||||
|
||||
* An additional thread per `io_service` is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`.
|
||||
|
||||
|
||||
[heading Solaris]
|
||||
|
||||
Demultiplexing mechanism:
|
||||
|
||||
* Uses [^/dev/poll] for demultiplexing.
|
||||
|
||||
Threads:
|
||||
|
||||
* Demultiplexing using [^/dev/poll] is performed in one of the threads that
|
||||
calls `io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
|
||||
`io_service::poll_one()`.
|
||||
|
||||
* An additional thread per `io_service` is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`.
|
||||
|
||||
|
||||
[heading QNX Neutrino]
|
||||
|
||||
Demultiplexing mechanism:
|
||||
|
||||
* Uses `select` for demultiplexing. This means that the number of file
|
||||
descriptors in the process cannot be permitted to exceed `FD_SETSIZE`.
|
||||
|
||||
Threads:
|
||||
|
||||
* Demultiplexing using `select` is performed in one of the threads that calls
|
||||
`io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
|
||||
`io_service::poll_one()`.
|
||||
|
||||
* An additional thread per `io_service` is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`.
|
||||
|
||||
|
||||
[heading Mac OS X]
|
||||
|
||||
Demultiplexing mechanism:
|
||||
|
||||
* Uses `kqueue` for demultiplexing.
|
||||
|
||||
Threads:
|
||||
|
||||
* Demultiplexing using `kqueue` is performed in one of the threads that calls
|
||||
`io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
|
||||
`io_service::poll_one()`.
|
||||
|
||||
* An additional thread per `io_service` is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`.
|
||||
|
||||
|
||||
[heading FreeBSD]
|
||||
|
||||
Demultiplexing mechanism:
|
||||
|
||||
* Uses `kqueue` for demultiplexing.
|
||||
|
||||
Threads:
|
||||
|
||||
* Demultiplexing using `kqueue` is performed in one of the threads that calls
|
||||
`io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
|
||||
`io_service::poll_one()`.
|
||||
|
||||
* An additional thread per `io_service` is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`.
|
||||
|
||||
|
||||
[heading AIX]
|
||||
|
||||
Demultiplexing mechanism:
|
||||
|
||||
* Uses `select` for demultiplexing. This means that the number of file
|
||||
descriptors in the process cannot be permitted to exceed `FD_SETSIZE`.
|
||||
|
||||
Threads:
|
||||
|
||||
* Demultiplexing using `select` is performed in one of the threads that calls
|
||||
`io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
|
||||
`io_service::poll_one()`.
|
||||
|
||||
* An additional thread per `io_service` is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`.
|
||||
|
||||
|
||||
[heading HP-UX]
|
||||
|
||||
Demultiplexing mechanism:
|
||||
|
||||
* Uses `select` for demultiplexing. This means that the number of file
|
||||
descriptors in the process cannot be permitted to exceed `FD_SETSIZE`.
|
||||
|
||||
Threads:
|
||||
|
||||
* Demultiplexing using `select` is performed in one of the threads that calls
|
||||
`io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
|
||||
`io_service::poll_one()`.
|
||||
|
||||
* An additional thread per `io_service` is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`.
|
||||
|
||||
|
||||
[heading Tru64]
|
||||
|
||||
Demultiplexing mechanism:
|
||||
|
||||
* Uses `select` for demultiplexing. This means that the number of file
|
||||
descriptors in the process cannot be permitted to exceed `FD_SETSIZE`.
|
||||
|
||||
Threads:
|
||||
|
||||
* Demultiplexing using `select` is performed in one of the threads that calls
|
||||
`io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
|
||||
`io_service::poll_one()`.
|
||||
|
||||
* An additional thread per `io_service` is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`.
|
||||
|
||||
|
||||
[heading Windows 95, 98 and Me]
|
||||
|
||||
Demultiplexing mechanism:
|
||||
|
||||
* Uses `select` for demultiplexing.
|
||||
|
||||
Threads:
|
||||
|
||||
* Demultiplexing using `select` is performed in one of the threads that calls
|
||||
`io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
|
||||
`io_service::poll_one()`.
|
||||
|
||||
* An additional thread per `io_service` is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`.
|
||||
|
||||
|
||||
[heading Windows NT, 2000, XP, 2003 and Vista]
|
||||
|
||||
Demultiplexing mechanism:
|
||||
|
||||
* Uses overlapped I/O and I/O completion ports for all asynchronous socket
|
||||
operations except for asynchronous connect.
|
||||
|
||||
* Uses `select` for `deadline_timer` operations and for emulating asynchronous
|
||||
connect.
|
||||
|
||||
Threads:
|
||||
|
||||
* Demultiplexing using I/O completion ports is performed in all threads that call
|
||||
`io_service::run()`, `io_service::run_one()`, `io_service::poll()` or
|
||||
`io_service::poll_one()`.
|
||||
|
||||
* An additional thread per `io_service` is used for the `select`
|
||||
demultiplexing. This thread is created whenever the first `deadline_timer` is
|
||||
created, or on the first call to `async_connect()`.
|
||||
|
||||
* An additional thread per `io_service` is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
`ip::tcp::resolver::async_resolve()` or `ip::udp::resolver::async_resolve()`.
|
||||
|
||||
|
||||
[endsect]
|
@ -1,121 +0,0 @@
|
||||
/**
|
||||
\page designimplementation Platform-Specific Implementation
|
||||
|
||||
This design note lists platform-specific implementation details, such as the
|
||||
default demultiplexing mechanism, the number of threads created internally, and
|
||||
when threads are created.
|
||||
|
||||
|
||||
\section linux24 Linux Kernel 2.4
|
||||
|
||||
\subsection linux24demux Demultiplexing Mechanism
|
||||
|
||||
Uses \c select for demultiplexing. This means that the number of file
|
||||
descriptors in the process cannot be permitted to exceed FD_SETSIZE.
|
||||
|
||||
\subsection linux24threads Threads
|
||||
|
||||
Demultiplexing using \c select is performed in one of the threads that calls
|
||||
asio::io_service::run().
|
||||
|
||||
An additional thread per io_service is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
asio::ip::tcp::resolver::async_resolve() or
|
||||
asio::ip::udp::resolver::async_resolve().
|
||||
|
||||
|
||||
\section linux26 Linux Kernel 2.6
|
||||
|
||||
\subsection linux26demux Demultiplexing Mechanism
|
||||
|
||||
Uses \c epoll for demultiplexing.
|
||||
|
||||
\subsection linux26threads Threads
|
||||
|
||||
Demultiplexing using \c epoll is performed in one of the threads that calls
|
||||
asio::io_service::run().
|
||||
|
||||
An additional thread per io_service is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
asio::ip::tcp::resolver::async_resolve() or
|
||||
asio::ip::udp::resolver::async_resolve().
|
||||
|
||||
|
||||
\section solaris Solaris
|
||||
|
||||
\subsection solarisdemux Demultiplexing Mechanism
|
||||
|
||||
Uses \c select for demultiplexing. This means that the number of file
|
||||
descriptors in the process cannot be permitted to exceed FD_SETSIZE.
|
||||
|
||||
\subsection solaristhreads Threads
|
||||
|
||||
Demultiplexing using \c select is performed in one of the threads that calls
|
||||
asio::io_service::run().
|
||||
|
||||
An additional thread per io_service is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
asio::ip::tcp::resolver::async_resolve() or
|
||||
asio::ip::udp::resolver::async_resolve().
|
||||
|
||||
|
||||
\section macosx Mac OS X
|
||||
|
||||
\subsection macosxdemux Demultiplexing Mechanism
|
||||
|
||||
Uses \c kqueue for demultiplexing.
|
||||
|
||||
\subsection macosxthreads Threads
|
||||
|
||||
Demultiplexing using \c kqueue is performed in one of the threads that calls
|
||||
asio::io_service::run().
|
||||
|
||||
An additional thread per io_service is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
asio::ip::tcp::resolver::async_resolve() or
|
||||
asio::ip::udp::resolver::async_resolve().
|
||||
|
||||
|
||||
\section win9x Windows 95, 98 and Me
|
||||
|
||||
\subsection win9xdemux Demultiplexing Mechanism
|
||||
|
||||
Uses \c select for demultiplexing.
|
||||
|
||||
\subsection win9xthreads Threads
|
||||
|
||||
Demultiplexing using \c select is performed in one of the threads that calls
|
||||
asio::io_service::run().
|
||||
|
||||
An additional thread per io_service is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
asio::ip::tcp::resolver::async_resolve() or
|
||||
asio::ip::udp::resolver::async_resolve().
|
||||
|
||||
|
||||
\section winnt Windows NT, 2000 and XP
|
||||
|
||||
\subsection winntdemux Demultiplexing Mechanism
|
||||
|
||||
Uses overlapped I/O and I/O completion ports for all asynchronous
|
||||
datagram_socket, stream_socket and socket_acceptor operations except for
|
||||
asynchronous connect.
|
||||
|
||||
Uses \c select for deadline_timer operations and for emulating asynchronous
|
||||
connect.
|
||||
|
||||
\subsection winnthreads Threads
|
||||
|
||||
Demultiplexing using I/O completion ports is performed in all threads that call
|
||||
asio::io_service::run().
|
||||
|
||||
An additional thread per io_service is used to for the \c select demultiplexing.
|
||||
This thread is created whenever the first deadline_timer, datagram_socket,
|
||||
stream_socket or socket_acceptor is created.
|
||||
|
||||
An additional thread per io_service is used to emulate asynchronous host
|
||||
resolution. This thread is created on the first call to either
|
||||
asio::ip::tcp::resolver::async_resolve() or
|
||||
asio::ip::udp::resolver::async_resolve().
|
||||
|
||||
*/
|
@ -1,37 +0,0 @@
|
||||
/**
|
||||
\mainpage asio Design
|
||||
|
||||
Some design notes:
|
||||
|
||||
\li <b>\ref designglossary</b>: Defines some terms used in the design and
|
||||
implementation of asio.
|
||||
|
||||
\li <b>\ref designproactor</b>: The asio library is based on the Proactor
|
||||
pattern. This design note outlines the advantages and disadvantages of this
|
||||
approach.
|
||||
|
||||
\li <b>\ref designthreads</b>: An implementation of asio for a particular
|
||||
platform may make use of one or more additional threads to emulate
|
||||
asynchronicity. This design note discusses design rules applied to the use of
|
||||
threads in this way.
|
||||
|
||||
\li <b>\ref designservices</b>: This design note describes the pattern used for
|
||||
structuring asynchronous object implementation.
|
||||
|
||||
\li <b>\ref designhandlers</b>: All asynchronous operations take a function
|
||||
object that will be called when the operation completes. This design note
|
||||
outlines the reasons for making the this handler type a template parameter,
|
||||
rather than using boost::function.
|
||||
|
||||
\li <b>\ref designcloseascancel</b>: Asynchronous socket operations can be
|
||||
cancelled by closing the socket. This design note describes why this approach
|
||||
was selected rather than allowing individual operations to be cancelled.
|
||||
|
||||
\li <b>\ref designbuffers</b>: This design note examines the buffer abstraction
|
||||
used by asio in order to support scatter-gather operations.
|
||||
|
||||
\li <b>\ref designimplementation</b>: This design note lists platform-specific
|
||||
implementation details, such as the default demultiplexing mechanism, the number
|
||||
of threads created internally, and when threads are created.
|
||||
|
||||
*/
|
50
asio/src/doc/design/line_based.qbk
Normal file
50
asio/src/doc/design/line_based.qbk
Normal file
@ -0,0 +1,50 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:line_based Line-Based Protocols]
|
||||
|
||||
Many commonly-used internet protocols are line-based, which means that they
|
||||
have protocol elements that are delimited by the character sequence `"\r\n"`.
|
||||
Examples include HTTP, SMTP and FTP.
|
||||
|
||||
To more easily permit the implementation of line-based protocols, as well as
|
||||
other protocols that use delimiters, Asio includes the functions
|
||||
`read_until()` and `async_read_until()`.
|
||||
|
||||
The following example illustrates the use of `async_read_until()` in an HTTP
|
||||
server, to receive the first line of an HTTP request from a client:
|
||||
|
||||
class http_connection
|
||||
{
|
||||
...
|
||||
|
||||
void start()
|
||||
{
|
||||
asio::async_read_until(socket_, data_, "\r\n",
|
||||
boost::bind(&http_connection::handle_request_line, this, _1));
|
||||
}
|
||||
|
||||
void handle_request_line(boost::system::error_code ec)
|
||||
{
|
||||
if (!ec)
|
||||
{
|
||||
std::string method, uri, version;
|
||||
char sp1, sp2, cr, lf;
|
||||
std::istream is(&data_);
|
||||
is.unsetf(std::ios_base::skipws);
|
||||
is >> method >> sp1 >> uri >> sp2 >> version >> cr >> lf;
|
||||
...
|
||||
}
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
asio::ip::tcp::socket socket_;
|
||||
asio::streambuf data_;
|
||||
};
|
||||
|
||||
[endsect]
|
BIN
asio/src/doc/design/proactor.png
Normal file
BIN
asio/src/doc/design/proactor.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
@ -1,157 +0,0 @@
|
||||
/**
|
||||
\page designproactor Proactor
|
||||
|
||||
The asio library is based on the Proactor pattern [1]. This design note
|
||||
describes how asio implements this design pattern, and outlines the advantages
|
||||
and disadvantages of this approach.
|
||||
|
||||
\section designproactoroverview Overview
|
||||
|
||||
First, let us examine how the Proactor design pattern is implemented in asio,
|
||||
without reference to platform-specific details.
|
||||
|
||||
\dotfile proactor.dot "Proactor design pattern (adapted from [1])"
|
||||
|
||||
@par Asynchronous Operation
|
||||
Defines an operation that is executed asynchronously, such as an asynchronous
|
||||
read or write on a socket.
|
||||
|
||||
@par Asynchronous Operation Processor
|
||||
Executes asynchronous operations and queues events on a completion event queue
|
||||
when operations complete. From a high-level point of view, services like
|
||||
asio::stream_socket_service are asynchronous operation processors.
|
||||
|
||||
@par Completion Event Queue
|
||||
Buffers completion events until they are dequeued by an asynchronous event
|
||||
demultiplexer.
|
||||
|
||||
@par Completion Handler
|
||||
Processes the result of an asynchronous operation. These are function objects,
|
||||
often created using \ref boost_bind.
|
||||
|
||||
@par Asynchronous Event Demultiplexer
|
||||
Blocks waiting for events to occur on the completion event queue, and returns a
|
||||
completed event to its caller.
|
||||
|
||||
@par Proactor
|
||||
Calls the asynchronous event demultiplexer to dequeue events, and dispatches
|
||||
the completion handler (i.e. invokes the function object) associated with the
|
||||
event. This abstraction is represented by asio::io_service.
|
||||
|
||||
@par Initiator
|
||||
Application-specific code that starts asynchronous operations. The initiator
|
||||
interacts with an asynchronous operation processor via a high-level interface
|
||||
such as asio::stream_socket, which in turn delegates to a service like
|
||||
asio::stream_socket_service.
|
||||
|
||||
\section designproactorposix Implementation using reactor
|
||||
|
||||
On many platforms, asio implements the Proactor design pattern in terms of a
|
||||
Reactor, such as \c select, \c epoll or \c kqueue. This implementation approach
|
||||
corresponds to the Proactor design pattern as follows:
|
||||
|
||||
@par Asynchronous Operation Processor
|
||||
A reactor implemented using \c select, \c epoll or \c kqueue. When the reactor
|
||||
indicates that the resource is ready to perform the operation, the processor
|
||||
executes the asynchronous operation and enqueues the associated completion
|
||||
handler on the completion event queue.
|
||||
|
||||
@par Completion Event Queue
|
||||
A linked list of completion handlers (i.e. function objects).
|
||||
|
||||
@par Asynchronous Event Demultiplexer
|
||||
This is implemented by waiting on an event or condition variable until a
|
||||
completion handler is available in the completion event queue.
|
||||
|
||||
\section designproactorwin Implementation using Windows overlapped I/O
|
||||
|
||||
On Windows NT, 2000 and XP, asio takes advantage of overlapped I/O to provide
|
||||
an efficient implementation of the Proactor design pattern. This implementation
|
||||
approach corresponds to the Proactor design pattern as follows:
|
||||
|
||||
@par Asynchronous Operation Processor
|
||||
This is implemented by the operating system. Operations are initiated by calling
|
||||
an overlapped function such as \c AcceptEx.
|
||||
|
||||
@par Completion Event Queue
|
||||
This is implemented by the operating system, and is associated with an I/O
|
||||
completion port. There is one I/O completion port for each asio::io_service
|
||||
instance.
|
||||
|
||||
@par Asynchronous Event Demultiplexer
|
||||
Called by asio to dequeue events and their associated completion handlers.
|
||||
|
||||
\section designproactoradv Advantages
|
||||
|
||||
\par Portability
|
||||
|
||||
The library interface can be reused independently of the operating system's
|
||||
underlying demultiplexing mechanism [1]. The Proactor interface may be
|
||||
implemented using a range of event sources, including the synchronous event
|
||||
demultiplexers that typify the Reactor pattern, such as select.
|
||||
|
||||
\par Decoupling threading from concurrency
|
||||
|
||||
Long-duration operations are performed asynchronously by the Proactor on behalf
|
||||
of the application. Consequently applications do not need to spawn many threads
|
||||
in order to increase concurrency [1].
|
||||
|
||||
\par Performance
|
||||
|
||||
Implementation strategies such as thread-per-connection can degrade system
|
||||
performance, due to increased context switching, synchronization and data
|
||||
movement among CPUs [1]. The Proactor pattern can avoid the cost of context
|
||||
switching by minimising the number of operating system threads, and only
|
||||
activating the logical threads of control that have events to process.
|
||||
|
||||
\par Simplified application synchronisation
|
||||
|
||||
Asynchronous operation completion handlers can be written as though they exist
|
||||
in a single-threaded environment, and so application logic can be developed
|
||||
with little or no concern for synchronisation issues [1].
|
||||
|
||||
\par Function composition
|
||||
|
||||
Function composition refers to the implementation of functions to provide a
|
||||
higher-level operation, such as sending a message in a particular format. Each
|
||||
function is implemented in terms of multiple calls to lower-level read or write
|
||||
operations.
|
||||
|
||||
For example, consider a protocol where each message consists of a fixed-length
|
||||
header followed by a variable length body, where the length of the body is
|
||||
specified in the header. A hypothetical read_message operation could be
|
||||
implemented using two lower-level reads, the first to receive the header and,
|
||||
once the length is known, the second to receive the body.
|
||||
|
||||
To compose functions in a Proactor model, asynchronous operations can be
|
||||
chained together. That is, a completion handler for one operation can initiate
|
||||
the next. Starting the first call in the chain can be encapsulated so that the
|
||||
caller need not be aware that the higher-level operation is implemented as a
|
||||
chain of asynchronous operations.
|
||||
|
||||
The ability to compose new operations in this way simplifies the development of
|
||||
higher levels of abstraction above a networking library, such as functions to
|
||||
support a specific protocol.
|
||||
|
||||
\section designproactordisadv Disadvantages
|
||||
|
||||
\par Program complexity
|
||||
|
||||
It is more difficult to develop applications using asynchronous mechanisms due
|
||||
to the separation in time and space between operation initiation and completion
|
||||
[1]. Applications may also be harder to debug due to the inverted flow of
|
||||
control.
|
||||
|
||||
\par Memory usage
|
||||
|
||||
Buffer space must be committed for the duration of a read or write operation,
|
||||
which may continue indefinitely, and a separate buffer is required for each
|
||||
concurrent operation. The Reactor pattern, on the other hand, does not require
|
||||
buffer space until a socket is ready for reading or writing.
|
||||
|
||||
\section designproactorrefs References
|
||||
|
||||
[1] D. Schmidt et al, <i>Pattern Oriented Software Architecture, Volume 2</i>.
|
||||
Wiley, 2000.
|
||||
|
||||
*/
|
44
asio/src/doc/design/rationale.qbk
Normal file
44
asio/src/doc/design/rationale.qbk
Normal file
@ -0,0 +1,44 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:rationale Rationale]
|
||||
|
||||
The Asio library is intended for programmers using C++ for systems
|
||||
programming, where access to operating system functionality such as networking
|
||||
is often required. In particular, Asio attempts to address the following
|
||||
goals:
|
||||
|
||||
* [*Portability.] The library should support, and provide consistent behaviour
|
||||
across, a range of commonly used operating systems.
|
||||
|
||||
* [*Scalability.] The library should allow, and indeed encourage, the
|
||||
development of network applications that scale to hundreds or thousands of
|
||||
concurrent connections. The library implementation for each operating system
|
||||
should use the mechanism that best enables this scalability.
|
||||
|
||||
* [*Efficiency.] The library should support techniques such as scatter-gather
|
||||
I/O, and allow protocol implementations that minimise data copying.
|
||||
|
||||
* [*Model Berkeley sockets.] The Berkeley sockets API is widely implemented and
|
||||
understood, as well as being covered in much literature. Other programming
|
||||
languages often use a similar interface for networking APIs.
|
||||
|
||||
* [*Ease of use.] Lower the entry barrier for new users by taking a toolkit,
|
||||
rather than framework, approach. That is, try to minimise the up-front
|
||||
investment in time to just learning a few basic rules and guidelines. After
|
||||
that, a library user should only need to understand the specific functions that
|
||||
are being used.
|
||||
|
||||
* [*Basis for further abstraction.] The library should permit the development
|
||||
of other libraries that provide higher levels of abstraction. For example,
|
||||
implementations of commonly used protocols such as HTTP.
|
||||
|
||||
Although the current incarnation of Asio focuses primarily on networking,
|
||||
its concepts of asynchronous I/O can be extended to include other operating
|
||||
system resources such as files.
|
||||
|
||||
[endsect]
|
@ -1,98 +0,0 @@
|
||||
/**
|
||||
\page designservices Services
|
||||
|
||||
The abstractions asio publishes for sockets (and other resources) are divided
|
||||
into three parts:
|
||||
|
||||
\li A service that provides a wrapper around a platform's implementation of
|
||||
the resource:
|
||||
|
||||
@code
|
||||
template <typename Allocator = std::allocator<void> >
|
||||
class stream_socket_service
|
||||
{
|
||||
public:
|
||||
// ...
|
||||
|
||||
typedef implementation_defined impl_type;
|
||||
|
||||
// ...
|
||||
|
||||
template <typename Handler>
|
||||
void async_receive(impl_type& impl, void* data, size_t max_length,
|
||||
socket_base::message_flags flags, Handler handler);
|
||||
|
||||
// ...
|
||||
};
|
||||
@endcode
|
||||
|
||||
\li A class template providing an object-oriented interface, where the
|
||||
template parameter is the service:
|
||||
|
||||
@code
|
||||
template <typename Service>
|
||||
class basic_stream_socket
|
||||
{
|
||||
public:
|
||||
typedef Service service_type;
|
||||
typedef typename service_type::impl_type impl_type;
|
||||
|
||||
// ...
|
||||
|
||||
template <typename Handler>
|
||||
void async_receive(void* data, size_t max_length,
|
||||
socket_base::message_flags flags, Handler handler)
|
||||
{
|
||||
service_.async_receive(impl_, data, max_length, flags, handler);
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
private:
|
||||
service_type& service_;
|
||||
impl_type impl_;
|
||||
};
|
||||
@endcode
|
||||
|
||||
\li A typedef for the typical usage:
|
||||
|
||||
@code
|
||||
typedef basic_stream_socket<stream_socket_service<> > stream_socket;
|
||||
@endcode
|
||||
|
||||
This design attempts meet the following goals:
|
||||
|
||||
\li To efficiently encapsulate the operating system's interface for the
|
||||
corresponding resource. On most operating systems a socket is represented by an
|
||||
integer, and so the service class wraps that facility portably and without
|
||||
adding a "heavyweight" class around it.
|
||||
|
||||
\li To allow the implementation of the socket to be customised. Some developers
|
||||
may need to use a different allocator, or perhaps a completely different
|
||||
implementation for sockets. This can be done by supplying a different argument
|
||||
to the basic_stream_socket template.
|
||||
|
||||
\li To make the most common usage appear no different to a class (in a similar
|
||||
fashion to std::string vs std::basic_string).
|
||||
|
||||
\section designservicesandioservice Services and the Demuxer
|
||||
|
||||
The asio::io_service object acts as an extensible collection of services, not
|
||||
dissimilar to the way a std::locale object is composed of facets. The io_service
|
||||
contains one service object for each service type, and the service objects are
|
||||
accessed by their types (see asio::basic_io_service::get_service).
|
||||
|
||||
However, unlike std::locale, services are loaded by the io_service only when
|
||||
first used. This means that you do not pay for the resources associated with a
|
||||
service unless you instantiate the corresponding class. For example, the
|
||||
deadline_timer_service implementation for Win32 uses a background thread, but
|
||||
this thread will not be created if there are no deadline_timer objects in a
|
||||
program.
|
||||
|
||||
This design also allows the io_service to be extended by user-defined services.
|
||||
As an example, a user may want to simulate asynchronous database access using a
|
||||
pool of background threads. A database_connection_service class can be defined
|
||||
to create and manage the thread pool, and each database_connection object uses
|
||||
this service.
|
||||
|
||||
*/
|
56
asio/src/doc/design/strands.qbk
Normal file
56
asio/src/doc/design/strands.qbk
Normal file
@ -0,0 +1,56 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:strands Strands]
|
||||
|
||||
A strand is defined as a strictly sequential invocation of event handlers (i.e.
|
||||
no concurrent invocation). Use of strands allows execution of code in a
|
||||
multithreaded program without the need for explicit locking (e.g. using
|
||||
mutexes).
|
||||
|
||||
Strands may be either implicit or explicit, as illustrated by the following
|
||||
alternative approaches:
|
||||
|
||||
* Calling io_service::run() from only one thread means all event handlers
|
||||
execute in an implicit strand, due to the io_service's guarantee that handlers
|
||||
are only invoked from inside run().
|
||||
|
||||
* Where there is a single chain of asynchronous operations associated with a
|
||||
connection (e.g. in a half duplex protocol implementation like HTTP) there is
|
||||
no possibility of concurrent execution of the handlers. This is an implicit
|
||||
strand.
|
||||
|
||||
* An explicit strand is an instance of `io_service::strand`. All event handler
|
||||
function objects need to be wrapped using `io_service::strand::wrap()` or
|
||||
otherwise posted/dispatched through the `io_service::strand` object.
|
||||
|
||||
In the case of composed asynchronous operations, such as `async_read()` or
|
||||
`async_read_until()`, if a completion handler goes through a strand, then all
|
||||
intermediate handlers should also go through the same strand. This is needed to
|
||||
ensure thread safe access for any objects that are shared between the caller
|
||||
and the composed operation (in the case of `async_read()` it's the socket,
|
||||
which the caller can close() to cancel the operation). This is done by having
|
||||
hook functions for all intermediate handlers which forward the calls to the
|
||||
customisable hook associated with the final handler:
|
||||
|
||||
struct my_handler
|
||||
{
|
||||
void operator()() { ... }
|
||||
};
|
||||
|
||||
template<class F>
|
||||
void asio_handler_invoke(F f, my_handler*)
|
||||
{
|
||||
// Do custom invocation here.
|
||||
// Default implementation calls f();
|
||||
}
|
||||
|
||||
The `io_service::strand::wrap()` function creates a new completion handler that
|
||||
defines `asio_handler_invoke` so that the function object is executed through the
|
||||
strand.
|
||||
|
||||
[endsect]
|
51
asio/src/doc/design/threads.qbk
Normal file
51
asio/src/doc/design/threads.qbk
Normal file
@ -0,0 +1,51 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:threads Threads]
|
||||
|
||||
[heading Thread Safety]
|
||||
|
||||
In general, it is safe to make concurrent use of distinct objects, but unsafe
|
||||
to make concurrent use of a single object. However, types such as `io_service`
|
||||
provide a stronger guarantee that it is safe to use a single object
|
||||
concurrently.
|
||||
|
||||
[heading Internal Threads]
|
||||
|
||||
The implementation of this library for a particular platform may make use of
|
||||
one or more internal threads to emulate asynchronicity. As far as possible,
|
||||
these threads must be invisible to the library user. In particular, the threads:
|
||||
|
||||
* must not call the user's code directly; and
|
||||
|
||||
* must block all signals.
|
||||
|
||||
This approach is complemented by the following guarantee:
|
||||
|
||||
* Asynchronous completion handlers will only be called from threads that are
|
||||
currently calling `io_service::run()`.
|
||||
|
||||
Consequently, it is the library user's responsibility to create and manage all
|
||||
threads to which the notifications will be delivered.
|
||||
|
||||
The reasons for this approach include:
|
||||
|
||||
* By only calling `io_service::run()` from a single thread, the user's code can
|
||||
avoid the development complexity associated with synchronisation. For
|
||||
example, a library user can implement scalable servers that are
|
||||
single-threaded (from the user's point of view).
|
||||
|
||||
* A library user may need to perform initialisation in a thread shortly after
|
||||
the thread starts and before any other application code is executed. For
|
||||
example, users of Microsoft's COM must call `CoInitializeEx` before any other
|
||||
COM operations can be called from that thread.
|
||||
|
||||
* The library interface is decoupled from interfaces for thread creation and
|
||||
management, and permits implementations on platforms where threads are not
|
||||
available.
|
||||
|
||||
[endsect]
|
@ -1,29 +0,0 @@
|
||||
/**
|
||||
\page designthreads Threads
|
||||
|
||||
The implementation of asio for a particular platform may make use of one or more
|
||||
additional threads to emulate asynchronicity. As far as possible, these threads must be invisible to the library user. In particular, the threads:
|
||||
|
||||
\li must not call the user's code directly.
|
||||
\li must block all signals.
|
||||
|
||||
This approach is complemented by the following guarantee:
|
||||
|
||||
\li Asynchronous completion handlers will only be called from threads that are
|
||||
currently calling asio::io_service::run().
|
||||
|
||||
Consequently, it is the library user's responsibility to create and manage all
|
||||
threads to which the notifications will be delivered.
|
||||
|
||||
\section designthreadsrationale Rationale
|
||||
|
||||
\li By only calling asio::io_service::run() from a single thread, the user's
|
||||
code can be avoid the development complexity associated with synchronisation.
|
||||
For example, a library user can implement scalable servers that are
|
||||
single-threaded (from the user's point of view).
|
||||
\li A library user may need to perform initialisation in a thread shortly after
|
||||
the thread starts and before any other application code is executed. For
|
||||
example, users of Microsoft's COM must call CoInitializeEx before any other COM
|
||||
operations can be called from that thread.
|
||||
|
||||
*/
|
@ -1,18 +0,0 @@
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>asio $projectnumber</B>
|
||||
</TD>
|
||||
<TD ALIGN="RIGHT">
|
||||
<A CLASS="qindex" HREF="../index.html">Home</A> |
|
||||
<A CLASS="qindex" HREF="../reference/index.html">Reference</A> |
|
||||
<A CLASS="qindex" HREF="../tutorial/index.html">Tutorial</A> |
|
||||
<A CLASS="qindex" HREF="../examples/index.html">Examples</A> |
|
||||
<A CLASS="qindex" HREF="../design/index.html">Design</A>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
@ -1,32 +0,0 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>$title</TITLE>
|
||||
<LINK HREF="asio.css" REL="stylesheet" TYPE="text/css">
|
||||
<LINK HREF="tabs.css" REL="stylesheet" TYPE="text/css">
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>asio $projectnumber</B>
|
||||
</TD>
|
||||
<TD ALIGN="RIGHT">
|
||||
<A CLASS="qindex" HREF="../index.html">Home</A> |
|
||||
<A CLASS="qindex" HREF="../reference/index.html">Reference</A> |
|
||||
<A CLASS="qindex" HREF="../tutorial/index.html">Tutorial</A> |
|
||||
<A CLASS="qindex" HREF="../examples/index.html">Examples</A> |
|
||||
<A CLASS="qindex" HREF="../design/index.html">Design</A>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>Design</B>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
22
asio/src/doc/doxy2qbk.pl
Normal file
22
asio/src/doc/doxy2qbk.pl
Normal file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# Copyright (c) 2003-2006 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)
|
||||
|
||||
use strict;
|
||||
|
||||
system("doxygen reference.dox");
|
||||
chdir("xml");
|
||||
system("xsltproc combine.xslt index.xml > all.xml");
|
||||
chdir("..");
|
||||
system("xsltproc reference.xsl xml/all.xml > reference.qbk");
|
||||
system("rm -rf xml");
|
||||
|
||||
system("doxygen tutorial.dox");
|
||||
chdir("xml");
|
||||
system("xsltproc combine.xslt index.xml > all.xml");
|
||||
chdir("..");
|
||||
system("xsltproc tutorial.xsl xml/all.xml > tutorial.qbk");
|
||||
system("rm -rf xml");
|
File diff suppressed because it is too large
Load Diff
220
asio/src/doc/examples.qbk
Normal file
220
asio/src/doc/examples.qbk
Normal file
@ -0,0 +1,220 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:examples Examples]
|
||||
|
||||
|
||||
[heading Allocation]
|
||||
|
||||
This example shows how to customise the allocation of memory associated with
|
||||
asynchronous operations.
|
||||
|
||||
* [@../src/examples/allocation/server.cpp]
|
||||
|
||||
|
||||
[heading Buffers]
|
||||
|
||||
This example demonstrates how to create reference counted buffers that can be
|
||||
used with socket read and write operations.
|
||||
|
||||
* [@../src/examples/buffers/reference_counted.cpp]
|
||||
|
||||
|
||||
[heading Chat]
|
||||
|
||||
This example implements a chat server and client. The programs use a custom
|
||||
protocol with a fixed length message header and variable length message body.
|
||||
|
||||
* [@../src/examples/chat/chat_message.hpp]
|
||||
* [@../src/examples/chat/chat_client.cpp]
|
||||
* [@../src/examples/chat/chat_server.cpp]
|
||||
|
||||
|
||||
[heading Echo]
|
||||
|
||||
A collection of simple clients and servers, showing the use of both synchronous
|
||||
and asynchronous operations.
|
||||
|
||||
* [@../src/examples/echo/async_tcp_echo_server.cpp]
|
||||
* [@../src/examples/echo/async_udp_echo_server.cpp]
|
||||
* [@../src/examples/echo/blocking_tcp_echo_client.cpp]
|
||||
* [@../src/examples/echo/blocking_tcp_echo_server.cpp]
|
||||
* [@../src/examples/echo/blocking_udp_echo_client.cpp]
|
||||
* [@../src/examples/echo/blocking_udp_echo_server.cpp]
|
||||
|
||||
|
||||
[heading HTTP Client]
|
||||
|
||||
Example programs implementing simple HTTP 1.0 clients. These examples show how
|
||||
to use the [link asio.reference.read_until] and [link
|
||||
asio.reference.async_read_until] functions.
|
||||
|
||||
* [@../src/examples/http/client/sync_client.cpp]
|
||||
* [@../src/examples/http/client/async_client.cpp]
|
||||
|
||||
|
||||
[heading HTTP Server]
|
||||
|
||||
This example illustrates the use of asio in a simple single-threaded server
|
||||
implementation of HTTP 1.0. It demonstrates how to perform a clean shutdown by
|
||||
cancelling all outstanding asynchronous operations.
|
||||
|
||||
* [@../src/examples/http/server/connection.cpp]
|
||||
* [@../src/examples/http/server/connection.hpp]
|
||||
* [@../src/examples/http/server/connection_manager.cpp]
|
||||
* [@../src/examples/http/server/connection_manager.hpp]
|
||||
* [@../src/examples/http/server/header.hpp]
|
||||
* [@../src/examples/http/server/mime_types.cpp]
|
||||
* [@../src/examples/http/server/mime_types.hpp]
|
||||
* [@../src/examples/http/server/posix_main.cpp]
|
||||
* [@../src/examples/http/server/reply.cpp]
|
||||
* [@../src/examples/http/server/reply.hpp]
|
||||
* [@../src/examples/http/server/request.hpp]
|
||||
* [@../src/examples/http/server/request_handler.cpp]
|
||||
* [@../src/examples/http/server/request_handler.hpp]
|
||||
* [@../src/examples/http/server/request_parser.cpp]
|
||||
* [@../src/examples/http/server/request_parser.hpp]
|
||||
* [@../src/examples/http/server/server.cpp]
|
||||
* [@../src/examples/http/server/server.hpp]
|
||||
* [@../src/examples/http/server/win_main.cpp]
|
||||
|
||||
|
||||
[heading HTTP Server 2]
|
||||
|
||||
An HTTP server using an io_service-per-CPU design.
|
||||
|
||||
* [@../src/examples/http/server2/connection.cpp]
|
||||
* [@../src/examples/http/server2/connection.hpp]
|
||||
* [@../src/examples/http/server2/header.hpp]
|
||||
* [@../src/examples/http/server2/io_service_pool.cpp]
|
||||
* [@../src/examples/http/server2/io_service_pool.hpp]
|
||||
* [@../src/examples/http/server2/mime_types.cpp]
|
||||
* [@../src/examples/http/server2/mime_types.hpp]
|
||||
* [@../src/examples/http/server2/posix_main.cpp]
|
||||
* [@../src/examples/http/server2/reply.cpp]
|
||||
* [@../src/examples/http/server2/reply.hpp]
|
||||
* [@../src/examples/http/server2/request.hpp]
|
||||
* [@../src/examples/http/server2/request_handler.cpp]
|
||||
* [@../src/examples/http/server2/request_handler.hpp]
|
||||
* [@../src/examples/http/server2/request_parser.cpp]
|
||||
* [@../src/examples/http/server2/request_parser.hpp]
|
||||
* [@../src/examples/http/server2/server.cpp]
|
||||
* [@../src/examples/http/server2/server.hpp]
|
||||
* [@../src/examples/http/server2/win_main.cpp]
|
||||
|
||||
|
||||
[heading HTTP Server 3]
|
||||
|
||||
An HTTP server using a single io_service and a thread pool calling `io_service::run()`.
|
||||
|
||||
* [@../src/examples/http/server3/connection.cpp]
|
||||
* [@../src/examples/http/server3/connection.hpp]
|
||||
* [@../src/examples/http/server3/header.hpp]
|
||||
* [@../src/examples/http/server3/mime_types.cpp]
|
||||
* [@../src/examples/http/server3/mime_types.hpp]
|
||||
* [@../src/examples/http/server3/posix_main.cpp]
|
||||
* [@../src/examples/http/server3/reply.cpp]
|
||||
* [@../src/examples/http/server3/reply.hpp]
|
||||
* [@../src/examples/http/server3/request.hpp]
|
||||
* [@../src/examples/http/server3/request_handler.cpp]
|
||||
* [@../src/examples/http/server3/request_handler.hpp]
|
||||
* [@../src/examples/http/server3/request_parser.cpp]
|
||||
* [@../src/examples/http/server3/request_parser.hpp]
|
||||
* [@../src/examples/http/server3/server.cpp]
|
||||
* [@../src/examples/http/server3/server.hpp]
|
||||
* [@../src/examples/http/server3/win_main.cpp]
|
||||
|
||||
|
||||
[heading Invocation]
|
||||
|
||||
This example shows how to customise handler invocation. Completion handlers are
|
||||
added to a priority queue rather than executed immediately.
|
||||
|
||||
* [@../src/examples/invocation/prioritised_handlers.cpp]
|
||||
|
||||
|
||||
[heading Iostreams]
|
||||
|
||||
Two examples showing how to use [link asio.reference.ip__tcp.iostream].
|
||||
|
||||
* [@../src/examples/iostreams/daytime_client.cpp]
|
||||
* [@../src/examples/iostreams/daytime_server.cpp]
|
||||
|
||||
|
||||
[heading Multicast]
|
||||
|
||||
An example showing the use of multicast to transmit packets to a group of
|
||||
subscribers.
|
||||
|
||||
* [@../src/examples/multicast/receiver.cpp]
|
||||
* [@../src/examples/multicast/sender.cpp]
|
||||
|
||||
|
||||
[heading Serialization]
|
||||
|
||||
This example shows how Boost.Serialization can be used with asio to encode and
|
||||
decode structures for transmission over a socket.
|
||||
|
||||
* [@../src/examples/serialization/client.cpp]
|
||||
* [@../src/examples/serialization/connection.hpp]
|
||||
* [@../src/examples/serialization/server.cpp]
|
||||
* [@../src/examples/serialization/stock.hpp]
|
||||
|
||||
|
||||
[heading Services]
|
||||
|
||||
This example demonstrates how to integrate custom functionality (in this case,
|
||||
for logging) into asio's [link asio.reference.io_service io_service], and
|
||||
how to use a custom service with [link
|
||||
asio.reference.basic_stream_socket].
|
||||
|
||||
* [@../src/examples/services/basic_logger.hpp]
|
||||
* [@../src/examples/services/daytime_client.cpp]
|
||||
* [@../src/examples/services/logger.hpp]
|
||||
* [@../src/examples/services/logger_service.cpp]
|
||||
* [@../src/examples/services/logger_service.hpp]
|
||||
* [@../src/examples/services/stream_socket_service.hpp]
|
||||
|
||||
|
||||
[heading SOCKS 4]
|
||||
|
||||
Example client program implementing the SOCKS 4 protocol for communication via
|
||||
a proxy.
|
||||
|
||||
* [@../src/examples/socks4/sync_client.cpp]
|
||||
* [@../src/examples/socks4/socks4.hpp]
|
||||
|
||||
|
||||
[heading SSL]
|
||||
|
||||
Example client and server programs showing the use of the [link
|
||||
asio.reference.ssl__stream] template with asynchronous operations.
|
||||
|
||||
* [@../src/examples/ssl/client.cpp]
|
||||
* [@../src/examples/ssl/server.cpp]
|
||||
|
||||
|
||||
[heading Timeouts]
|
||||
|
||||
A collection of examples showing how to cancel long running asynchronous
|
||||
operations after a period of time.
|
||||
|
||||
* [@../src/examples/timeouts/accept_timeout.cpp]
|
||||
* [@../src/examples/timeouts/connect_timeout.cpp]
|
||||
* [@../src/examples/timeouts/datagram_receive_timeout.cpp]
|
||||
* [@../src/examples/timeouts/stream_receive_timeout.cpp]
|
||||
|
||||
|
||||
[heading Timers]
|
||||
|
||||
Examples showing how to customise deadline_timer using different time types.
|
||||
|
||||
* [@../src/examples/timers/tick_count_timer.cpp]
|
||||
* [@../src/examples/timers/time_t_timer.cpp]
|
||||
|
||||
|
||||
[endsect]
|
@ -1,286 +0,0 @@
|
||||
/**
|
||||
\mainpage asio Examples
|
||||
|
||||
\section allocation_section Allocation
|
||||
|
||||
This example shows how to customise the allocation of memory associated with
|
||||
asynchronous operations.
|
||||
|
||||
\li \ref allocation_server_cpp
|
||||
|
||||
\section buffers_section Buffers
|
||||
|
||||
This example demonstrates how to create reference counted buffers that can be
|
||||
used with socket read and write operations.
|
||||
|
||||
\li \ref buffers_reference_counted_cpp
|
||||
|
||||
\section chat_section Chat
|
||||
|
||||
This example implements a chat server and client. The programs use a custom
|
||||
protocol with a fixed length message header and variable length message body.
|
||||
|
||||
\li \ref chat_chat_message_hpp
|
||||
\li \ref chat_chat_client_cpp
|
||||
\li \ref chat_chat_server_cpp
|
||||
|
||||
\section echo_section Echo
|
||||
|
||||
A collection of simple clients and servers, showing the use of both synchronous
|
||||
and asynchronous operations.
|
||||
|
||||
\li \ref echo_async_tcp_echo_server_cpp
|
||||
\li \ref echo_async_udp_echo_server_cpp
|
||||
\li \ref echo_blocking_tcp_echo_client_cpp
|
||||
\li \ref echo_blocking_tcp_echo_server_cpp
|
||||
\li \ref echo_blocking_udp_echo_client_cpp
|
||||
\li \ref echo_blocking_udp_echo_server_cpp
|
||||
|
||||
\section httpclient_section HTTP Client
|
||||
|
||||
Example programs implementing simple HTTP 1.0 clients. These examples show how
|
||||
to use the \ref read_until and \ref async_read_until functions.
|
||||
|
||||
\li \ref httpclient_sync_client_cpp
|
||||
\li \ref httpclient_async_client_cpp
|
||||
|
||||
\section httpserver_section HTTP Server
|
||||
|
||||
This example illustrates the use of asio in a server implementation of HTTP 1.0.
|
||||
It demonstrates how to perform a clean shutdown by cancelling all outstanding
|
||||
asynchronous operations.
|
||||
|
||||
\li \ref http::server "HTTP Server Classes"
|
||||
\li \ref httpserver_files
|
||||
|
||||
\section iostreams_section Iostreams
|
||||
|
||||
Two examples showing how to use asio::ip::tcp::iostream.
|
||||
|
||||
\li \ref iostreams_daytime_client_cpp
|
||||
\li \ref iostreams_daytime_server_cpp
|
||||
|
||||
\section multicast_section Multicast
|
||||
|
||||
An example showing the use of multicast to transmit packets to a group of
|
||||
subscribers.
|
||||
|
||||
\li \ref multicast_receiver_cpp
|
||||
\li \ref multicast_sender_cpp
|
||||
|
||||
\section serialization_section Serialization
|
||||
|
||||
This example shows how Boost.Serialization can be used with asio to encode and
|
||||
decode structures for transmission over a socket.
|
||||
|
||||
\li \ref ::s11n_example "Serialization Classes"
|
||||
\li \ref serialization_files
|
||||
|
||||
\section services_section Services
|
||||
|
||||
This example demonstrates how to:
|
||||
|
||||
\li Integrate custom functionality (in this case, for logging) into asio's
|
||||
io_service. It follows the pattern defined in the \ref designservices design
|
||||
note.
|
||||
\li Use a custom service with asio::basic_stream_socket.
|
||||
|
||||
\li \ref ::services "Services Classes"
|
||||
\li \ref services_files
|
||||
|
||||
\section ssl_section SSL
|
||||
|
||||
Example client and server programs showing the use of the asio::ssl::stream
|
||||
template with asynchronous operations.
|
||||
|
||||
\li \ref ssl_client_cpp
|
||||
\li \ref ssl_server_cpp
|
||||
|
||||
\section timeouts_section Timeouts
|
||||
|
||||
A collection of examples showing how to cancel long running asynchronous
|
||||
operations after a period of time.
|
||||
|
||||
\li \ref timeouts_accept_timeout_cpp
|
||||
\li \ref timeouts_connect_timeout_cpp
|
||||
\li \ref timeouts_datagram_receive_timeout_cpp
|
||||
\li \ref timeouts_stream_receive_timeout_cpp
|
||||
|
||||
\section timers_section Timers
|
||||
|
||||
Examples showing how to customise deadline_timer using different time types.
|
||||
|
||||
\li \ref timers_tick_count_timer_cpp
|
||||
\li \ref timers_time_t_timer_cpp
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
\page allocation_server_cpp allocation/server.cpp
|
||||
\include allocation/server.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page buffers_reference_counted_cpp buffers/reference_counted.cpp
|
||||
\include buffers/reference_counted.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page chat_chat_message_hpp chat/chat_message.hpp
|
||||
\include chat/chat_message.hpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page chat_chat_client_cpp chat/chat_client.cpp
|
||||
\include chat/chat_client.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page chat_chat_server_cpp chat/chat_server.cpp
|
||||
\include chat/chat_server.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page echo_async_tcp_echo_server_cpp echo/async_tcp_echo_server.cpp
|
||||
\include echo/async_tcp_echo_server.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page echo_async_udp_echo_server_cpp echo/async_udp_echo_server.cpp
|
||||
\include echo/async_udp_echo_server.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page echo_blocking_tcp_echo_client_cpp echo/blocking_tcp_echo_client.cpp
|
||||
\include echo/blocking_tcp_echo_client.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page echo_blocking_tcp_echo_server_cpp echo/blocking_tcp_echo_server.cpp
|
||||
\include echo/blocking_tcp_echo_server.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page echo_blocking_udp_echo_client_cpp echo/blocking_udp_echo_client.cpp
|
||||
\include echo/blocking_udp_echo_client.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page echo_blocking_udp_echo_server_cpp echo/blocking_udp_echo_server.cpp
|
||||
\include echo/blocking_udp_echo_server.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page httpclient_async_client_cpp http/client/async_client.cpp
|
||||
\include http/client/async_client.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page httpclient_sync_client_cpp http/client/sync_client.cpp
|
||||
\include http/client/sync_client.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page httpserver_files HTTP Server Files
|
||||
|
||||
\li \ref http/server/connection.cpp "connection.cpp"
|
||||
\li \ref http/server/connection.hpp "connection.hpp"
|
||||
\li \ref http/server/connection_manager.cpp "connection_manager.cpp"
|
||||
\li \ref http/server/connection_manager.hpp "connection_manager.hpp"
|
||||
\li \ref http/server/header.hpp "header.hpp"
|
||||
\li \ref http/server/mime_types.cpp "mime_types.cpp"
|
||||
\li \ref http/server/mime_types.hpp "mime_types.hpp"
|
||||
\li \ref http/server/posix_main.cpp "posix_main.cpp"
|
||||
\li \ref http/server/reply.cpp "reply.cpp"
|
||||
\li \ref http/server/reply.hpp "reply.hpp"
|
||||
\li \ref http/server/request.hpp "request.hpp"
|
||||
\li \ref http/server/request_handler.cpp "request_handler.cpp"
|
||||
\li \ref http/server/request_handler.hpp "request_handler.hpp"
|
||||
\li \ref http/server/request_parser.cpp "request_parser.cpp"
|
||||
\li \ref http/server/request_parser.hpp "request_parser.hpp"
|
||||
\li \ref http/server/server.cpp "server.cpp"
|
||||
\li \ref http/server/server.hpp "server.hpp"
|
||||
\li \ref http/server/win_main.cpp "win_main.cpp"
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
\page iostreams_daytime_client_cpp iostreams/daytime_client.cpp
|
||||
\include iostreams/daytime_client.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page iostreams_daytime_server_cpp iostreams/daytime_server.cpp
|
||||
\include iostreams/daytime_server.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page multicast_receiver_cpp multicast/receiver.cpp
|
||||
\include multicast/receiver.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page multicast_sender_cpp multicast/sender.cpp
|
||||
\include multicast/sender.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page serialization_files Serialization Files
|
||||
|
||||
\li \ref serialization/client.cpp "client.cpp"
|
||||
\li \ref serialization/connection.hpp "connection.hpp"
|
||||
\li \ref serialization/server.cpp "server.cpp"
|
||||
\li \ref serialization/stock.hpp "stock.hpp"
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
\page services_files Services Files
|
||||
|
||||
\li \ref services/basic_logger.hpp "basic_logger.hpp"
|
||||
\li \ref services/daytime_client.cpp "daytime_client.cpp"
|
||||
\li \ref services/logger.hpp "logger.hpp"
|
||||
\li \ref services/logger_service.hpp "logger_service.hpp"
|
||||
\li \ref services/stream_socket_service.hpp "stream_socket_service.hpp"
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
\page ssl_client_cpp ssl/client.cpp
|
||||
\include ssl/client.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page ssl_server_cpp ssl/server.cpp
|
||||
\include ssl/server.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page timeouts_accept_timeout_cpp timeouts/accept_timeout.cpp
|
||||
\include timeouts/accept_timeout.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page timeouts_connect_timeout_cpp timeouts/connect_timeout.cpp
|
||||
\include timeouts/connect_timeout.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page timeouts_datagram_receive_timeout_cpp timeouts/datagram_receive_timeout.cpp
|
||||
\include timeouts/datagram_receive_timeout.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page timeouts_stream_receive_timeout_cpp timeouts/stream_receive_timeout.cpp
|
||||
\include timeouts/stream_receive_timeout.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page timers_tick_count_timer_cpp timers/tick_count_timer.cpp
|
||||
\include timers/tick_count_timer.cpp
|
||||
*/
|
||||
|
||||
/**
|
||||
\page timers_time_t_timer_cpp timers/time_t_timer.cpp
|
||||
\include timers/time_t_timer.cpp
|
||||
*/
|
@ -1,18 +0,0 @@
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>asio $projectnumber</B>
|
||||
</TD>
|
||||
<TD ALIGN="RIGHT">
|
||||
<A CLASS="qindex" HREF="../index.html">Home</A> |
|
||||
<A CLASS="qindex" HREF="../reference/index.html">Reference</A> |
|
||||
<A CLASS="qindex" HREF="../tutorial/index.html">Tutorial</A> |
|
||||
<A CLASS="qindex" HREF="../examples/index.html">Examples</A> |
|
||||
<A CLASS="qindex" HREF="../design/index.html">Design</A>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
@ -1,34 +0,0 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>$title</TITLE>
|
||||
<LINK HREF="asio.css" REL="stylesheet" TYPE="text/css">
|
||||
<LINK HREF="tabs.css" REL="stylesheet" TYPE="text/css">
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>asio $projectnumber</B>
|
||||
</TD>
|
||||
<TD ALIGN="RIGHT">
|
||||
<A CLASS="qindex" HREF="../index.html">Home</A> |
|
||||
<A CLASS="qindex" HREF="../reference/index.html">Reference</A> |
|
||||
<A CLASS="qindex" HREF="../tutorial/index.html">Tutorial</A> |
|
||||
<A CLASS="qindex" HREF="../examples/index.html">Examples</A> |
|
||||
<A CLASS="qindex" HREF="../design/index.html">Design</A>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>Examples</B>
|
||||
</TD>
|
||||
<TD ALIGN="RIGHT">
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
@ -1,11 +0,0 @@
|
||||
<?xml version='1.0' encoding='ISO-8859-1' standalone='yes' ?>
|
||||
<tagfile>
|
||||
<compound kind="class">
|
||||
<name>noncopyable</name>
|
||||
<filename>noncopyable.html</filename>
|
||||
</compound>
|
||||
<compound kind="class">
|
||||
<name>std::exception</name>
|
||||
<filename>stdexception.html</filename>
|
||||
</compound>
|
||||
</tagfile>
|
@ -1,142 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>asio C++ library</title>
|
||||
<link href="asio.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<div class="qindex">
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<b>asio @VERSION@</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
<a class="qindex" href="index.html">Home</a> |
|
||||
<a class="qindex" href="reference/index.html">Reference</a> |
|
||||
<a class="qindex" href="tutorial/index.html">Tutorial</a> |
|
||||
<a class="qindex" href="examples/index.html">Examples</a> |
|
||||
<a class="qindex" href="design/index.html">Design</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<h1>asio C++ library</h1>
|
||||
<table border="0" cellpadding="3" cellspacing="3" width="100%"><tr>
|
||||
<td valign="top">
|
||||
|
||||
<p>
|
||||
asio is a cross-platform C++ library for network programming that provides
|
||||
developers with a consistent asynchronous I/O model using a modern C++
|
||||
approach.
|
||||
</p>
|
||||
|
||||
<h2>License</h2>
|
||||
<p>
|
||||
asio is released under the
|
||||
<a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License</a>.
|
||||
</p>
|
||||
|
||||
<h2>Dependencies</h2>
|
||||
<p>
|
||||
asio requires <a href="http://www.boost.org">Boost</a> version 1.33 or
|
||||
later. There is no need to build any of the Boost libraries to use most
|
||||
of Boost.Asio, and only the header files are required. However, some
|
||||
overloads of <tt>read_until</tt> and <tt>async_read_until</tt> require
|
||||
the Boost.Regex library. (Note: with MSVC or Borland C++ you may need to
|
||||
add -DBOOST_ALL_NO_LIB to your project settings to disable autolinking
|
||||
of the Boost.Date_Time and Boost.Regex libraries.)
|
||||
</p>
|
||||
<p>
|
||||
To use asio's SSL support, <a href="http://www.openssl.org">OpenSSL</a> is
|
||||
required. OpenSSL is not necessary to use the rest of asio.
|
||||
</p>
|
||||
|
||||
<h2>Using asio</h2>
|
||||
<p>
|
||||
asio consists only of header files, and so there is no need to build any
|
||||
libraries before using asio in your own applications. You simply need to
|
||||
add the following directories to your compiler include path:
|
||||
</p>
|
||||
<ul>
|
||||
<li>asio's <tt>include</tt> directory</li>
|
||||
<li>the boost directory (e.g. the one called <tt>boost_1_33_0</tt>)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Supported Platforms</h2>
|
||||
<p>
|
||||
asio supports the following platforms and compilers:
|
||||
<ul>
|
||||
<li>
|
||||
Win32 using Visual C++ 7.1 and Visual C++ 8.0.
|
||||
</li>
|
||||
<li>
|
||||
Win32 using Borland C++Builder 6 patch 4.
|
||||
</li>
|
||||
<li>
|
||||
Win32 using MinGW.
|
||||
</li>
|
||||
<li>
|
||||
Win32 using Cygwin. (__USE_W32_SOCKETS must be defined.)
|
||||
</li>
|
||||
<li>
|
||||
Linux (2.4 or 2.6 kernels) using g++ 3.3 or later.
|
||||
</li>
|
||||
<li>
|
||||
Solaris using g++ 3.3 or later.
|
||||
</li>
|
||||
<li>
|
||||
Mac OS X 10.4 using g++ 3.3 or later.
|
||||
</li>
|
||||
<li>
|
||||
QNX Neutrino 6.3 using g++ 3.3 or later.
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
<div class="sidebar">
|
||||
<table border="0" width="100%"><tr><td>
|
||||
<h2>Getting Started</h2>
|
||||
<ul>
|
||||
<li><a href="tutorial/index.html">Tutorial</a>
|
||||
<li><a href="examples/index.html">Annotated examples</a>
|
||||
<li><a href="building.html">Building the tests and examples</a>
|
||||
</ul>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<table border="0" width="100%"><tr><td>
|
||||
<h2>Related Links</h2>
|
||||
<ul>
|
||||
<li><a href="http://asio.sourceforge.net">asio homepage</a>
|
||||
<li><a href="http://sourceforge.net/projects/asio/">asio project page</a>
|
||||
<li><a href="http://sourceforge.net/project/showfiles.php?group_id=122478">Download latest releases</a>
|
||||
<li><a href="http://www.boost.org">Boost homepage</a>
|
||||
</ul>
|
||||
</td></tr></table>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr></table>
|
||||
<div class="qindex">
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<b>asio @VERSION@</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
<a class="qindex" href="index.html">Home</a> |
|
||||
<a class="qindex" href="reference/index.html">Reference</a> |
|
||||
<a class="qindex" href="tutorial/index.html">Tutorial</a> |
|
||||
<a class="qindex" href="examples/index.html">Examples</a> |
|
||||
<a class="qindex" href="design/index.html">Design</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
3
asio/src/doc/noncopyable_dox.txt
Normal file
3
asio/src/doc/noncopyable_dox.txt
Normal file
@ -0,0 +1,3 @@
|
||||
/**
|
||||
\class noncopyable
|
||||
*/
|
1
asio/src/doc/project-root.jam
Normal file
1
asio/src/doc/project-root.jam
Normal file
@ -0,0 +1 @@
|
||||
# This file intentionally left blank.
|
165
asio/src/doc/quickref.xml
Normal file
165
asio/src/doc/quickref.xml
Normal file
@ -0,0 +1,165 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "../../../boost/tools/boostbook/dtd/boostbook.dtd">
|
||||
|
||||
<!--
|
||||
Copyright (c) 2003-2007 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)
|
||||
-->
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="4">
|
||||
<tbody>
|
||||
<row>
|
||||
<entry valign="top">
|
||||
<bridgehead renderas="sect3">Classes</bridgehead>
|
||||
<itemizedlist>
|
||||
<listitem><link linkend="asio.reference.const_buffer">const_buffer</link></listitem>
|
||||
<listitem><link linkend="asio.reference.const_buffers_1">const_buffers_1</link></listitem>
|
||||
<listitem><link linkend="asio.reference.deadline_timer">deadline_timer</link></listitem>
|
||||
<listitem><link linkend="asio.reference.error_code">error_code</link></listitem>
|
||||
<listitem><link linkend="asio.reference.io_service">io_service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.io_service__id">io_service::id</link></listitem>
|
||||
<listitem><link linkend="asio.reference.io_service__service">io_service::service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.io_service__strand">io_service::strand</link></listitem>
|
||||
<listitem><link linkend="asio.reference.io_service__work">io_service::work</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__address">ip::address</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__address_v4">ip::address_v4</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__address_v6">ip::address_v6</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__resolver_query_base">ip::resolver_query_base</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__tcp">ip::tcp</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__tcp.acceptor">ip::tcp::acceptor</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__tcp.endpoint">ip::tcp::endpoint</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__tcp.iostream">ip::tcp::iostream</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__tcp.resolver">ip::tcp::resolver</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__tcp.socket">ip::tcp::socket</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__udp">ip::udp</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__udp.endpoint">ip::udp::endpoint</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__udp.resolver">ip::udp::resolver</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__udp.socket">ip::udp::socket</link></listitem>
|
||||
<listitem><link linkend="asio.reference.mutable_buffer">mutable_buffer</link></listitem>
|
||||
<listitem><link linkend="asio.reference.mutable_buffers_1">mutable_buffers_1</link></listitem>
|
||||
<listitem><link linkend="asio.reference.socket_base">socket_base</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ssl__context">ssl::context</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ssl__context_base">ssl::context_base</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ssl__stream_base">ssl::stream_base</link></listitem>
|
||||
<listitem><link linkend="asio.reference.streambuf">streambuf</link></listitem>
|
||||
<listitem><link linkend="asio.reference.system_error">system_error</link></listitem>
|
||||
<listitem><link linkend="asio.reference.thread">thread</link></listitem>
|
||||
</itemizedlist>
|
||||
</entry>
|
||||
<entry valign="top">
|
||||
<bridgehead renderas="sect3">Class Templates</bridgehead>
|
||||
<itemizedlist>
|
||||
<listitem><link linkend="asio.reference.basic_datagram_socket">basic_datagram_socket</link></listitem>
|
||||
<listitem><link linkend="asio.reference.basic_deadline_timer">basic_deadline_timer</link></listitem>
|
||||
<listitem><link linkend="asio.reference.basic_io_object">basic_io_object</link></listitem>
|
||||
<listitem><link linkend="asio.reference.basic_socket">basic_socket</link></listitem>
|
||||
<listitem><link linkend="asio.reference.basic_socket_acceptor">basic_socket_acceptor</link></listitem>
|
||||
<listitem><link linkend="asio.reference.basic_socket_iostream">basic_socket_iostream</link></listitem>
|
||||
<listitem><link linkend="asio.reference.basic_socket_streambuf">basic_socket_streambuf</link></listitem>
|
||||
<listitem><link linkend="asio.reference.basic_stream_socket">basic_stream_socket</link></listitem>
|
||||
<listitem><link linkend="asio.reference.basic_streambuf">basic_streambuf</link></listitem>
|
||||
<listitem><link linkend="asio.reference.buffered_read_stream">buffered_read_stream</link></listitem>
|
||||
<listitem><link linkend="asio.reference.buffered_stream">buffered_stream</link></listitem>
|
||||
<listitem><link linkend="asio.reference.buffered_write_stream">buffered_write_stream</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__basic_endpoint">ip::basic_endpoint</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__basic_resolver">ip::basic_resolver</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__basic_resolver_entry">ip::basic_resolver_entry</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__basic_resolver_iterator">ip::basic_resolver_iterator</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__basic_resolver_query">ip::basic_resolver_query</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ssl__basic_context">ssl::basic_context</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ssl__stream">ssl::stream</link></listitem>
|
||||
</itemizedlist>
|
||||
<bridgehead renderas="sect3">Services</bridgehead>
|
||||
<itemizedlist>
|
||||
<listitem><link linkend="asio.reference.datagram_socket_service">datagram_socket_service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.deadline_timer_service">deadline_timer_service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__resolver_service">ip::resolver_service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.socket_acceptor_service">socket_acceptor_service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ssl__context_service">ssl::context_service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ssl__stream_service">ssl::stream_service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.stream_socket_service">stream_socket_service</link></listitem>
|
||||
</itemizedlist>
|
||||
<bridgehead renderas="sect3">Placeholders</bridgehead>
|
||||
<itemizedlist>
|
||||
<listitem><link linkend="asio.reference.placeholders__bytes_transferred">placeholders::bytes_transferred</link></listitem>
|
||||
<listitem><link linkend="asio.reference.placeholders__error">placeholders::error</link></listitem>
|
||||
<listitem><link linkend="asio.reference.placeholders__iterator">placeholders::iterator</link></listitem>
|
||||
</itemizedlist>
|
||||
</entry>
|
||||
<entry valign="top">
|
||||
<bridgehead renderas="sect3">Free Functions</bridgehead>
|
||||
<itemizedlist>
|
||||
<listitem><link linkend="asio.reference.add_service">add_service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.asio_handler_allocate">asio_handler_allocate</link></listitem>
|
||||
<listitem><link linkend="asio.reference.asio_handler_deallocate">asio_handler_deallocate</link></listitem>
|
||||
<listitem><link linkend="asio.reference.asio_handler_invoke">asio_handler_invoke</link></listitem>
|
||||
<listitem><link linkend="asio.reference.async_read">async_read</link></listitem>
|
||||
<listitem><link linkend="asio.reference.async_read_until">async_read_until</link></listitem>
|
||||
<listitem><link linkend="asio.reference.async_write">async_write</link></listitem>
|
||||
<listitem><link linkend="asio.reference.buffer">buffer</link></listitem>
|
||||
<listitem><link linkend="asio.reference.has_service">has_service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ip__host_name">ip::host_name</link></listitem>
|
||||
<listitem><link linkend="asio.reference.read">read</link></listitem>
|
||||
<listitem><link linkend="asio.reference.read_until">read_until</link></listitem>
|
||||
<listitem><link linkend="asio.reference.transfer_all">transfer_all</link></listitem>
|
||||
<listitem><link linkend="asio.reference.transfer_at_least">transfer_at_least</link></listitem>
|
||||
<listitem><link linkend="asio.reference.use_service">use_service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.write">write</link></listitem>
|
||||
</itemizedlist>
|
||||
<bridgehead renderas="sect3">Error Codes</bridgehead>
|
||||
<itemizedlist>
|
||||
<listitem><link linkend="asio.reference.error__basic_errors">error::basic_errors</link></listitem>
|
||||
<listitem><link linkend="asio.reference.error__netdb_errors">error::netdb_errors</link></listitem>
|
||||
<listitem><link linkend="asio.reference.error__addrinfo_errors">error::addrinfo_errors</link></listitem>
|
||||
<listitem><link linkend="asio.reference.error__misc_errors">error::misc_errors</link></listitem>
|
||||
</itemizedlist>
|
||||
<bridgehead renderas="sect3">Type Traits</bridgehead>
|
||||
<itemizedlist>
|
||||
<listitem><link linkend="asio.reference.is_read_buffered">is_read_buffered</link></listitem>
|
||||
<listitem><link linkend="asio.reference.is_write_buffered">is_write_buffered</link></listitem>
|
||||
</itemizedlist>
|
||||
</entry>
|
||||
<entry valign="top">
|
||||
<bridgehead renderas="sect3">Type Requirements</bridgehead>
|
||||
<itemizedlist>
|
||||
<listitem><link linkend="asio.reference.asynchronous_operations">Asynchronous operations</link></listitem>
|
||||
<listitem><link linkend="asio.reference.AcceptHandler">AcceptHandler</link></listitem>
|
||||
<listitem><link linkend="asio.reference.AsyncReadStream">AsyncReadStream</link></listitem>
|
||||
<listitem><link linkend="asio.reference.AsyncWriteStream">AsyncWriteStream</link></listitem>
|
||||
<listitem><link linkend="asio.reference.CompletionHandler">CompletionHandler</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ConnectHandler">ConnectHandler</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ConstBufferSequence">ConstBufferSequence</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ConvertibleToConstBuffer">ConvertibleToConstBuffer</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ConvertibleToMutableBuffer">ConvertibleToMutableBuffer</link></listitem>
|
||||
<listitem><link linkend="asio.reference.DatagramSocketService">DatagramSocketService</link></listitem>
|
||||
<listitem><link linkend="asio.reference.Endpoint">Endpoint</link></listitem>
|
||||
<listitem><link linkend="asio.reference.GettableSocketOption">GettableSocketOption</link></listitem>
|
||||
<listitem><link linkend="asio.reference.Handler">Handler</link></listitem>
|
||||
<listitem><link linkend="asio.reference.InternetProtocol">InternetProtocol</link></listitem>
|
||||
<listitem><link linkend="asio.reference.IoControlCommand">IoControlCommand</link></listitem>
|
||||
<listitem><link linkend="asio.reference.IoObjectService">IoObjectService</link></listitem>
|
||||
<listitem><link linkend="asio.reference.MutableBufferSequence">MutableBufferSequence</link></listitem>
|
||||
<listitem><link linkend="asio.reference.Protocol">Protocol</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ReadHandler">ReadHandler</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ResolveHandler">ResolveHandler</link></listitem>
|
||||
<listitem><link linkend="asio.reference.ResolverService">ResolverService</link></listitem>
|
||||
<listitem><link linkend="asio.reference.Service">Service</link></listitem>
|
||||
<listitem><link linkend="asio.reference.SettableSocketOption">SettableSocketOption</link></listitem>
|
||||
<listitem><link linkend="asio.reference.SocketAcceptorService">SocketAcceptorService</link></listitem>
|
||||
<listitem><link linkend="asio.reference.SocketService">SocketService</link></listitem>
|
||||
<listitem><link linkend="asio.reference.StreamSocketService">StreamSocketService</link></listitem>
|
||||
<listitem><link linkend="asio.reference.SyncReadStream">SyncReadStream</link></listitem>
|
||||
<listitem><link linkend="asio.reference.SyncWriteStream">SyncWriteStream</link></listitem>
|
||||
<listitem><link linkend="asio.reference.TimerService">TimerService</link></listitem>
|
||||
<listitem><link linkend="asio.reference.TimeTraits">TimeTraits</link></listitem>
|
||||
<listitem><link linkend="asio.reference.WaitHandler">WaitHandler</link></listitem>
|
||||
<listitem><link linkend="asio.reference.WriteHandler">WriteHandler</link></listitem>
|
||||
</itemizedlist>
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
233
asio/src/doc/reference.dox
Normal file
233
asio/src/doc/reference.dox
Normal file
@ -0,0 +1,233 @@
|
||||
# Doxyfile 1.4.5
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = "Asio Reference"
|
||||
PROJECT_NUMBER =
|
||||
OUTPUT_DIRECTORY = .
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF =
|
||||
ALWAYS_DETAILED_SEC = YES
|
||||
INLINE_INHERITED_MEMB = YES
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = ./../../include/
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = YES
|
||||
DETAILS_AT_TOP = YES
|
||||
INHERIT_DOCS = NO
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 2
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = YES
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
HIDE_UNDOC_CLASSES = YES
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = NO
|
||||
INLINE_INFO = NO
|
||||
SORT_MEMBER_DOCS = NO
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = NO
|
||||
GENERATE_TESTLIST = NO
|
||||
GENERATE_BUGLIST = NO
|
||||
GENERATE_DEPRECATEDLIST= NO
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = NO
|
||||
SHOW_DIRECTORIES = NO
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = ./../../include/asio.hpp \
|
||||
./../../include/asio \
|
||||
./../../include/asio/impl \
|
||||
./../../include/asio/ip \
|
||||
./../../include/asio/ssl \
|
||||
./noncopyable_dox.txt \
|
||||
./std_exception_dox.txt
|
||||
FILE_PATTERNS =
|
||||
RECURSIVE = NO
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = YES
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 1
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = NO
|
||||
HTML_OUTPUT = .
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = YES
|
||||
ENUM_VALUES_PER_LINE = 1
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = YES
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = YES
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = GENERATING_DOCUMENTATION \
|
||||
ASIO_SOCKET_ERROR(e)=implementation_defined \
|
||||
ASIO_NETDB_ERROR(e)=implementation_defined \
|
||||
ASIO_EOF_ERROR(e)=implementation_defined \
|
||||
ASIO_OS_ERROR(e1,e2)=implementation_defined
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = NO
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = YES
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = NO
|
||||
GROUP_GRAPHS = NO
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = YES
|
||||
INCLUDE_GRAPH = NO
|
||||
INCLUDED_BY_GRAPH = NO
|
||||
CALL_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = NO
|
||||
DIRECTORY_GRAPH = NO
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 640
|
||||
MAX_DOT_GRAPH_HEIGHT = 640
|
||||
MAX_DOT_GRAPH_DEPTH = 0
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = NO
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
File diff suppressed because it is too large
Load Diff
41027
asio/src/doc/reference.qbk
Normal file
41027
asio/src/doc/reference.qbk
Normal file
File diff suppressed because it is too large
Load Diff
991
asio/src/doc/reference.xsl
Normal file
991
asio/src/doc/reference.xsl
Normal file
@ -0,0 +1,991 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<!--
|
||||
Copyright (c) 2003-2007 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)
|
||||
-->
|
||||
|
||||
<xsl:output method="text"/>
|
||||
<xsl:strip-space elements="*"/>
|
||||
|
||||
|
||||
<xsl:variable name="newline">
|
||||
<xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:variable>
|
||||
|
||||
|
||||
<!--
|
||||
Loop over all top-level documentation elements (i.e. classes, functions,
|
||||
variables and typedefs at namespace scope). The elements are sorted by name.
|
||||
Anything in a "detail" namespace or with "_handler" in the name is skipped.
|
||||
-->
|
||||
<xsl:template match="/doxygen">
|
||||
<xsl:text>[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:reference Reference]
|
||||
|
||||
[xinclude quickref.xml]
|
||||
|
||||
[include requirements/asynchronous_operations.qbk]
|
||||
[include requirements/AcceptHandler.qbk]
|
||||
[include requirements/AsyncReadStream.qbk]
|
||||
[include requirements/AsyncWriteStream.qbk]
|
||||
[include requirements/CompletionHandler.qbk]
|
||||
[include requirements/ConnectHandler.qbk]
|
||||
[include requirements/ConstBufferSequence.qbk]
|
||||
[include requirements/ConvertibleToConstBuffer.qbk]
|
||||
[include requirements/ConvertibleToMutableBuffer.qbk]
|
||||
[include requirements/DatagramSocketService.qbk]
|
||||
[include requirements/Endpoint.qbk]
|
||||
[include requirements/GettableSocketOption.qbk]
|
||||
[include requirements/Handler.qbk]
|
||||
[include requirements/InternetProtocol.qbk]
|
||||
[include requirements/IoControlCommand.qbk]
|
||||
[include requirements/IoObjectService.qbk]
|
||||
[include requirements/MutableBufferSequence.qbk]
|
||||
[include requirements/Protocol.qbk]
|
||||
[include requirements/ReadHandler.qbk]
|
||||
[include requirements/ResolveHandler.qbk]
|
||||
[include requirements/ResolverService.qbk]
|
||||
[include requirements/Service.qbk]
|
||||
[include requirements/SettableSocketOption.qbk]
|
||||
[include requirements/SocketAcceptorService.qbk]
|
||||
[include requirements/SocketService.qbk]
|
||||
[include requirements/StreamSocketService.qbk]
|
||||
[include requirements/SyncReadStream.qbk]
|
||||
[include requirements/SyncWriteStream.qbk]
|
||||
[include requirements/TimeTraits.qbk]
|
||||
[include requirements/TimerService.qbk]
|
||||
[include requirements/WaitHandler.qbk]
|
||||
[include requirements/WriteHandler.qbk]
|
||||
|
||||
</xsl:text>
|
||||
|
||||
<xsl:for-each select="
|
||||
compounddef[@kind = 'class' or @kind = 'struct'] |
|
||||
compounddef[@kind = 'namespace']/sectiondef[1]/memberdef">
|
||||
<xsl:sort select="concat((. | ancestor::*)/compoundname, '::', name, ':x')"/>
|
||||
<xsl:sort select="name"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@kind='class' or @kind='struct'">
|
||||
<xsl:if test="
|
||||
contains(compoundname, 'asio::') and
|
||||
not(contains(compoundname, '::detail')) and
|
||||
not(contains(compoundname, '_handler'))">
|
||||
<xsl:call-template name="class"/>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="not(contains(ancestor::*/compoundname, '::detail'))">
|
||||
<xsl:call-template name="namespace-memberdef"/>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:text>[endsect]</xsl:text>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!--========== Utilities ==========-->
|
||||
|
||||
<xsl:template name="strip-asio-ns">
|
||||
<xsl:param name="name"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($name, 'asio::')">
|
||||
<xsl:value-of select="substring-after($name, 'asio::')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$name"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="strip-ns">
|
||||
<xsl:param name="name"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($name, '::') and contains($name, '<')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(substring-before($name, '::')) < string-length(substring-before($name, '<'))">
|
||||
<xsl:call-template name="strip-ns">
|
||||
<xsl:with-param name="name" select="substring-after($name, '::')"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$name"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($name, '::')">
|
||||
<xsl:call-template name="strip-ns">
|
||||
<xsl:with-param name="name" select="substring-after($name, '::')"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$name"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="make-id">
|
||||
<xsl:param name="name"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($name, '::')">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name"
|
||||
select="concat(substring-before($name, '::'), '__', substring-after($name, '::'))"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($name, '=')">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name"
|
||||
select="concat(substring-before($name, '='), '_eq_', substring-after($name, '='))"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($name, '!')">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name"
|
||||
select="concat(substring-before($name, '!'), '_not_', substring-after($name, '!'))"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($name, '<')">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name"
|
||||
select="concat(substring-before($name, '<'), '_lt_', substring-after($name, '<'))"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($name, '>')">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name"
|
||||
select="concat(substring-before($name, '>'), '_gt_', substring-after($name, '>'))"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($name, '~')">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name"
|
||||
select="concat(substring-before($name, '~'), '_', substring-after($name, '~'))"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($name, ' ')">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name"
|
||||
select="concat(substring-before($name, ' '), '_', substring-after($name, ' '))"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($name, 'boost__posix_time__ptime')">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name"
|
||||
select="concat(substring-before($name, 'boost__posix_time__ptime'), 'ptime', substring-after($name, 'boost__posix_time__ptime'))"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$name"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!--========== Markup ==========-->
|
||||
|
||||
<xsl:template match="para" mode="markup">
|
||||
<xsl:text>
|
||||
</xsl:text><xsl:apply-templates mode="markup"/><xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="para" mode="markup-nested">
|
||||
<xsl:apply-templates mode="markup-nested"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="ref" mode="markup">
|
||||
<xsl:apply-templates mode="markup-nested"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="title" mode="markup">
|
||||
<xsl:variable name="title">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:variable>
|
||||
<xsl:if test="string-length($title) > 0">
|
||||
[heading <xsl:value-of select="."/>]
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="programlisting" mode="markup">
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:apply-templates mode="codeline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="programlisting" mode="markup-nested">
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:text>``</xsl:text>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:apply-templates mode="codeline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:text>``</xsl:text>
|
||||
<xsl:value-of select="$newline"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="codeline" mode="codeline">
|
||||
<xsl:if test="string-length(.) > 0">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates mode="codeline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="sp" mode="markup">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="sp" mode="markup-nested">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="sp" mode="codeline">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="linebreak" mode="markup">
|
||||
<xsl:text>
|
||||
|
||||
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="linebreak" mode="markup-nested">
|
||||
<xsl:text>
|
||||
|
||||
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="listitem" mode="markup">
|
||||
* <xsl:value-of select="."/><xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="emphasis" mode="markup">[*<xsl:value-of select="."/>] </xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="parameterlist" mode="markup">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@kind='param'">
|
||||
[heading Parameters]
|
||||
</xsl:when>
|
||||
<xsl:when test="@kind='exception'">
|
||||
[heading Exceptions]
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
[variablelist
|
||||
<xsl:apply-templates mode="markup"/>
|
||||
]
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="parameteritem" mode="markup">
|
||||
[[<xsl:value-of select="parameternamelist"/>][<xsl:apply-templates select="parameterdescription" mode="markup-nested"/>]]
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="simplesect" mode="markup">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@kind='return'">
|
||||
[heading Return Value]
|
||||
<xsl:apply-templates mode="markup"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@kind='see'">
|
||||
</xsl:when>
|
||||
<xsl:when test="@kind='note'">
|
||||
[heading Remarks]
|
||||
<xsl:apply-templates mode="markup"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@kind='par'">
|
||||
<xsl:if test="not(starts-with(title, 'Concepts:'))">
|
||||
<xsl:apply-templates mode="markup"/>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates mode="markup"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="text()" mode="markup">
|
||||
<xsl:variable name="text" select="."/>
|
||||
<xsl:variable name="starts-with-whitespace" select="
|
||||
starts-with($text, ' ') or starts-with($text, $newline)"/>
|
||||
<xsl:variable name="preceding-node-name">
|
||||
<xsl:for-each select="preceding-sibling::*">
|
||||
<xsl:if test="position() = last()">
|
||||
<xsl:value-of select="local-name()"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="after-newline" select="
|
||||
$preceding-node-name = 'programlisting' or
|
||||
$preceding-node-name = 'linebreak'"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$starts-with-whitespace and $after-newline">
|
||||
<xsl:call-template name="escape-text">
|
||||
<xsl:with-param name="text">
|
||||
<xsl:call-template name="strip-leading-whitespace">
|
||||
<xsl:with-param name="text" select="$text"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="escape-text">
|
||||
<xsl:with-param name="text" select="$text"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="text()" mode="markup-nested">
|
||||
<xsl:variable name="text" select="."/>
|
||||
<xsl:variable name="starts-with-whitespace" select="
|
||||
starts-with($text, ' ') or starts-with($text, $newline)"/>
|
||||
<xsl:variable name="preceding-node-name">
|
||||
<xsl:for-each select="preceding-sibling::*">
|
||||
<xsl:if test="position() = last()">
|
||||
<xsl:value-of select="local-name()"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="after-newline" select="
|
||||
$preceding-node-name = 'programlisting' or
|
||||
$preceding-node-name = 'linebreak'"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$starts-with-whitespace and $after-newline">
|
||||
<xsl:call-template name="escape-text">
|
||||
<xsl:with-param name="text">
|
||||
<xsl:call-template name="strip-leading-whitespace">
|
||||
<xsl:with-param name="text" select="$text"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="escape-text">
|
||||
<xsl:with-param name="text" select="$text"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="strip-leading-whitespace">
|
||||
<xsl:param name="text"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="starts-with($text, ' ')">
|
||||
<xsl:call-template name="strip-leading-whitespace">
|
||||
<xsl:with-param name="text" select="substring($text, 2)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="starts-with($text, $newline)">
|
||||
<xsl:call-template name="strip-leading-whitespace">
|
||||
<xsl:with-param name="text" select="substring($text, 2)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$text"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="escape-text">
|
||||
<xsl:param name="text"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($text, '_')">
|
||||
<xsl:value-of select="substring-before($text, '_')"/>
|
||||
<xsl:text>\_</xsl:text>
|
||||
<xsl:call-template name="escape-text">
|
||||
<xsl:with-param name="text" select="substring-after($text, '_')"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$text"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="ref[@kindref='compound']" mode="markup">
|
||||
<xsl:variable name="name">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($name, 'asio::')">
|
||||
<xsl:variable name="ref-name">
|
||||
<xsl:call-template name="strip-asio-ns">
|
||||
<xsl:with-param name="name" select="$name"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="ref-id">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name" select="$ref-name"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
[link asio.reference.<xsl:value-of select="$ref-id"/><xsl:text> </xsl:text><xsl:value-of
|
||||
select="$ref-name"/>]</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!--========== Class ==========-->
|
||||
|
||||
<xsl:template name="class">
|
||||
<xsl:variable name="class-name">
|
||||
<xsl:call-template name="strip-asio-ns">
|
||||
<xsl:with-param name="name" select="compoundname"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="unqualified-class-name">
|
||||
<xsl:call-template name="strip-ns">
|
||||
<xsl:with-param name="name" select="compoundname"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="class-id">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name" select="$class-name"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
[section:<xsl:value-of select="$class-id"/><xsl:text> </xsl:text><xsl:value-of select="$class-name"/>]
|
||||
|
||||
<xsl:value-of select="briefdescription"/><xsl:text>
|
||||
|
||||
</xsl:text>
|
||||
|
||||
<xsl:apply-templates select="templateparamlist"
|
||||
mode="class-detail"/><xsl:text> </xsl:text><xsl:value-of select="@kind"/><xsl:text> </xsl:text><xsl:value-of
|
||||
select="$unqualified-class-name"/><xsl:if test="count(basecompoundref[not(contains(.,'::detail'))]) > 0"> :</xsl:if><xsl:text>
|
||||
</xsl:text><xsl:for-each select="basecompoundref[not(contains(.,'::detail'))]">
|
||||
<xsl:text> </xsl:text><xsl:if test="@prot='public'">public </xsl:if><xsl:call-template
|
||||
name="strip-asio-ns"><xsl:with-param name="name" select="."/></xsl:call-template><xsl:if
|
||||
test="not(position() = last())">,</xsl:if><xsl:text>
|
||||
</xsl:text></xsl:for-each><xsl:text>
|
||||
</xsl:text>
|
||||
|
||||
<xsl:call-template name="class-tables">
|
||||
<xsl:with-param name="class-name" select="$class-name"/>
|
||||
<xsl:with-param name="class-id" select="$class-id"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:apply-templates select="detaileddescription" mode="markup"/>
|
||||
|
||||
<xsl:call-template name="class-members">
|
||||
<xsl:with-param name="class-name" select="$class-name"/>
|
||||
<xsl:with-param name="class-id" select="$class-id"/>
|
||||
</xsl:call-template>
|
||||
|
||||
[endsect]
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="class-tables">
|
||||
<xsl:param name="class-name"/>
|
||||
<xsl:param name="class-id"/>
|
||||
<xsl:if test="
|
||||
count(
|
||||
sectiondef[@kind='public-type'] |
|
||||
innerclass[@prot='public' and not(contains(., '_handler'))]) > 0">
|
||||
[heading Types]
|
||||
[table
|
||||
[[Name][Description]]
|
||||
<xsl:for-each select="
|
||||
sectiondef[@kind='public-type']/memberdef |
|
||||
innerclass[@prot='public' and not(contains(., '_handler'))]" mode="class-table">
|
||||
<xsl:sort select="concat(name, (.)[not(name)])"/>
|
||||
[
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(name) > 0">
|
||||
[[link asio.reference.<xsl:value-of select="$class-id"/>.<xsl:value-of select="name"/>
|
||||
<xsl:text> </xsl:text>[*<xsl:value-of select="name"/>]]]
|
||||
[<xsl:value-of select="briefdescription"/>]
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:variable name="type-name">
|
||||
<xsl:call-template name="strip-asio-ns">
|
||||
<xsl:with-param name="name" select="."/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="unqualified-type-name">
|
||||
<xsl:call-template name="strip-ns">
|
||||
<xsl:with-param name="name" select="."/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="type-id">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name" select="$type-name"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="type-ref-id" select="@refid"/>
|
||||
[[link asio.reference.<xsl:value-of select="$type-id"/>
|
||||
<xsl:text> </xsl:text>[*<xsl:value-of select="$unqualified-type-name"/>]]]
|
||||
[<xsl:value-of select="(/doxygen//compounddef[@id=$type-ref-id])[1]/briefdescription"/>]
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
]
|
||||
</xsl:for-each>
|
||||
]
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="count(sectiondef[@kind='public-func' or @kind='public-static-func']) > 0">
|
||||
[heading Member Functions]
|
||||
[table
|
||||
[[Name][Description]]
|
||||
<xsl:for-each select="sectiondef[@kind='public-func' or @kind='public-static-func']/memberdef" mode="class-table">
|
||||
<xsl:sort select="name"/>
|
||||
<xsl:variable name="name">
|
||||
<xsl:value-of select="name"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="id">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name" select="$name"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="doxygen-id">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="overload-position">
|
||||
<xsl:for-each select="../memberdef[name = $name]">
|
||||
<xsl:if test="@id = $doxygen-id">
|
||||
<xsl:value-of select="position()"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:if test="$overload-position = 1">
|
||||
[
|
||||
[[link asio.reference.<xsl:value-of select="$class-id"/>.<xsl:value-of select="$id"/>
|
||||
<xsl:text> </xsl:text>[*<xsl:value-of select="$name"/>]]]
|
||||
[<xsl:value-of select="briefdescription"/>]
|
||||
]
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
]
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="count(sectiondef[@kind='friend']/memberdef[not(type = 'friend class')]) > 0">
|
||||
[heading Friends]
|
||||
[table
|
||||
[[Name][Description]]
|
||||
<xsl:for-each select="sectiondef[@kind='friend']/memberdef[not(type = 'friend class')]" mode="class-table">
|
||||
<xsl:sort select="name"/>
|
||||
<xsl:variable name="name">
|
||||
<xsl:value-of select="name"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="id">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name" select="$name"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="doxygen-id">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="overload-position">
|
||||
<xsl:for-each select="../memberdef[name = $name]">
|
||||
<xsl:if test="@id = $doxygen-id">
|
||||
<xsl:value-of select="position()"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:if test="$overload-position = 1">
|
||||
[
|
||||
[[link asio.reference.<xsl:value-of select="$class-id"/>.<xsl:value-of select="$id"/>
|
||||
<xsl:text> </xsl:text>[*<xsl:value-of select="$name"/>]]]
|
||||
[<xsl:value-of select="briefdescription"/>]
|
||||
]
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
]
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="count(sectiondef[@kind='public-attrib' or @kind='public-static-attrib']) > 0">
|
||||
[heading Data Members]
|
||||
[table
|
||||
[[Name][Description]]
|
||||
<xsl:for-each select="sectiondef[@kind='public-attrib' or @kind='public-static-attrib']/memberdef" mode="class-table">
|
||||
<xsl:sort select="name"/>
|
||||
[
|
||||
[[link asio.reference.<xsl:value-of select="$class-id"/>.<xsl:value-of select="name"/>
|
||||
<xsl:text> </xsl:text>[*<xsl:value-of select="name"/>]]]
|
||||
[<xsl:value-of select="briefdescription"/>]
|
||||
]
|
||||
</xsl:for-each>
|
||||
]
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="class-members">
|
||||
<xsl:param name="class-name"/>
|
||||
<xsl:param name="class-id"/>
|
||||
<xsl:apply-templates select="sectiondef[@kind='public-type' or @kind='public-func' or @kind='public-static-func' or @kind='public-attrib' or @kind='public-static-attrib' or @kind='friend']/memberdef[not(type = 'friend class')]" mode="class-detail">
|
||||
<xsl:sort select="name"/>
|
||||
<xsl:with-param name="class-name" select="$class-name"/>
|
||||
<xsl:with-param name="class-id" select="$class-id"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Class detail -->
|
||||
|
||||
<xsl:template match="memberdef" mode="class-detail">
|
||||
<xsl:param name="class-name"/>
|
||||
<xsl:param name="class-id"/>
|
||||
<xsl:variable name="name">
|
||||
<xsl:value-of select="name"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="id">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name" select="$name"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="doxygen-id">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="overload-count">
|
||||
<xsl:value-of select="count(../memberdef[name = $name])"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="overload-position">
|
||||
<xsl:for-each select="../memberdef[name = $name]">
|
||||
<xsl:if test="@id = $doxygen-id">
|
||||
<xsl:value-of select="position()"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:if test="$overload-count > 1 and $overload-position = 1">
|
||||
[section:<xsl:value-of select="$id"/><xsl:text> </xsl:text>
|
||||
<xsl:value-of select="$class-name"/>::<xsl:value-of select="$name"/>]
|
||||
|
||||
<xsl:value-of select="briefdescription"/><xsl:text>
|
||||
</xsl:text>
|
||||
|
||||
<xsl:for-each select="../memberdef[name = $name]">
|
||||
<xsl:text>
|
||||
</xsl:text><xsl:apply-templates select="templateparamlist" mode="class-detail"/>
|
||||
<xsl:text> </xsl:text><xsl:if test="@static='yes'">static </xsl:if><xsl:if
|
||||
test="string-length(type) > 0"><xsl:value-of select="type"/><xsl:text> </xsl:text>
|
||||
</xsl:if>``[link asio.reference.<xsl:value-of select="$class-id"/>.<xsl:value-of
|
||||
select="$id"/>.overload<xsl:value-of select="position()"/><xsl:text> </xsl:text><xsl:value-of
|
||||
select="name"/>]``(<xsl:apply-templates select="param"
|
||||
mode="class-detail"/>)<xsl:if test="@const='yes'"> const</xsl:if>;
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
|
||||
[section:<xsl:if test="$overload-count = 1"><xsl:value-of select="$id"/></xsl:if>
|
||||
<xsl:if test="$overload-count > 1">overload<xsl:value-of select="$overload-position"/></xsl:if>
|
||||
<xsl:text> </xsl:text><xsl:value-of select="$class-name"/>::<xsl:value-of select="$name"/>
|
||||
<xsl:if test="$overload-count > 1"> (<xsl:value-of
|
||||
select="$overload-position"/> of <xsl:value-of select="$overload-count"/> overloads)</xsl:if>]
|
||||
|
||||
<xsl:if test="not(starts-with($doxygen-id, ../../@id))">
|
||||
<xsl:variable name="inherited-from" select="/doxygen/compounddef[starts-with($doxygen-id, @id)]/compoundname"/>
|
||||
<xsl:if test="not(contains($inherited-from, '::detail'))">
|
||||
['Inherited from <xsl:call-template name="strip-asio-ns">
|
||||
<xsl:with-param name="name" select="$inherited-from"/>
|
||||
</xsl:call-template>.]<xsl:text>
|
||||
|
||||
</xsl:text></xsl:if></xsl:if>
|
||||
|
||||
<xsl:value-of select="briefdescription"/><xsl:text>
|
||||
</xsl:text>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="@kind='typedef'">
|
||||
<xsl:call-template name="typedef" mode="class-detail">
|
||||
<xsl:with-param name="class-name" select="$class-name"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="@kind='variable'">
|
||||
<xsl:call-template name="variable" mode="class-detail"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@kind='enum'">
|
||||
<xsl:call-template name="enum" mode="class-detail"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@kind='function'">
|
||||
<xsl:call-template name="function" mode="class-detail"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@kind='friend'">
|
||||
<xsl:call-template name="function" mode="class-detail"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:text>
|
||||
</xsl:text><xsl:apply-templates select="detaileddescription" mode="markup"/>
|
||||
|
||||
[endsect]
|
||||
|
||||
<xsl:if test="$overload-count > 1 and $overload-position = $overload-count">
|
||||
[endsect]
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="typedef">
|
||||
<xsl:param name="class-name"/>
|
||||
<xsl:text>
|
||||
</xsl:text>typedef <xsl:value-of select="type"/><xsl:text> </xsl:text><xsl:value-of select="name"/>;<xsl:text>
|
||||
|
||||
</xsl:text>
|
||||
<xsl:if test="count(type/ref) > 0 and not(contains(type, '*'))">
|
||||
<xsl:variable name="class-refid">
|
||||
<xsl:for-each select="type/ref[1]">
|
||||
<xsl:value-of select="@refid"/>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="name" select="name"/>
|
||||
<xsl:for-each select="/doxygen/compounddef[@id=$class-refid]">
|
||||
<xsl:call-template name="class-tables">
|
||||
<xsl:with-param name="class-name">
|
||||
<xsl:value-of select="concat($class-name, '::', $name)"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="class-id">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name">
|
||||
<xsl:call-template name="strip-asio-ns">
|
||||
<xsl:with-param name="name" select="compoundname"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates select="detaileddescription" mode="markup"/>
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="variable">
|
||||
<xsl:text>
|
||||
</xsl:text><xsl:if test="@static='yes'">static </xsl:if><xsl:value-of
|
||||
select="type"/><xsl:text> </xsl:text><xsl:value-of select="name"/>;
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="enum">
|
||||
enum <xsl:value-of select="name"/>
|
||||
|
||||
[heading Values]
|
||||
[variablelist
|
||||
<xsl:for-each select="enumvalue">
|
||||
[
|
||||
[<xsl:value-of select="name"/>]
|
||||
[<xsl:value-of select="briefdescription"/>]
|
||||
]
|
||||
</xsl:for-each>
|
||||
]
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="function">
|
||||
<xsl:text>
|
||||
</xsl:text><xsl:apply-templates select="templateparamlist" mode="class-detail"/>
|
||||
<xsl:text> </xsl:text><xsl:if test="@static='yes'">static </xsl:if><xsl:if
|
||||
test="string-length(type) > 0"><xsl:value-of select="type"/><xsl:text> </xsl:text></xsl:if>
|
||||
<xsl:value-of select="name"/>(<xsl:apply-templates select="param"
|
||||
mode="class-detail"/>)<xsl:if test="@const='yes'"> const</xsl:if>;
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="templateparamlist" mode="class-detail">
|
||||
<xsl:text> </xsl:text>template<<xsl:apply-templates select="param" mode="class-detail-template"/>>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="param" mode="class-detail-template">
|
||||
<xsl:text>
|
||||
</xsl:text><xsl:value-of select="type"/><xsl:text> </xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="declname = 'Allocator'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'Arg'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'CompletionCondition'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'Context_Service'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'Function'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'HandshakeHandler'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'N'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'PasswordCallback'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'PodType'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'ShutdownHandler'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'Stream'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'T'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'T1'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'TN'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="declname = 'Time'">
|
||||
<xsl:value-of select="declname"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="count(declname) = 0">
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat('``[link asio.reference.', declname, ' ', declname, ']``')"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="count(defval) > 0"> = <xsl:value-of
|
||||
select="defval"/></xsl:if><xsl:if test="not(position() = last())">,</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="param" mode="class-detail">
|
||||
<xsl:text>
|
||||
</xsl:text><xsl:value-of select="type"/><xsl:text> </xsl:text><xsl:value-of
|
||||
select="declname"/><xsl:if test="count(defval) > 0"> = <xsl:value-of
|
||||
select="defval"/></xsl:if><xsl:if test="not(position() = last())">,</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="*" mode="class-detail"/>
|
||||
|
||||
|
||||
<!--========== Namespace ==========-->
|
||||
|
||||
<xsl:template name="namespace-memberdef">
|
||||
<xsl:variable name="name">
|
||||
<xsl:call-template name="strip-asio-ns">
|
||||
<xsl:with-param name="name" select="concat(../../compoundname, '::', name)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="unqualified-name">
|
||||
<xsl:call-template name="strip-ns">
|
||||
<xsl:with-param name="name" select="$name"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="id">
|
||||
<xsl:call-template name="make-id">
|
||||
<xsl:with-param name="name" select="$name"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="doxygen-id">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="overload-count">
|
||||
<xsl:value-of select="count(../memberdef[name = $unqualified-name])"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="overload-position">
|
||||
<xsl:for-each select="../memberdef[name = $unqualified-name]">
|
||||
<xsl:if test="@id = $doxygen-id">
|
||||
<xsl:value-of select="position()"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:if test="$overload-count > 1 and $overload-position = 1">
|
||||
[section:<xsl:value-of select="$id"/><xsl:text> </xsl:text><xsl:value-of select="$name"/>]
|
||||
|
||||
<xsl:value-of select="briefdescription"/><xsl:text>
|
||||
</xsl:text>
|
||||
|
||||
<xsl:for-each select="../memberdef[name = $unqualified-name]">
|
||||
<xsl:text>
|
||||
</xsl:text><xsl:apply-templates select="templateparamlist" mode="class-detail"/>
|
||||
<xsl:text> </xsl:text><xsl:if test="string-length(type) > 0"><xsl:value-of
|
||||
select="type"/><xsl:text> </xsl:text></xsl:if>``[link asio.reference.<xsl:value-of
|
||||
select="$id"/>.overload<xsl:value-of select="position()"/><xsl:text> </xsl:text>
|
||||
<xsl:value-of select="name"/>]``(<xsl:apply-templates select="param" mode="class-detail"/>);
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="/doxygen/compounddef[@kind='group' and compoundname=$name]">
|
||||
<xsl:apply-templates select="detaileddescription" mode="markup"/>
|
||||
</xsl:for-each>
|
||||
|
||||
</xsl:if>
|
||||
|
||||
[section:<xsl:if test="$overload-count = 1"><xsl:value-of select="$id"/></xsl:if>
|
||||
<xsl:if test="$overload-count > 1">overload<xsl:value-of select="$overload-position"/>
|
||||
</xsl:if><xsl:text> </xsl:text><xsl:value-of select="$name"/>
|
||||
<xsl:if test="$overload-count > 1"> (<xsl:value-of
|
||||
select="$overload-position"/> of <xsl:value-of select="$overload-count"/> overloads)</xsl:if>]
|
||||
|
||||
<xsl:value-of select="briefdescription"/><xsl:text>
|
||||
</xsl:text>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="@kind='typedef'">
|
||||
<xsl:call-template name="typedef">
|
||||
<xsl:with-param name="class-name" select="$name"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="@kind='variable'">
|
||||
<xsl:call-template name="variable"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@kind='enum'">
|
||||
<xsl:call-template name="enum"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@kind='function'">
|
||||
<xsl:call-template name="function"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:text>
|
||||
</xsl:text><xsl:apply-templates select="detaileddescription" mode="markup"/>
|
||||
|
||||
[endsect]
|
||||
|
||||
<xsl:if test="$overload-count > 1 and $overload-position = $overload-count">
|
||||
[endsect]
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
@ -1,160 +0,0 @@
|
||||
/**
|
||||
\namespace asio
|
||||
\brief The asio namespace defines all user-accessible classes and templates.
|
||||
*/
|
||||
|
||||
/**
|
||||
\namespace asio::ip
|
||||
\brief The asio::ip namespace defines the classes associated with IP.
|
||||
*/
|
||||
|
||||
/**
|
||||
\namespace asio::ip::multicast
|
||||
\brief The asio::ip::multicast namespace defines the socket options used for
|
||||
multicast.
|
||||
*/
|
||||
|
||||
/**
|
||||
\namespace asio::ip::unicast
|
||||
\brief The asio::ip::unicast namespace defines the socket options used for
|
||||
unicast.
|
||||
*/
|
||||
|
||||
/**
|
||||
\namespace asio::placeholders
|
||||
\brief The asio::placeholders namespace defines argument placeholders for use
|
||||
with \ref boost_bind.
|
||||
*/
|
||||
|
||||
/**
|
||||
\namespace asio::ssl
|
||||
\brief The asio::ssl namespace defines templates and classes for SSL.
|
||||
*/
|
||||
|
||||
/**
|
||||
\page boost_bind boost::bind
|
||||
See the <a href="http://www.boost.org/libs/bind/bind.html">Boost: bind.hpp
|
||||
documentation</a> for more information on how to use <tt>boost::bind</tt>.
|
||||
*/
|
||||
|
||||
/**
|
||||
\page noncopyable noncopyable
|
||||
Prevents copy construction and assignment.
|
||||
*/
|
||||
|
||||
/**
|
||||
\page stdexception std::exception
|
||||
Standard exception class.
|
||||
*/
|
||||
|
||||
/**
|
||||
\mainpage asio Reference
|
||||
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD VALIGN="TOP">
|
||||
|
||||
<H2>Namespaces</H2>
|
||||
|
||||
\li ::asio
|
||||
\li asio::ip
|
||||
\li asio::ip::multicast
|
||||
\li asio::ip::unicast
|
||||
\li asio::placeholders
|
||||
\li asio::ssl
|
||||
|
||||
<H2>Classes</H2>
|
||||
|
||||
\li asio::const_buffer
|
||||
\li asio::const_buffers_1
|
||||
\li asio::deadline_timer
|
||||
\li asio::error
|
||||
\li asio::error_code
|
||||
\li asio::io_service
|
||||
\li asio::io_service::id
|
||||
\li asio::io_service::service
|
||||
\li asio::io_service::strand
|
||||
\li asio::io_service::work
|
||||
\li asio::ip::address
|
||||
\li asio::ip::address_v4
|
||||
\li asio::ip::address_v6
|
||||
\li asio::ip::resolver_query_base
|
||||
\li asio::ip::resolver_service
|
||||
\li asio::ip::tcp
|
||||
\li asio::ip::tcp::acceptor
|
||||
\li asio::ip::tcp::endpoint
|
||||
\li asio::ip::tcp::iostream
|
||||
\li asio::ip::tcp::resolver
|
||||
\li asio::ip::tcp::socket
|
||||
\li asio::ip::udp
|
||||
\li asio::ip::udp::endpoint
|
||||
\li asio::ip::udp::resolver
|
||||
\li asio::ip::udp::socket
|
||||
\li asio::mutable_buffer
|
||||
\li asio::mutable_buffers_1
|
||||
\li asio::socket_base
|
||||
\li asio::ssl::context
|
||||
\li asio::ssl::context_base
|
||||
\li asio::ssl::stream_base
|
||||
\li asio::strand
|
||||
\li asio::streambuf
|
||||
\li asio::system_error
|
||||
\li asio::thread
|
||||
|
||||
</TD>
|
||||
<TD VALIGN="TOP">
|
||||
|
||||
<H2>Free Functions</H2>
|
||||
\li \ref buffer
|
||||
\li \ref read
|
||||
\li \ref async_read
|
||||
\li \ref read_until
|
||||
\li \ref async_read_until
|
||||
\li \ref write
|
||||
\li \ref async_write
|
||||
\li \ref asio::ip::host_name
|
||||
\li \ref asio::add_service
|
||||
\li \ref asio::has_service
|
||||
\li \ref asio::use_service
|
||||
\li \ref asio::transfer_all
|
||||
\li \ref asio::transfer_at_least
|
||||
|
||||
<H2>Class Templates</H2>
|
||||
|
||||
\li asio::basic_datagram_socket
|
||||
\li asio::basic_deadline_timer
|
||||
\li asio::basic_socket_acceptor
|
||||
\li asio::basic_socket_iostream
|
||||
\li asio::basic_socket_streambuf
|
||||
\li asio::basic_stream_socket
|
||||
\li asio::basic_streambuf
|
||||
\li asio::buffered_read_stream
|
||||
\li asio::buffered_write_stream
|
||||
\li asio::buffered_stream
|
||||
\li asio::ip::basic_endpoint
|
||||
\li asio::ip::basic_resolver
|
||||
\li asio::ip::basic_resolver_entry
|
||||
\li asio::ip::basic_resolver_iterator
|
||||
\li asio::ip::basic_resolver_query
|
||||
\li asio::ssl::basic_context
|
||||
\li asio::ssl::stream
|
||||
|
||||
<H2>Type Traits</H2>
|
||||
|
||||
\li asio::is_read_buffered
|
||||
\li asio::is_write_buffered
|
||||
|
||||
<H2>Services</H2>
|
||||
|
||||
\li asio::datagram_socket_service
|
||||
\li asio::deadline_timer_service
|
||||
\li asio::ip::resolver_service
|
||||
\li asio::socket_acceptor_service
|
||||
\li asio::ssl::context_service
|
||||
\li asio::ssl::stream_service
|
||||
\li asio::stream_socket_service
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
*/
|
@ -1,18 +0,0 @@
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>asio $projectnumber</B>
|
||||
</TD>
|
||||
<TD ALIGN="RIGHT">
|
||||
<A CLASS="qindex" HREF="../index.html">Home</A> |
|
||||
<A CLASS="qindex" HREF="../reference/index.html">Reference</A> |
|
||||
<A CLASS="qindex" HREF="../tutorial/index.html">Tutorial</A> |
|
||||
<A CLASS="qindex" HREF="../examples/index.html">Examples</A> |
|
||||
<A CLASS="qindex" HREF="../design/index.html">Design</A>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
@ -1,37 +0,0 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>$title</TITLE>
|
||||
<LINK HREF="asio.css" REL="stylesheet" TYPE="text/css">
|
||||
<LINK HREF="tabs.css" REL="stylesheet" TYPE="text/css">
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>asio $projectnumber</B>
|
||||
</TD>
|
||||
<TD ALIGN="RIGHT">
|
||||
<A CLASS="qindex" HREF="../index.html">Home</A> |
|
||||
<A CLASS="qindex" HREF="../reference/index.html">Reference</A> |
|
||||
<A CLASS="qindex" HREF="../tutorial/index.html">Tutorial</A> |
|
||||
<A CLASS="qindex" HREF="../examples/index.html">Examples</A> |
|
||||
<A CLASS="qindex" HREF="../design/index.html">Design</A>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>Reference</B>
|
||||
</TD>
|
||||
<TD ALIGN="RIGHT">
|
||||
<A CLASS="qindex" HREF="hierarchy.html">Class Hierarchy</A> |
|
||||
<A CLASS="qindex" HREF="classes.html">Class Index</A> |
|
||||
<A CLASS="qindex" HREF="functions.html">Member Index</A>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
180
asio/src/doc/requirements.qbk
Normal file
180
asio/src/doc/requirements.qbk
Normal file
@ -0,0 +1,180 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:requirements Type Requirements]
|
||||
|
||||
Throughout this documentation, the names of the template parameters are used to
|
||||
express type requirements, as listed in the table below.
|
||||
|
||||
[table Template parameters and type requirements
|
||||
[[Template Parameter Name][Type Requirements]]
|
||||
[
|
||||
[`AcceptHandler`]
|
||||
[[link asio.requirements.AcceptHandler accept handler]]
|
||||
]
|
||||
[
|
||||
[`AsyncReadStream`]
|
||||
[[link asio.requirements.AsyncReadStream buffer-oriented asynchronous
|
||||
read stream]]
|
||||
]
|
||||
[
|
||||
[`AsyncWriteStream`]
|
||||
[[link asio.requirements.AsyncWriteStream buffer-oriented asynchronous
|
||||
write stream]]
|
||||
]
|
||||
[
|
||||
[`CompletionHandler`]
|
||||
[[link asio.requirements.CompletionHandler completion handler]]
|
||||
]
|
||||
[
|
||||
[`ConnectHandler`]
|
||||
[[link asio.requirements.ConnectHandler connect handler]]
|
||||
]
|
||||
[
|
||||
[`ConstBufferSequence`]
|
||||
[[link asio.requirements.ConstBufferSequence constant buffer
|
||||
sequence]]
|
||||
]
|
||||
[
|
||||
[`ConvertibleToConstBuffer`]
|
||||
[[link asio.requirements.ConvertibleToConstBuffer convertible to a
|
||||
constant buffer]]
|
||||
]
|
||||
[
|
||||
[`ConvertibleToMutableBuffer`]
|
||||
[[link asio.requirements.ConvertibleToMutableBuffer convertible to a
|
||||
mutable buffer]]
|
||||
]
|
||||
[
|
||||
[`DatagramSocketService`]
|
||||
[[link asio.requirements.DatagramSocketService datagram socket
|
||||
service]]
|
||||
]
|
||||
[
|
||||
[`GettableSocketOption`]
|
||||
[[link asio.requirements.GettableSocketOption gettable socket option]]
|
||||
]
|
||||
[
|
||||
[`Handler`]
|
||||
[[link asio.requirements.Handler handler]]
|
||||
]
|
||||
[
|
||||
[`InternetProtocol`]
|
||||
[[link asio.requirements.InternetProtocol Internet protocol]]
|
||||
]
|
||||
[
|
||||
[`IoControlCommand`]
|
||||
[[link asio.requirements.IoControlCommand I/O control command]]
|
||||
]
|
||||
[
|
||||
[`IoObjectService`]
|
||||
[[link asio.requirements.IoObjectService I/O object service]]
|
||||
]
|
||||
[
|
||||
[`MutableBufferSequence`]
|
||||
[[link asio.requirements.MutableBufferSequence mutable buffer
|
||||
sequence]]
|
||||
]
|
||||
[
|
||||
[`Protocol`]
|
||||
[[link asio.requirements.Protocol protocol]]
|
||||
]
|
||||
[
|
||||
[`ReadHandler`]
|
||||
[[link asio.requirements.ReadHandler read handler]]
|
||||
]
|
||||
[
|
||||
[`ResolveHandler`]
|
||||
[[link asio.requirements.ResolveHandler resolve handler]]
|
||||
]
|
||||
[
|
||||
[`ResolverService`]
|
||||
[[link asio.requirements.ResolverService resolver service]]
|
||||
]
|
||||
[
|
||||
[`Service`]
|
||||
[[link asio.requirements.Service service]]
|
||||
]
|
||||
[
|
||||
[`SettableSocketOption`]
|
||||
[[link asio.requirements.SettableSocketOption settable socket option]]
|
||||
]
|
||||
[
|
||||
[`SocketAcceptorService`]
|
||||
[[link asio.requirements.SocketAcceptorService socket acceptor
|
||||
service]]
|
||||
]
|
||||
[
|
||||
[`SocketService`]
|
||||
[[link asio.requirements.SocketService socket service]]
|
||||
]
|
||||
[
|
||||
[`StreamSocketService`]
|
||||
[[link asio.requirements.StreamSocketService stream socket service]]
|
||||
]
|
||||
[
|
||||
[`SyncReadStream`]
|
||||
[[link asio.requirements.SyncReadStream buffer-oriented synchronous
|
||||
read stream]]
|
||||
]
|
||||
[
|
||||
[`SyncWriteStream`]
|
||||
[[link asio.requirements.SyncWriteStream buffer-oriented synchronous
|
||||
write stream]]
|
||||
]
|
||||
[
|
||||
[`TimerService`]
|
||||
[[link asio.requirements.TimerService timer service]]
|
||||
]
|
||||
[
|
||||
[`TimeTraits`]
|
||||
[[link asio.requirements.TimeTraits time traits]]
|
||||
]
|
||||
[
|
||||
[`WaitHandler`]
|
||||
[[link asio.requirements.WaitHandler wait handler]]
|
||||
]
|
||||
[
|
||||
[`WriteHandler`]
|
||||
[[link asio.requirements.WriteHandler write handler]]
|
||||
]
|
||||
]
|
||||
|
||||
[include requirements/asynchronous_operations.qbk]
|
||||
[include requirements/AcceptHandler.qbk]
|
||||
[include requirements/AsyncReadStream.qbk]
|
||||
[include requirements/AsyncWriteStream.qbk]
|
||||
[include requirements/CompletionHandler.qbk]
|
||||
[include requirements/ConnectHandler.qbk]
|
||||
[include requirements/ConstBufferSequence.qbk]
|
||||
[include requirements/ConvertibleToConstBuffer.qbk]
|
||||
[include requirements/ConvertibleToMutableBuffer.qbk]
|
||||
[include requirements/DatagramSocketService.qbk]
|
||||
[include requirements/Endpoint.qbk]
|
||||
[include requirements/GettableSocketOption.qbk]
|
||||
[include requirements/Handler.qbk]
|
||||
[include requirements/InternetProtocol.qbk]
|
||||
[include requirements/IoControlCommand.qbk]
|
||||
[include requirements/IoObjectService.qbk]
|
||||
[include requirements/MutableBufferSequence.qbk]
|
||||
[include requirements/Protocol.qbk]
|
||||
[include requirements/ReadHandler.qbk]
|
||||
[include requirements/ResolveHandler.qbk]
|
||||
[include requirements/ResolverService.qbk]
|
||||
[include requirements/Service.qbk]
|
||||
[include requirements/SettableSocketOption.qbk]
|
||||
[include requirements/SocketAcceptorService.qbk]
|
||||
[include requirements/SocketService.qbk]
|
||||
[include requirements/StreamSocketService.qbk]
|
||||
[include requirements/SyncReadStream.qbk]
|
||||
[include requirements/SyncWriteStream.qbk]
|
||||
[include requirements/TimeTraits.qbk]
|
||||
[include requirements/TimerService.qbk]
|
||||
[include requirements/WaitHandler.qbk]
|
||||
[include requirements/WriteHandler.qbk]
|
||||
|
||||
[endsect]
|
15
asio/src/doc/requirements/AcceptHandler.qbk
Normal file
15
asio/src/doc/requirements/AcceptHandler.qbk
Normal file
@ -0,0 +1,15 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:AcceptHandler Accept handler requirements]
|
||||
|
||||
An accept handler must meet the requirements for a [link
|
||||
asio.reference.Handler handler]. A value `h` of an accept handler
|
||||
class should work correctly in the expression `h(ec)`, where `ec` is an lvalue
|
||||
of type `const error_code`.
|
||||
|
||||
[endsect]
|
56
asio/src/doc/requirements/AsyncReadStream.qbk
Normal file
56
asio/src/doc/requirements/AsyncReadStream.qbk
Normal file
@ -0,0 +1,56 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:AsyncReadStream Buffer-oriented asynchronous read stream requirements]
|
||||
|
||||
In the table below, `a` denotes an asynchronous read stream object, `mb`
|
||||
denotes an object satisfying [link
|
||||
asio.reference.MutableBufferSequence mutable buffer sequence]
|
||||
requirements, and `h` denotes an object satisfying [link
|
||||
asio.reference.ReadHandler read handler] requirements.
|
||||
|
||||
[table Buffer-oriented asynchronous read stream requirements
|
||||
[[operation] [type] [semantics, pre/post-conditions]]
|
||||
[
|
||||
[`a.io_service();`]
|
||||
[`io_service&`]
|
||||
[Returns the `io_service` object through which the `async_read_some`
|
||||
handler `h` will be invoked.]
|
||||
]
|
||||
[
|
||||
[`a.async_read_some(mb, h);`]
|
||||
[`void`]
|
||||
[
|
||||
Initiates an asynchronous operation to read one or more bytes of data
|
||||
from the stream `a`. The operation is performed via the `io_service`
|
||||
object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n
|
||||
\n
|
||||
The mutable buffer sequence `mb` specifies memory where the data should
|
||||
be placed. The `async_read_some` operation shall always fill a buffer in
|
||||
the sequence completely before proceeding to the next.\n
|
||||
\n
|
||||
The implementation shall maintain one or more copies of `mb` until such
|
||||
time as the read operation no longer requires access to the memory
|
||||
specified by the buffers in the sequence. The program must ensure the
|
||||
memory is valid until:\n
|
||||
\n
|
||||
[mdash] the last copy of `mb` is destroyed, or\n
|
||||
\n
|
||||
[mdash] the handler for the asynchronous read operation is invoked,\n
|
||||
\n
|
||||
whichever comes first.\n
|
||||
\n
|
||||
If the total size of all buffers in the sequence `mb` is `0`, the
|
||||
asynchronous read operation shall complete immediately and pass `0` as
|
||||
the argument to the handler that specifies the number of bytes read.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
55
asio/src/doc/requirements/AsyncWriteStream.qbk
Normal file
55
asio/src/doc/requirements/AsyncWriteStream.qbk
Normal file
@ -0,0 +1,55 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:AsyncWriteStream Buffer-oriented asynchronous write stream requirements]
|
||||
|
||||
In the table below, `a` denotes an asynchronous write stream object, `cb`
|
||||
denotes an object satisfying [link asio.reference.ConstBufferSequence
|
||||
constant buffer sequence] requirements, and `h` denotes an object satisfying
|
||||
[link asio.reference.WriteHandler write handler] requirements.
|
||||
|
||||
[table Buffer-oriented asynchronous write stream requirements
|
||||
[[operation] [type] [semantics, pre/post-conditions]]
|
||||
[
|
||||
[`a.io_service();`]
|
||||
[`io_service&`]
|
||||
[Returns the `io_service` object through which the `async_write_some`
|
||||
handler `h` will be invoked.]
|
||||
]
|
||||
[
|
||||
[`a.async_write_some(cb, h);`]
|
||||
[`void`]
|
||||
[
|
||||
Initiates an asynchronous operation to write one or more bytes of data to
|
||||
the stream `a`. The operation is performed via the `io_service` object
|
||||
`a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n
|
||||
\n
|
||||
The constant buffer sequence `cb` specifies memory where the data to be
|
||||
written is located. The `async_write_some` operation shall always write a
|
||||
buffer in the sequence completely before proceeding to the next.\n
|
||||
\n
|
||||
The implementation shall maintain one or more copies of `cb` until such
|
||||
time as the write operation no longer requires access to the memory
|
||||
specified by the buffers in the sequence. The program must ensure the
|
||||
memory is valid until:\n
|
||||
\n
|
||||
[mdash] the last copy of `cb` is destroyed, or\n
|
||||
\n
|
||||
[mdash] the handler for the asynchronous write operation is invoked,\n
|
||||
\n
|
||||
whichever comes first.\n
|
||||
\n
|
||||
If the total size of all buffers in the sequence `cb` is `0`, the
|
||||
asynchronous write operation shall complete immediately and pass `0` as
|
||||
the argument to the handler that specifies the number of bytes written.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
14
asio/src/doc/requirements/CompletionHandler.qbk
Normal file
14
asio/src/doc/requirements/CompletionHandler.qbk
Normal file
@ -0,0 +1,14 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:CompletionHandler Completion handler requirements]
|
||||
|
||||
A completion handler must meet the requirements for a [link
|
||||
asio.reference.Handler handler]. A value `h` of a completion handler
|
||||
class should work correctly in the expression `h()`.
|
||||
|
||||
[endsect]
|
15
asio/src/doc/requirements/ConnectHandler.qbk
Normal file
15
asio/src/doc/requirements/ConnectHandler.qbk
Normal file
@ -0,0 +1,15 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:ConnectHandler Connect handler requirements]
|
||||
|
||||
A connect handler must meet the requirements for a [link
|
||||
asio.reference.Handler handler]. A value `h` of a connect handler
|
||||
class should work correctly in the expression `h(ec)`, where `ec` is an lvalue
|
||||
of type `const error_code`.
|
||||
|
||||
[endsect]
|
102
asio/src/doc/requirements/ConstBufferSequence.qbk
Normal file
102
asio/src/doc/requirements/ConstBufferSequence.qbk
Normal file
@ -0,0 +1,102 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:ConstBufferSequence Constant buffer sequence requirements]
|
||||
|
||||
In the table below, `X` denotes a class containing objects of type `T`, `a`
|
||||
denotes a value of type `X` and `u` denotes an identifier.
|
||||
|
||||
[table ConstBufferSequence requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`X::value_type`]
|
||||
[`T`]
|
||||
[`T` meets the requirements for [link
|
||||
asio.reference.ConvertibleToConstBuffer
|
||||
ConvertibleToConstBuffer].]
|
||||
]
|
||||
[
|
||||
[`X::const_iterator`]
|
||||
[iterator type pointing to `T`]
|
||||
[`const_iterator` meets the requirements for bidirectional iterators
|
||||
(C++ Std, 24.1.4).]
|
||||
]
|
||||
[
|
||||
[`X(a);`]
|
||||
[]
|
||||
[post: `equal_const_buffer_seq(a, X(a))` where the binary predicate
|
||||
`equal_const_buffer_seq` is defined as
|
||||
``
|
||||
bool equal_const_buffer_seq(
|
||||
const X& x1, const X& x2)
|
||||
{
|
||||
return
|
||||
distance(x1.begin(), x1.end())
|
||||
== distance(x2.begin(), x2.end())
|
||||
&& equal(x1.begin(), x1.end(),
|
||||
x2.begin(), equal_buffer);
|
||||
}
|
||||
``
|
||||
and the binary predicate `equal_buffer` is defined as
|
||||
``
|
||||
bool equal_buffer(
|
||||
const X::value_type& v1,
|
||||
const X::value_type& v2)
|
||||
{
|
||||
const_buffer b1(v1);
|
||||
const_buffer b2(v2);
|
||||
return
|
||||
buffer_cast<const void*>(b1)
|
||||
== buffer_cast<const void*>(b2)
|
||||
&& buffer_size(b1) == buffer_size(b2);
|
||||
}
|
||||
``]
|
||||
]
|
||||
[
|
||||
[`X u(a);`]
|
||||
[]
|
||||
[post:
|
||||
``
|
||||
distance(a.begin(), a.end())
|
||||
== distance(u.begin(), u.end())
|
||||
&& equal(a.begin(), a.end(),
|
||||
u.begin(), equal_buffer)
|
||||
``
|
||||
where the binary predicate `equal_buffer` is defined as
|
||||
``
|
||||
bool equal_buffer(
|
||||
const X::value_type& v1,
|
||||
const X::value_type& v2)
|
||||
{
|
||||
const_buffer b1(v1);
|
||||
const_buffer b2(v2);
|
||||
return
|
||||
buffer_cast<const void*>(b1)
|
||||
== buffer_cast<const void*>(b2)
|
||||
&& buffer_size(b1) == buffer_size(b2);
|
||||
}
|
||||
``]
|
||||
]
|
||||
[
|
||||
[`(&a)->~X();`]
|
||||
[`void`]
|
||||
[note: the destructor is applied to every element of `a`; all the memory
|
||||
is deallocated.]
|
||||
]
|
||||
[
|
||||
[`a.begin();`]
|
||||
[`const_iterator` or convertible to `const_iterator`]
|
||||
[]
|
||||
]
|
||||
[
|
||||
[`a.end();`]
|
||||
[`const_iterator` or convertible to `const_iterator`]
|
||||
[]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
96
asio/src/doc/requirements/ConvertibleToConstBuffer.qbk
Normal file
96
asio/src/doc/requirements/ConvertibleToConstBuffer.qbk
Normal file
@ -0,0 +1,96 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:ConvertibleToConstBuffer Convertible to const buffer requirements]
|
||||
|
||||
A type that meets the requirements for convertibility to a const buffer must
|
||||
meet the requirements of `CopyConstructible` types (C++ Std, 20.1.3), and the
|
||||
requirements of `Assignable` types (C++ Std, 23.1).
|
||||
|
||||
In the table below, `X` denotes a class meeting the requirements for
|
||||
convertibility to a const buffer, `a` and `b` denote values of type `X`, and
|
||||
`u`, `v` and `w` denote identifiers.
|
||||
|
||||
[table ConvertibleToConstBuffer requirements
|
||||
[[expression][postcondition]]
|
||||
[
|
||||
[``
|
||||
const_buffer u(a);
|
||||
const_buffer v(a);
|
||||
``]
|
||||
[``
|
||||
buffer_cast<const void*>(u) == buffer_cast<const void*>(v)
|
||||
&& buffer_size(u) == buffer_size(v)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const_buffer u(a);
|
||||
const_buffer v = a;
|
||||
``]
|
||||
[``
|
||||
buffer_cast<const void*>(u) == buffer_cast<const void*>(v)
|
||||
&& buffer_size(u) == buffer_size(v)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const_buffer u(a);
|
||||
const_buffer v; v = a;
|
||||
``]
|
||||
[``
|
||||
buffer_cast<const void*>(u) == buffer_cast<const void*>(v)
|
||||
&& buffer_size(u) == buffer_size(v)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const_buffer u(a);
|
||||
const X& v = a;
|
||||
const_buffer w(v);
|
||||
``]
|
||||
[``
|
||||
buffer_cast<const void*>(u) == buffer_cast<const void*>(w)
|
||||
&& buffer_size(u) == buffer_size(w)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const_buffer u(a);
|
||||
X v(a);
|
||||
const_buffer w(v);
|
||||
``]
|
||||
[``
|
||||
buffer_cast<const void*>(u) == buffer_cast<const void*>(w)
|
||||
&& buffer_size(u) == buffer_size(w)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const_buffer u(a);
|
||||
X v = a;
|
||||
const_buffer w(v);
|
||||
``]
|
||||
[``
|
||||
buffer_cast<const void*>(u) == buffer_cast<const void*>(w)
|
||||
&& buffer_size(u) == buffer_size(w)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const_buffer u(a);
|
||||
X v(b); v = a;
|
||||
const_buffer w(v);
|
||||
``]
|
||||
[``
|
||||
buffer_cast<const void*>(u) == buffer_cast<const void*>(w)
|
||||
&& buffer_size(u) == buffer_size(w)
|
||||
``]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
96
asio/src/doc/requirements/ConvertibleToMutableBuffer.qbk
Normal file
96
asio/src/doc/requirements/ConvertibleToMutableBuffer.qbk
Normal file
@ -0,0 +1,96 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:ConvertibleToMutableBuffer Convertible to mutable buffer requirements]
|
||||
|
||||
A type that meets the requirements for convertibility to a mutable buffer must
|
||||
meet the requirements of `CopyConstructible` types (C++ Std, 20.1.3), and the
|
||||
requirements of `Assignable` types (C++ Std, 23.1).
|
||||
|
||||
In the table below, `X` denotes a class meeting the requirements for
|
||||
convertibility to a mutable buffer, `a` and `b` denote values of type `X`, and
|
||||
`u`, `v` and `w` denote identifiers.
|
||||
|
||||
[table ConvertibleToMutableBuffer requirements
|
||||
[[expression][postcondition]]
|
||||
[
|
||||
[``
|
||||
mutable_buffer u(a);
|
||||
mutable_buffer v(a);
|
||||
``]
|
||||
[``
|
||||
buffer_cast<void*>(u) == buffer_cast<void*>(v)
|
||||
&& buffer_size(u) == buffer_size(v)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
mutable_buffer u(a);
|
||||
mutable_buffer v = a;
|
||||
``]
|
||||
[``
|
||||
buffer_cast<void*>(u) == buffer_cast<void*>(v)
|
||||
&& buffer_size(u) == buffer_size(v)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
mutable_buffer u(a);
|
||||
mutable_buffer v; v = a;
|
||||
``]
|
||||
[``
|
||||
buffer_cast<void*>(u) == buffer_cast<void*>(v)
|
||||
&& buffer_size(u) == buffer_size(v)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
mutable_buffer u(a);
|
||||
const X& v = a;
|
||||
mutable_buffer w(v);
|
||||
``]
|
||||
[``
|
||||
buffer_cast<void*>(u) == buffer_cast<void*>(w)
|
||||
&& buffer_size(u) == buffer_size(w)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
mutable_buffer u(a);
|
||||
X v(a);
|
||||
mutable_buffer w(v);
|
||||
``]
|
||||
[``
|
||||
buffer_cast<void*>(u) == buffer_cast<void*>(w)
|
||||
&& buffer_size(u) == buffer_size(w)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
mutable_buffer u(a);
|
||||
X v = a;
|
||||
mutable_buffer w(v);
|
||||
``]
|
||||
[``
|
||||
buffer_cast<void*>(u) == buffer_cast<void*>(w)
|
||||
&& buffer_size(u) == buffer_size(w)
|
||||
``]
|
||||
]
|
||||
[
|
||||
[``
|
||||
mutable_buffer u(a);
|
||||
X v(b); v = a;
|
||||
mutable_buffer w(v);
|
||||
``]
|
||||
[``
|
||||
buffer_cast<void*>(u) == buffer_cast<void*>(w)
|
||||
&& buffer_size(u) == buffer_size(w)
|
||||
``]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
227
asio/src/doc/requirements/DatagramSocketService.qbk
Normal file
227
asio/src/doc/requirements/DatagramSocketService.qbk
Normal file
@ -0,0 +1,227 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:DatagramSocketService Datagram socket service requirements]
|
||||
|
||||
A datagram socket service must meet the requirements for a [link
|
||||
asio.reference.SocketService socket service], as well as the
|
||||
additional requirements listed below.
|
||||
|
||||
In the table below, `X` denotes a datagram socket service class for protocol
|
||||
[link asio.reference.Protocol `Protocol`], `a` denotes a value of type
|
||||
`X`, `b` denotes a value of type `X::implementation_type`, `e` denotes a value
|
||||
of type `Protocol::endpoint`, `ec` denotes a value of type `error_code`, `f`
|
||||
denotes a value of type `socket_base::message_flags`, `mb` denotes a value
|
||||
satisfying [link asio.reference.MutableBufferSequence mutable buffer
|
||||
sequence] requirements, `rh` denotes a value meeting [link
|
||||
asio.reference.ReadHandler `ReadHandler`] requirements, `cb` denotes a
|
||||
value satisfying [link asio.reference.ConstBufferSequence constant
|
||||
buffer sequence] requirements, and `wh` denotes a value meeting [link
|
||||
asio.reference.WriteHandler `WriteHandler`] requirements.
|
||||
|
||||
[table DatagramSocketService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`a.receive(b, mb, f, ec);`]
|
||||
[`size_t`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Reads one or more bytes of data from a connected socket `b`.\n
|
||||
\n
|
||||
The mutable buffer sequence `mb` specifies memory where the data should
|
||||
be placed. The operation shall always fill a buffer in the sequence
|
||||
completely before proceeding to the next.\n
|
||||
\n
|
||||
If successful, returns the number of bytes read. Otherwise returns `0`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.async_receive(b, mb, f, rh);`]
|
||||
[`void`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Initiates an asynchronous operation to read one or more bytes of data
|
||||
from a connected socket `b`. The operation is performed via the
|
||||
`io_service` object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n
|
||||
\n
|
||||
The mutable buffer sequence `mb` specifies memory where the data should
|
||||
be placed. The operation shall always fill a buffer in the sequence
|
||||
completely before proceeding to the next.\n
|
||||
\n
|
||||
The implementation shall maintain one or more copies of `mb` until such
|
||||
time as the read operation no longer requires access to the memory
|
||||
specified by the buffers in the sequence. The program must ensure the
|
||||
memory is valid until:\n
|
||||
\n
|
||||
[mdash] the last copy of `mb` is destroyed, or\n
|
||||
\n
|
||||
[mdash] the handler for the asynchronous operation is invoked,\n
|
||||
\n
|
||||
whichever comes first.\n
|
||||
\n
|
||||
If the operation completes successfully, the `ReadHandler` object
|
||||
`rh` is invoked with the number of bytes transferred. Otherwise it is
|
||||
invoked with `0`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.receive_from(b, mb, e, f, ec);`]
|
||||
[`size_t`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Reads one or more bytes of data from an unconnected socket `b`.\n
|
||||
\n
|
||||
The mutable buffer sequence `mb` specifies memory where the data should
|
||||
be placed. The operation shall always fill a buffer in the sequence
|
||||
completely before proceeding to the next.\n
|
||||
\n
|
||||
If successful, returns the number of bytes read. Otherwise returns `0`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.async_receive_from(b, mb, e, f, rh);`]
|
||||
[`void`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Initiates an asynchronous operation to read one or more bytes of data
|
||||
from an unconnected socket `b`. The operation is performed via the
|
||||
`io_service` object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n
|
||||
\n
|
||||
The mutable buffer sequence `mb` specifies memory where the data should
|
||||
be placed. The operation shall always fill a buffer in the sequence
|
||||
completely before proceeding to the next.\n
|
||||
\n
|
||||
The implementation shall maintain one or more copies of `mb` until such
|
||||
time as the read operation no longer requires access to the memory
|
||||
specified by the buffers in the sequence. The program must ensure the
|
||||
memory is valid until:\n
|
||||
\n
|
||||
[mdash] the last copy of `mb` is destroyed, or\n
|
||||
\n
|
||||
[mdash] the handler for the asynchronous operation is invoked,\n
|
||||
\n
|
||||
whichever comes first.\n
|
||||
\n
|
||||
The program must ensure the object `e` is valid until the handler
|
||||
for the asynchronous operation is invoked.\n
|
||||
\n
|
||||
If the operation completes successfully, the `ReadHandler` object
|
||||
`rh` is invoked with the number of bytes transferred. Otherwise it is
|
||||
invoked with `0`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.send(b, cb, f, ec);`]
|
||||
[`size_t`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Writes one or more bytes of data to a connected socket `b`.\n
|
||||
\n
|
||||
The constant buffer sequence `cb` specifies memory where the data to be
|
||||
written is located. The operation shall always write a buffer in the
|
||||
sequence completely before proceeding to the next.\n
|
||||
\n
|
||||
If successful, returns the number of bytes written. Otherwise returns `0`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.async_send(b, cb, f, wh);`]
|
||||
[`void`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Initiates an asynchronous operation to write one or more bytes of data to
|
||||
a connected socket `b`. The operation is performed via the `io_service`
|
||||
object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n
|
||||
\n
|
||||
The constant buffer sequence `cb` specifies memory where the data to be
|
||||
written is located. The operation shall always write a buffer in the
|
||||
sequence completely before proceeding to the next.\n
|
||||
\n
|
||||
The implementation shall maintain one or more copies of `cb` until such
|
||||
time as the write operation no longer requires access to the memory
|
||||
specified by the buffers in the sequence. The program must ensure the
|
||||
memory is valid until:\n
|
||||
\n
|
||||
[mdash] the last copy of `cb` is destroyed, or\n
|
||||
\n
|
||||
[mdash] the handler for the asynchronous operation is invoked,\n
|
||||
\n
|
||||
whichever comes first.\n
|
||||
\n
|
||||
If the operation completes successfully, the `WriteHandler` object `wh`
|
||||
is invoked with the number of bytes transferred. Otherwise it is invoked
|
||||
with `0`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const typename Protocol::endpoint& u = e;
|
||||
a.send_to(b, cb, u, f, ec);
|
||||
``]
|
||||
[`size_t`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Writes one or more bytes of data to an unconnected socket `b`.\n
|
||||
\n
|
||||
The constant buffer sequence `cb` specifies memory where the data to be
|
||||
written is located. The operation shall always write a buffer in the
|
||||
sequence completely before proceeding to the next.\n
|
||||
\n
|
||||
If successful, returns the number of bytes written. Otherwise returns `0`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const typename Protocol::endpoint& u = e;
|
||||
a.async_send(b, cb, u, f, wh);
|
||||
``]
|
||||
[`void`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Initiates an asynchronous operation to write one or more bytes of data to
|
||||
an unconnected socket `b`. The operation is performed via the `io_service`
|
||||
object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n
|
||||
\n
|
||||
The constant buffer sequence `cb` specifies memory where the data to be
|
||||
written is located. The operation shall always write a buffer in the
|
||||
sequence completely before proceeding to the next.\n
|
||||
\n
|
||||
The implementation shall maintain one or more copies of `cb` until such
|
||||
time as the write operation no longer requires access to the memory
|
||||
specified by the buffers in the sequence. The program must ensure the
|
||||
memory is valid until:\n
|
||||
\n
|
||||
[mdash] the last copy of `cb` is destroyed, or\n
|
||||
\n
|
||||
[mdash] the handler for the asynchronous operation is invoked,\n
|
||||
\n
|
||||
whichever comes first.\n
|
||||
\n
|
||||
If the operation completes successfully, the `WriteHandler` object `wh`
|
||||
is invoked with the number of bytes transferred. Otherwise it is invoked
|
||||
with `0`.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
93
asio/src/doc/requirements/Endpoint.qbk
Normal file
93
asio/src/doc/requirements/Endpoint.qbk
Normal file
@ -0,0 +1,93 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:Endpoint Endpoint requirements]
|
||||
|
||||
An endpoint must meet the requirements of `CopyConstructible` types (C++ Std,
|
||||
20.1.3), and the requirements of `Assignable` types (C++ Std, 23.1).
|
||||
|
||||
In the table below, `X` denotes an endpoint class, `a` denotes a value of type
|
||||
`X`, `s` denotes a size in bytes, and `u` denotes an identifier.
|
||||
|
||||
[table Endpoint requirements
|
||||
[[expression] [type] [assertion/note\npre/post-conditions]]
|
||||
[
|
||||
[`X::protocol_type`]
|
||||
[type meeting [link asio.reference.Protocol protocol] requirements]
|
||||
[]
|
||||
]
|
||||
[
|
||||
[`X u;`]
|
||||
[]
|
||||
[]
|
||||
]
|
||||
[
|
||||
[`X();`]
|
||||
[]
|
||||
[]
|
||||
]
|
||||
[
|
||||
[`a.protocol();`]
|
||||
[`protocol_type`]
|
||||
[]
|
||||
]
|
||||
[
|
||||
[`a.data();`]
|
||||
[a pointer]
|
||||
[
|
||||
Returns a pointer suitable for passing as the /address/ argument to
|
||||
__POSIX__ functions such as __accept__, __getpeername__, __getsockname__
|
||||
and __recvfrom__. The implementation shall perform a
|
||||
`reinterpret_cast` on the pointer to convert it to `sockaddr*`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`const X& u = a;
|
||||
u.data();`]
|
||||
[a pointer]
|
||||
[
|
||||
Returns a pointer suitable for passing as the /address/ argument to
|
||||
__POSIX__ functions such as __connect__, or as the /dest_addr/ argument
|
||||
to __POSIX__ functions such as __sendto__. The implementation shall
|
||||
perform a `reinterpret_cast` on the pointer to convert it to `const
|
||||
sockaddr*`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.size();`]
|
||||
[`size_t`]
|
||||
[
|
||||
Returns a value suitable for passing as the /address_len/ argument
|
||||
to __POSIX__ functions such as __connect__, or as the /dest_len/ argument
|
||||
to __POSIX__ functions such as __sendto__, after appropriate integer
|
||||
conversion has been performed.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.resize(s);`]
|
||||
[]
|
||||
[
|
||||
post: `a.size() == s`\n
|
||||
Passed the value contained in the /address_len/ argument to __POSIX__
|
||||
functions such as __accept__, __getpeername__, __getsockname__ and
|
||||
__recvfrom__, after successful completion of the function. Permitted to
|
||||
throw an exception if the protocol associated with the endpoint object `a`
|
||||
does not support the specified size.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.capacity();`]
|
||||
[`size_t`]
|
||||
[
|
||||
Returns a value suitable for passing as the /address_len/ argument to
|
||||
__POSIX__ functions such as __accept__, __getpeername__, __getsockname__
|
||||
and __recvfrom__, after appropriate integer conversion has been performed.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
62
asio/src/doc/requirements/GettableSocketOption.qbk
Normal file
62
asio/src/doc/requirements/GettableSocketOption.qbk
Normal file
@ -0,0 +1,62 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:GettableSocketOption Gettable socket option requirements]
|
||||
|
||||
In the table below, `X` denotes a socket option class, `a` denotes a value of
|
||||
`X`, `p` denotes a value that meets the [link asio.reference.Protocol
|
||||
protocol] requirements, and `u` denotes an identifier.
|
||||
|
||||
[table GettableSocketOption requirements
|
||||
[[expression] [type] [assertion/note\npre/post-conditions]]
|
||||
[
|
||||
[`a.level(p);`]
|
||||
[`int`]
|
||||
[
|
||||
Returns a value suitable for passing as the /level/ argument to __POSIX__
|
||||
__getsockopt__ (or equivalent).
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.name(p);`]
|
||||
[`int`]
|
||||
[
|
||||
Returns a value suitable for passing as the /option_name/ argument to
|
||||
__POSIX__ __getsockopt__ (or equivalent).
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.data(p);`]
|
||||
[a pointer, convertible to `void*`]
|
||||
[
|
||||
Returns a pointer suitable for passing as the /option_value/ argument to
|
||||
__POSIX__ __getsockopt__ (or equivalent).
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.size(p);`]
|
||||
[`size_t`]
|
||||
[
|
||||
Returns a value suitable for passing as the /option_len/ argument to
|
||||
__POSIX__ __getsockopt__ (or equivalent), after appropriate
|
||||
integer conversion has been performed.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.resize(p, s);`]
|
||||
[]
|
||||
[
|
||||
post: `a.size(p) == s`.\n
|
||||
Passed the value contained in the /option_len/ argument to __POSIX__
|
||||
__getsockopt__ (or equivalent) after successful completion of the
|
||||
function. Permitted to throw an exception if the socket option object `a`
|
||||
does not support the specified size.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
64
asio/src/doc/requirements/Handler.qbk
Normal file
64
asio/src/doc/requirements/Handler.qbk
Normal file
@ -0,0 +1,64 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:Handler Handlers]
|
||||
|
||||
A handler must meet the requirements of `CopyConstructible` types (C++ Std,
|
||||
20.1.3).
|
||||
|
||||
In the table below, `X` denotes a handler class, `h` denotes a value of `X`,
|
||||
`p` denotes a pointer to a block of allocated memory of type `void*`, `s`
|
||||
denotes the size for a block of allocated memory, and `f` denotes a function
|
||||
object taking no arguments.
|
||||
|
||||
[table Handler requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-conditions]]
|
||||
[
|
||||
[``
|
||||
using namespace asio;
|
||||
asio_handler_allocate(s, &h);
|
||||
``]
|
||||
[`void*`]
|
||||
[
|
||||
Returns a pointer to a block of memory of size `s`. The pointer must
|
||||
satisfy the same alignment requirements as a pointer returned by
|
||||
`::operator new()`. Throws `bad_alloc` on failure.\n\n The
|
||||
`asio_handler_allocate()` function is located using argument-dependent
|
||||
lookup. The function `asio::asio_handler_allocate()` serves as a
|
||||
default if no user-supplied function is available.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
using namespace asio;
|
||||
asio_handler_deallocate(p, s, &h);
|
||||
``]
|
||||
[]
|
||||
[
|
||||
Frees a block of memory associated with a pointer `p`, of at least size
|
||||
`s`, that was previously allocated using `asio_handler_allocate()`.\n\n The
|
||||
`asio_handler_deallocate()` function is located using argument-dependent
|
||||
lookup. The function `asio::asio_handler_deallocate()` serves as a
|
||||
default if no user-supplied function is available.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
using namespace asio;
|
||||
asio_handler_invoke(f, &h);
|
||||
``]
|
||||
[]
|
||||
[
|
||||
Causes the function object `f` to be executed as if by calling `f()`.\n\n
|
||||
The `asio_handler_invoke()` function is located using argument-dependent
|
||||
lookup. The function `asio::asio_handler_invoke()` serves as a
|
||||
default if no user-supplied function is available.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
46
asio/src/doc/requirements/InternetProtocol.qbk
Normal file
46
asio/src/doc/requirements/InternetProtocol.qbk
Normal file
@ -0,0 +1,46 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:InternetProtocol Internet protocol requirements]
|
||||
|
||||
An internet protocol must meet the requirements for a [link
|
||||
asio.reference.Protocol protocol] as well as the additional
|
||||
requirements listed below.
|
||||
|
||||
In the table below, `X` denotes an internet protocol class, `a` denotes a value
|
||||
of type `X`, and `b` denotes a value of type `X`.
|
||||
|
||||
[table InternetProtocol requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-conditions]]
|
||||
[
|
||||
[`X::resolver`]
|
||||
[`ip::basic_resolver<X>`]
|
||||
[The type of a resolver for the protocol.]
|
||||
]
|
||||
[
|
||||
[`X::v4()`]
|
||||
[`X`]
|
||||
[Returns an object representing the IP version 4 protocol.]
|
||||
]
|
||||
[
|
||||
[`X::v6()`]
|
||||
[`X`]
|
||||
[Returns an object representing the IP version 6 protocol.]
|
||||
]
|
||||
[
|
||||
[`a == b`]
|
||||
[convertible to `bool`]
|
||||
[Returns whether two protocol objects are equal.]
|
||||
]
|
||||
[
|
||||
[`a != b`]
|
||||
[convertible to `bool`]
|
||||
[Returns `!(a == b)`.]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
31
asio/src/doc/requirements/IoControlCommand.qbk
Normal file
31
asio/src/doc/requirements/IoControlCommand.qbk
Normal file
@ -0,0 +1,31 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:IoControlCommand I/O control command requirements]
|
||||
|
||||
In the table below, `X` denotes an I/O control command class, `a` denotes a
|
||||
value of `X`, and `u` denotes an identifier.
|
||||
|
||||
[table IoControlCommand requirements
|
||||
[[expression] [type] [assertion/note\npre/post-conditions]]
|
||||
[
|
||||
[`a.name();`]
|
||||
[`int`]
|
||||
[
|
||||
Returns a value suitable for passing as the /request/ argument to
|
||||
__POSIX__ __ioctl__ (or equivalent).
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.data();`]
|
||||
[a pointer, convertible to `void*`]
|
||||
[
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
48
asio/src/doc/requirements/IoObjectService.qbk
Normal file
48
asio/src/doc/requirements/IoObjectService.qbk
Normal file
@ -0,0 +1,48 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:IoObjectService I/O object service requirements]
|
||||
|
||||
An I/O object service must meet the requirements for a [link
|
||||
asio.reference.Service service], as well as the requirements listed
|
||||
below.
|
||||
|
||||
In the table below, `X` denotes an I/O object service class, `a` denotes a
|
||||
value of type `X`, `b` denotes a value of type `X::implementation_type`, and
|
||||
`u` denotes an identifier.
|
||||
|
||||
[table IoObjectService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`X::implementation_type`]
|
||||
[]
|
||||
[]
|
||||
]
|
||||
[
|
||||
[`X::implementation_type u;`]
|
||||
[]
|
||||
[note: `X::implementation_type` has a public default constructor and
|
||||
destructor.]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.construct(b);
|
||||
``]
|
||||
[]
|
||||
[]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.destroy(b);
|
||||
``]
|
||||
[]
|
||||
[note: `destroy()` will only be called on a value that has previously been
|
||||
initialised with `construct()`.]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
102
asio/src/doc/requirements/MutableBufferSequence.qbk
Normal file
102
asio/src/doc/requirements/MutableBufferSequence.qbk
Normal file
@ -0,0 +1,102 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:MutableBufferSequence Mutable buffer sequence requirements]
|
||||
|
||||
In the table below, `X` denotes a class containing objects of type `T`, `a`
|
||||
denotes a value of type `X` and `u` denotes an identifier.
|
||||
|
||||
[table MutableBufferSequence requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`X::value_type`]
|
||||
[`T`]
|
||||
[`T` meets the requirements for [link
|
||||
asio.reference.ConvertibleToMutableBuffer
|
||||
ConvertibleToMutableBuffer].]
|
||||
]
|
||||
[
|
||||
[`X::const_iterator`]
|
||||
[iterator type pointing to `T`]
|
||||
[`const_iterator` meets the requirements for bidirectional iterators
|
||||
(C++ Std, 24.1.4).]
|
||||
]
|
||||
[
|
||||
[`X(a);`]
|
||||
[]
|
||||
[post: `equal_mutable_buffer_seq(a, X(a))` where the binary predicate
|
||||
`equal_mutable_buffer_seq` is defined as
|
||||
``
|
||||
bool equal_mutable_buffer_seq(
|
||||
const X& x1, const X& x2)
|
||||
{
|
||||
return
|
||||
distance(x1.begin(), x1.end())
|
||||
== distance(x2.begin(), x2.end())
|
||||
&& equal(x1.begin(), x1.end(),
|
||||
x2.begin(), equal_buffer);
|
||||
}
|
||||
``
|
||||
and the binary predicate `equal_buffer` is defined as
|
||||
``
|
||||
bool equal_buffer(
|
||||
const X::value_type& v1,
|
||||
const X::value_type& v2)
|
||||
{
|
||||
mutable_buffer b1(v1);
|
||||
mutable_buffer b2(v2);
|
||||
return
|
||||
buffer_cast<const void*>(b1)
|
||||
== buffer_cast<const void*>(b2)
|
||||
&& buffer_size(b1) == buffer_size(b2);
|
||||
}
|
||||
``]
|
||||
]
|
||||
[
|
||||
[`X u(a);`]
|
||||
[]
|
||||
[post:
|
||||
``
|
||||
distance(a.begin(), a.end())
|
||||
== distance(u.begin(), u.end())
|
||||
&& equal(a.begin(), a.end(),
|
||||
u.begin(), equal_buffer)
|
||||
``
|
||||
where the binary predicate `equal_buffer` is defined as
|
||||
``
|
||||
bool equal_buffer(
|
||||
const X::value_type& v1,
|
||||
const X::value_type& v2)
|
||||
{
|
||||
mutable_buffer b1(v1);
|
||||
mutable_buffer b2(v2);
|
||||
return
|
||||
buffer_cast<const void*>(b1)
|
||||
== buffer_cast<const void*>(b2)
|
||||
&& buffer_size(b1) == buffer_size(b2);
|
||||
}
|
||||
``]
|
||||
]
|
||||
[
|
||||
[`(&a)->~X();`]
|
||||
[`void`]
|
||||
[note: the destructor is applied to every element of `a`; all the memory
|
||||
is deallocated.]
|
||||
]
|
||||
[
|
||||
[`a.begin();`]
|
||||
[`const_iterator` or convertible to `const_iterator`]
|
||||
[]
|
||||
]
|
||||
[
|
||||
[`a.end();`]
|
||||
[`const_iterator` or convertible to `const_iterator`]
|
||||
[]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
49
asio/src/doc/requirements/Protocol.qbk
Normal file
49
asio/src/doc/requirements/Protocol.qbk
Normal file
@ -0,0 +1,49 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:Protocol Protocol requirements]
|
||||
|
||||
A protocol must meet the requirements of `CopyConstructible` types (C++ Std,
|
||||
20.1.3), and the requirements of `Assignable` types (C++ Std, 23.1).
|
||||
|
||||
In the table below, `X` denotes a protocol class, and `a` denotes a value of
|
||||
`X`.
|
||||
|
||||
[table Protocol requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-conditions]]
|
||||
[
|
||||
[`X::endpoint`]
|
||||
[type meeting [link asio.reference.Endpoint endpoint] requirements]
|
||||
[]
|
||||
]
|
||||
[
|
||||
[`a.family()`]
|
||||
[`int`]
|
||||
[
|
||||
Returns a value suitable for passing as the /domain/ argument to
|
||||
__POSIX__ __socket__ (or equivalent).
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.type()`]
|
||||
[`int`]
|
||||
[
|
||||
Returns a value suitable for passing as the /type/ argument to __POSIX__
|
||||
__socket__ (or equivalent).
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.protocol()`]
|
||||
[`int`]
|
||||
[
|
||||
Returns a value suitable for passing as the /protocol/ argument to
|
||||
__POSIX__ __socket__ (or equivalent).
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
15
asio/src/doc/requirements/ReadHandler.qbk
Normal file
15
asio/src/doc/requirements/ReadHandler.qbk
Normal file
@ -0,0 +1,15 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:ReadHandler Read handler requirements]
|
||||
|
||||
A read handler must meet the requirements for a [link
|
||||
asio.reference.Handler handler]. A value `h` of a read handler class
|
||||
should work correctly in the expression `h(ec, s)`, where `ec` is an lvalue of
|
||||
type `const error_code` and `s` is an lvalue of type `const size_t`.
|
||||
|
||||
[endsect]
|
18
asio/src/doc/requirements/ResolveHandler.qbk
Normal file
18
asio/src/doc/requirements/ResolveHandler.qbk
Normal file
@ -0,0 +1,18 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:ResolveHandler Resolve handler requirements]
|
||||
|
||||
A resolve handler must meet the requirements for a [link
|
||||
asio.reference.Handler handler]. A value `h` of a resolve handler
|
||||
class should work correctly in the expression `h(ec, i)`, where `ec` is an
|
||||
lvalue of type `const error_code` and `i` is an lvalue of type `const
|
||||
ip::basic_resolver_iterator<InternetProtocol>`. `InternetProtocol` is the
|
||||
template parameter of the [link asio.reference.ip__resolver_service
|
||||
`resolver_service`] which is used to initiate the asynchronous operation.
|
||||
|
||||
[endsect]
|
108
asio/src/doc/requirements/ResolverService.qbk
Normal file
108
asio/src/doc/requirements/ResolverService.qbk
Normal file
@ -0,0 +1,108 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:ResolverService Resolver service requirements]
|
||||
|
||||
A resolver service must meet the requirements for an [link
|
||||
asio.reference.IoObjectService I/O object service], as well as the
|
||||
additional requirements listed below.
|
||||
|
||||
In the table below, `X` denotes a resolver service class for protocol
|
||||
`InternetProtocol`, `a` denotes a value of type `X`, `b` denotes a value of
|
||||
type `X::implementation_type`, `q` denotes a value of type
|
||||
`ip::basic_resolver_query<InternetProtocol>`, `e` denotes a value of type
|
||||
`ip::basic_endpoint<InternetProtocol>`, `ec` denotes a value of type
|
||||
`error_code`, and `h` denotes a value meeting [link
|
||||
asio.reference.ResolveHandler `ResolveHandler`] requirements.
|
||||
|
||||
[table ResolverService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`a.destroy(b);`]
|
||||
[]
|
||||
[
|
||||
From [link asio.reference.IoObjectService IoObjectService]
|
||||
requirements. Implicitly cancels asynchronous resolve operations, as if by
|
||||
calling `a.cancel(b, ec)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.cancel(b, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
Causes any outstanding asynchronous resolve operations to complete as
|
||||
soon as possible. Handlers for cancelled operations shall be passed the
|
||||
error code `error::operation_aborted`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.resolve(b, q, ec);
|
||||
``]
|
||||
[``
|
||||
ip::basic_resolver_iterator<
|
||||
InternetProtocol>
|
||||
``]
|
||||
[
|
||||
On success, returns an iterator `i` such that `i !=
|
||||
ip::basic_resolver_iterator<InternetProtocol>()`. Otherwise returns
|
||||
`ip::basic_resolver_iterator<InternetProtocol>()`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.async_resolve(b, q, h);
|
||||
``]
|
||||
[]
|
||||
[
|
||||
Initiates an asynchronous resolve operation that is performed via the
|
||||
`io_service` object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n
|
||||
\n
|
||||
If the operation completes successfully, the `ResolveHandler` object `h`
|
||||
shall be invoked with an iterator object `i` such that the condition `i
|
||||
!= ip::basic_resolver_iterator<InternetProtocol>()` holds. Otherwise it
|
||||
is invoked with `ip::basic_resolver_iterator<InternetProtocol>()`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.resolve(b, e, ec);
|
||||
``]
|
||||
[``
|
||||
ip::basic_resolver_iterator<
|
||||
InternetProtocol>
|
||||
``]
|
||||
[
|
||||
On success, returns an iterator `i` such that `i !=
|
||||
ip::basic_resolver_iterator<InternetProtocol>()`. Otherwise returns
|
||||
`ip::basic_resolver_iterator<InternetProtocol>()`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.async_resolve(b, e, h);
|
||||
``]
|
||||
[]
|
||||
[
|
||||
Initiates an asynchronous resolve operation that is performed via the
|
||||
`io_service` object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n
|
||||
\n
|
||||
If the operation completes successfully, the `ResolveHandler` object `h`
|
||||
shall be invoked with an iterator object `i` such that the condition `i
|
||||
!= ip::basic_resolver_iterator<InternetProtocol>()` holds. Otherwise it
|
||||
is invoked with `ip::basic_resolver_iterator<InternetProtocol>()`.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
33
asio/src/doc/requirements/Service.qbk
Normal file
33
asio/src/doc/requirements/Service.qbk
Normal file
@ -0,0 +1,33 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:Service Service requirements]
|
||||
|
||||
A class is a service if it is publicly derived from another service, or if it
|
||||
is a class derived from `io_service::service` and contains a
|
||||
publicly-accessible declaration as follows:
|
||||
|
||||
static io_service::id id;
|
||||
|
||||
All services define a one-argument constructor that takes a reference to the
|
||||
`io_service` object that owns the service. This constructor is /explicit/,
|
||||
preventing its participation in automatic conversions. For example:
|
||||
|
||||
class my_service : public io_service::service
|
||||
{
|
||||
public:
|
||||
static io_service::id id;
|
||||
explicit my_service(io_service& ios);
|
||||
private:
|
||||
virtual void shutdown_service();
|
||||
...
|
||||
};
|
||||
|
||||
A service's `shutdown_service` member function must cause all copies of
|
||||
user-defined handler objects that are held by the service to be destroyed.
|
||||
|
||||
[endsect]
|
52
asio/src/doc/requirements/SettableSocketOption.qbk
Normal file
52
asio/src/doc/requirements/SettableSocketOption.qbk
Normal file
@ -0,0 +1,52 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:SettableSocketOption Settable socket option requirements]
|
||||
|
||||
In the table below, `X` denotes a socket option class, `a` denotes a value of
|
||||
`X`, `p` denotes a value that meets the [link asio.reference.Protocol
|
||||
protocol] requirements, and `u` denotes an identifier.
|
||||
|
||||
[table SettableSocketOption requirements
|
||||
[[expression] [type] [assertion/note\npre/post-conditions]]
|
||||
[
|
||||
[`a.level(p);`]
|
||||
[`int`]
|
||||
[
|
||||
Returns a value suitable for passing as the /level/ argument to __POSIX__
|
||||
__setsockopt__ (or equivalent).
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.name(p);`]
|
||||
[`int`]
|
||||
[
|
||||
Returns a value suitable for passing as the /option_name/ argument to
|
||||
__POSIX__ __setsockopt__ (or equivalent).
|
||||
]
|
||||
]
|
||||
[
|
||||
[`const X& u = a;
|
||||
u.data(p);`]
|
||||
[a pointer, convertible to `const void*`]
|
||||
[
|
||||
Returns a pointer suitable for passing as the /option_value/ argument to
|
||||
__POSIX__ __setsockopt__ (or equivalent).
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.size(p);`]
|
||||
[`size_t`]
|
||||
[
|
||||
Returns a value suitable for passing as the /option_len/ argument to
|
||||
__POSIX__ __setsockopt__ (or equivalent), after appropriate integer
|
||||
conversion has been performed.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
249
asio/src/doc/requirements/SocketAcceptorService.qbk
Normal file
249
asio/src/doc/requirements/SocketAcceptorService.qbk
Normal file
@ -0,0 +1,249 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:SocketAcceptorService Socket acceptor service requirements]
|
||||
|
||||
A socket acceptor service must meet the requirements for an [link
|
||||
asio.reference.IoObjectService I/O object service], as well as the
|
||||
additional requirements listed below.
|
||||
|
||||
In the table below, `X` denotes a socket acceptor service class for protocol
|
||||
[link asio.reference.Protocol `Protocol`], `a` denotes a value of type
|
||||
`X`, `b` denotes a value of type `X::implementation_type`, `p` denotes a value
|
||||
of type `Protocol`, `n` denotes a value of type `X::native_type`, `e` denotes a
|
||||
value of type `Protocol::endpoint`, `ec` denotes a value of type `error_code`,
|
||||
`s` denotes a value meeting [link asio.reference.SettableSocketOption
|
||||
`SettableSocketOption`] requirements, `g` denotes a value meeting [link
|
||||
asio.reference.GettableSocketOption `GettableSocketOption`]
|
||||
requirements, `i` denotes a value meeting [link
|
||||
asio.reference.IoControlCommand `IoControlCommand`] requirements, `k`
|
||||
denotes a value of type `basic_socket<Protocol, SocketService>` where
|
||||
`SocketService` is a type meeting [link asio.reference.SocketService
|
||||
socket service] requirements, `ah` denotes a value meeting [link
|
||||
asio.reference.AcceptHandler `AcceptHandler`] requirements, and `u`
|
||||
and `v` denote identifiers.
|
||||
|
||||
[table SocketAcceptorService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`X::native_type`]
|
||||
[]
|
||||
[
|
||||
The implementation-defined native representation of a socket acceptor.
|
||||
Must satisfy the requirements of `CopyConstructible` types (C++ Std,
|
||||
20.1.3), and the requirements of `Assignable` types (C++ Std, 23.1).
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.construct(b);`]
|
||||
[]
|
||||
[
|
||||
From [link asio.reference.IoObjectService IoObjectService]
|
||||
requirements.\n
|
||||
post: `!a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.destroy(b);`]
|
||||
[]
|
||||
[
|
||||
From [link asio.reference.IoObjectService IoObjectService]
|
||||
requirements. Implicitly cancels asynchronous operations, as if by calling
|
||||
`a.close(b, ec)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.open(b, p, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `!a.is_open(b)`.\n
|
||||
post: `!!ec || a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.assign(b, p, n, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `!a.is_open(b)`.\n
|
||||
post: `!!ec || a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.is_open(b);
|
||||
``]
|
||||
[`bool`]
|
||||
[
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const X& u = a;
|
||||
const X::implementation_type& v = b;
|
||||
u.is_open(v);
|
||||
``]
|
||||
[`bool`]
|
||||
[
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.close(b, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
If `a.is_open()` is true, causes any outstanding asynchronous operations
|
||||
to complete as soon as possible. Handlers for cancelled operations shall
|
||||
be passed the error code `error::operation_aborted`.\n
|
||||
post: `!a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.native(b);
|
||||
``]
|
||||
[`X::native_type`]
|
||||
[
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.cancel(b, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
Causes any outstanding asynchronous operations to complete as soon as
|
||||
possible. Handlers for cancelled operations shall be passed the error
|
||||
code `error::operation_aborted`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.set_option(b, s, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.get_option(b, g, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const X& u = a;
|
||||
const X::implementation_type& v = b;
|
||||
u.get_option(v, g, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.io_control(b, i, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const typename Protocol::endpoint& u = e;
|
||||
a.bind(b, u, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.local_endpoint(b, ec);
|
||||
``]
|
||||
[`Protocol::endpoint`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const X& u = a;
|
||||
const X::implementation_type& v = b;
|
||||
u.local_endpoint(v, ec);
|
||||
``]
|
||||
[`Protocol::endpoint`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.accept(b, k, &e, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b) && !k.is_open()`.\n
|
||||
post: `k.is_open()`
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.accept(b, k, 0, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b) && !k.is_open()`.\n
|
||||
post: `k.is_open()`
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.async_accept(b, k, &e, ah);
|
||||
``]
|
||||
[]
|
||||
[
|
||||
pre: `a.is_open(b) && !k.is_open()`.\n
|
||||
Initiates an asynchronous accept operation that is performed via the
|
||||
`io_service` object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n\n
|
||||
The program must ensure the objects `k` and `e` are valid until the
|
||||
handler for the asynchronous operation is invoked.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.async_accept(b, k, 0, ah);
|
||||
``]
|
||||
[]
|
||||
[
|
||||
pre: `a.is_open(b) && !k.is_open()`.\n
|
||||
Initiates an asynchronous accept operation that is performed via the
|
||||
`io_service` object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n\n
|
||||
The program must ensure the object `k` is valid until the handler for the
|
||||
asynchronous operation is invoked.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
290
asio/src/doc/requirements/SocketService.qbk
Normal file
290
asio/src/doc/requirements/SocketService.qbk
Normal file
@ -0,0 +1,290 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:SocketService Socket service requirements]
|
||||
|
||||
A socket service must meet the requirements for an [link
|
||||
asio.reference.IoObjectService I/O object service], as well as the
|
||||
additional requirements listed below.
|
||||
|
||||
In the table below, `X` denotes a socket service class for protocol [link
|
||||
asio.reference.Protocol `Protocol`], `a` denotes a value of type `X`,
|
||||
`b` denotes a value of type `X::implementation_type`, `p` denotes a value of
|
||||
type `Protocol`, `n` denotes a value of type `X::native_type`, `e` denotes a
|
||||
value of type `Protocol::endpoint`, `ec` denotes a value of type `error_code`,
|
||||
`s` denotes a value meeting [link asio.reference.SettableSocketOption
|
||||
`SettableSocketOption`] requirements, `g` denotes a value meeting [link
|
||||
asio.reference.GettableSocketOption `GettableSocketOption`]
|
||||
requirements, `i` denotes a value meeting [link
|
||||
asio.reference.IoControlCommand `IoControlCommand`] requirements, `h`
|
||||
denotes a value of type `socket_base::shutdown_type`, `ch` denotes a value
|
||||
meeting [link asio.reference.ConnectHandler `ConnectHandler`]
|
||||
requirements, and `u` and `v` denote identifiers.
|
||||
|
||||
[table SocketService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`X::native_type`]
|
||||
[]
|
||||
[
|
||||
The implementation-defined native representation of a socket. Must
|
||||
satisfy the requirements of `CopyConstructible` types (C++ Std, 20.1.3),
|
||||
and the requirements of `Assignable` types (C++ Std, 23.1).
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.construct(b);`]
|
||||
[]
|
||||
[
|
||||
From [link asio.reference.IoObjectService IoObjectService]
|
||||
requirements.\n
|
||||
post: `!a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.destroy(b);`]
|
||||
[]
|
||||
[
|
||||
From [link asio.reference.IoObjectService IoObjectService]
|
||||
requirements. Implicitly cancels asynchronous operations, as if by calling
|
||||
`a.close(b, ec)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.open(b, p, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `!a.is_open(b)`.\n
|
||||
post: `!!ec || a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.assign(b, p, n, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `!a.is_open(b)`.\n
|
||||
post: `!!ec || a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.is_open(b);
|
||||
``]
|
||||
[`bool`]
|
||||
[
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const X& u = a;
|
||||
const X::implementation_type& v = b;
|
||||
u.is_open(v);
|
||||
``]
|
||||
[`bool`]
|
||||
[
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.close(b, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
If `a.is_open()` is true, causes any outstanding asynchronous operations
|
||||
to complete as soon as possible. Handlers for cancelled operations shall
|
||||
be passed the error code `error::operation_aborted`.\n
|
||||
post: `!a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.native(b);
|
||||
``]
|
||||
[`X::native_type`]
|
||||
[
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.cancel(b, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
Causes any outstanding asynchronous operations to complete as soon as
|
||||
possible. Handlers for cancelled operations shall be passed the error
|
||||
code `error::operation_aborted`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.set_option(b, s, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.get_option(b, g, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const X& u = a;
|
||||
const X::implementation_type& v = b;
|
||||
u.get_option(v, g, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.io_control(b, i, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.at_mark(b, ec);
|
||||
``]
|
||||
[`bool`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const X& u = a;
|
||||
const X::implementation_type& v = b;
|
||||
u.at_mark(v, ec);
|
||||
``]
|
||||
[`bool`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.available(b, ec);
|
||||
``]
|
||||
[`size_t`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const X& u = a;
|
||||
const X::implementation_type& v = b;
|
||||
u.available(v, ec);
|
||||
``]
|
||||
[`size_t`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const typename Protocol::endpoint& u = e;
|
||||
a.bind(b, u, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.shutdown(b, h, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.local_endpoint(b, ec);
|
||||
``]
|
||||
[`Protocol::endpoint`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const X& u = a;
|
||||
const X::implementation_type& v = b;
|
||||
u.local_endpoint(v, ec);
|
||||
``]
|
||||
[`Protocol::endpoint`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.remote_endpoint(b, ec);
|
||||
``]
|
||||
[`Protocol::endpoint`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const X& u = a;
|
||||
const X::implementation_type& v = b;
|
||||
u.remote_endpoint(v, ec);
|
||||
``]
|
||||
[`Protocol::endpoint`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const typename Protocol::endpoint& u = e;
|
||||
a.connect(b, u, ec);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
pre: `a.is_open(b)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
const typename Protocol::endpoint& u = e;
|
||||
a.async_connect(b, u, ch);
|
||||
``]
|
||||
[]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
Initiates an asynchronous connect operation that is performed via the
|
||||
`io_service` object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
139
asio/src/doc/requirements/StreamSocketService.qbk
Normal file
139
asio/src/doc/requirements/StreamSocketService.qbk
Normal file
@ -0,0 +1,139 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:StreamSocketService Stream socket service requirements]
|
||||
|
||||
A stream socket service must meet the requirements for a [link
|
||||
asio.reference.SocketService socket service], as well as the additional
|
||||
requirements listed below.
|
||||
|
||||
In the table below, `X` denotes a stream socket service class, `a` denotes a
|
||||
value of type `X`, `b` denotes a value of type `X::implementation_type`, `ec`
|
||||
denotes a value of type `error_code`, `f` denotes a value of type
|
||||
`socket_base::message_flags`, `mb` denotes a value satisfying [link
|
||||
asio.reference.MutableBufferSequence mutable buffer sequence]
|
||||
requirements, `rh` denotes a value meeting [link
|
||||
asio.reference.ReadHandler `ReadHandler`] requirements, `cb` denotes a
|
||||
value satisfying [link asio.reference.ConstBufferSequence constant
|
||||
buffer sequence] requirements, and `wh` denotes a value meeting [link
|
||||
asio.reference.WriteHandler `WriteHandler`] requirements.
|
||||
|
||||
[table StreamSocketService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`a.receive(b, mb, f, ec);`]
|
||||
[`size_t`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Reads one or more bytes of data from a connected socket `b`.\n
|
||||
\n
|
||||
The mutable buffer sequence `mb` specifies memory where the data should
|
||||
be placed. The operation shall always fill a buffer in the sequence
|
||||
completely before proceeding to the next.\n
|
||||
\n
|
||||
If successful, returns the number of bytes read. Otherwise returns `0`.
|
||||
If the total size of all buffers in the sequence `mb` is `0`, the
|
||||
function shall return `0` immediately.\n
|
||||
\n
|
||||
If the operation completes due to graceful connection closure by the
|
||||
peer, the operation shall fail with `error::eof`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.async_receive(b, mb, f, rh);`]
|
||||
[`void`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Initiates an asynchronous operation to read one or more bytes of data
|
||||
from a connected socket `b`. The operation is performed via the
|
||||
`io_service` object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n
|
||||
\n
|
||||
The mutable buffer sequence `mb` specifies memory where the data should
|
||||
be placed. The operation shall always fill a buffer in the sequence
|
||||
completely before proceeding to the next.\n
|
||||
\n
|
||||
The implementation shall maintain one or more copies of `mb` until such
|
||||
time as the read operation no longer requires access to the memory
|
||||
specified by the buffers in the sequence. The program must ensure the
|
||||
memory is valid until:\n
|
||||
\n
|
||||
[mdash] the last copy of `mb` is destroyed, or\n
|
||||
\n
|
||||
[mdash] the handler for the asynchronous operation is invoked,\n
|
||||
\n
|
||||
whichever comes first. If the total size of all buffers in the sequence
|
||||
`mb` is `0`, the asynchronous read operation shall complete immediately
|
||||
and pass `0` as the argument to the handler that specifies the number of
|
||||
bytes read.\n
|
||||
\n
|
||||
If the operation completes due to graceful connection closure by the
|
||||
peer, the operation shall fail with `error::eof`.\n
|
||||
\n
|
||||
If the operation completes successfully, the `ReadHandler` object
|
||||
`rh` is invoked with the number of bytes transferred. Otherwise it is
|
||||
invoked with `0`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.send(b, cb, f, ec);`]
|
||||
[`size_t`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Writes one or more bytes of data to a connected socket `b`.\n
|
||||
\n
|
||||
The constant buffer sequence `cb` specifies memory where the data to be
|
||||
written is located. The operation shall always write a buffer in the
|
||||
sequence completely before proceeding to the next.\n
|
||||
\n
|
||||
If successful, returns the number of bytes written. Otherwise returns `0`.
|
||||
If the total size of all buffers in the sequence `cb` is `0`, the
|
||||
function shall return `0` immediately.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.async_send(b, cb, f, wh);`]
|
||||
[`void`]
|
||||
[
|
||||
pre: `a.is_open(b)`.\n
|
||||
\n
|
||||
Initiates an asynchronous operation to write one or more bytes of data to
|
||||
a connected socket `b`. The operation is performed via the `io_service`
|
||||
object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n
|
||||
\n
|
||||
The constant buffer sequence `cb` specifies memory where the data to be
|
||||
written is located. The operation shall always write a buffer in the
|
||||
sequence completely before proceeding to the next.\n
|
||||
\n
|
||||
The implementation shall maintain one or more copies of `cb` until such
|
||||
time as the write operation no longer requires access to the memory
|
||||
specified by the buffers in the sequence. The program must ensure the
|
||||
memory is valid until:\n
|
||||
\n
|
||||
[mdash] the last copy of `cb` is destroyed, or\n
|
||||
\n
|
||||
[mdash] the handler for the asynchronous operation is invoked,\n
|
||||
\n
|
||||
whichever comes first. If the total size of all buffers in the sequence
|
||||
`cb` is `0`, the asynchronous operation shall complete immediately and
|
||||
pass `0` as the argument to the handler that specifies the number of
|
||||
bytes read.\n
|
||||
\n
|
||||
If the operation completes successfully, the `WriteHandler` object `wh`
|
||||
is invoked with the number of bytes transferred. Otherwise it is invoked
|
||||
with `0`.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
48
asio/src/doc/requirements/SyncReadStream.qbk
Normal file
48
asio/src/doc/requirements/SyncReadStream.qbk
Normal file
@ -0,0 +1,48 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:SyncReadStream Buffer-oriented synchronous read stream requirements]
|
||||
|
||||
In the table below, `a` denotes a synchronous read stream object, `mb` denotes
|
||||
an object satisfying [link asio.reference.MutableBufferSequence
|
||||
mutable buffer sequence] requirements, and `ec` denotes an object of type
|
||||
`error_code`.
|
||||
|
||||
[table Buffer-oriented synchronous read stream requirements
|
||||
[[operation] [type] [semantics, pre/post-conditions]]
|
||||
[
|
||||
[`a.read_some(mb);`]
|
||||
[`size_t`]
|
||||
[Equivalent to:
|
||||
``
|
||||
error_code ec;
|
||||
size_t s = a.read_some(mb, ec);
|
||||
if (ec) throw system_error(ec);
|
||||
return s;
|
||||
``]
|
||||
]
|
||||
[
|
||||
[`a.read_some(mb, ec);`]
|
||||
[`size_t`]
|
||||
[
|
||||
Reads one or more bytes of data from the stream `a`.\n
|
||||
\n
|
||||
The mutable buffer sequence `mb` specifies memory where the data should
|
||||
be placed. The `read_some` operation shall always fill a buffer in the
|
||||
sequence completely before proceeding to the next.\n
|
||||
\n
|
||||
If successful, returns the number of bytes read and sets `ec` such that
|
||||
`!ec` is true. If an error occurred, returns `0` and sets `ec` such that
|
||||
`!!ec` is true.\n
|
||||
\n
|
||||
If the total size of all buffers in the sequence `mb` is `0`, the
|
||||
function shall return `0` immediately.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
47
asio/src/doc/requirements/SyncWriteStream.qbk
Normal file
47
asio/src/doc/requirements/SyncWriteStream.qbk
Normal file
@ -0,0 +1,47 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:SyncWriteStream Buffer-oriented synchronous write stream requirements]
|
||||
|
||||
In the table below, `a` denotes a synchronous write stream object, `cb` denotes
|
||||
an object satisfying [link asio.reference.ConstBufferSequence constant
|
||||
buffer sequence] requirements, and `ec` denotes an object of type `error_code`.
|
||||
|
||||
[table Buffer-oriented synchronous write stream requirements
|
||||
[[operation] [type] [semantics, pre/post-conditions]]
|
||||
[
|
||||
[`a.write_some(cb);`]
|
||||
[`size_t`]
|
||||
[Equivalent to:
|
||||
``
|
||||
error_code ec;
|
||||
size_t s = a.write_some(cb, ec);
|
||||
if (ec) throw system_error(ec);
|
||||
return s;
|
||||
``]
|
||||
]
|
||||
[
|
||||
[`a.write_some(cb, ec);`]
|
||||
[`size_t`]
|
||||
[
|
||||
Writes one or more bytes of data to the stream `a`.\n
|
||||
\n
|
||||
The constant buffer sequence `cb` specifies memory where the data to be
|
||||
written is located. The `write_some` operation shall always write a
|
||||
buffer in the sequence completely before proceeding to the next.\n
|
||||
\n
|
||||
If successful, returns the number of bytes written and sets `ec` such
|
||||
that `!ec` is true. If an error occurred, returns `0` and sets `ec` such
|
||||
that `!!ec` is true.\n
|
||||
\n
|
||||
If the total size of all buffers in the sequence `cb` is `0`, the
|
||||
function shall return `0` immediately.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
72
asio/src/doc/requirements/TimeTraits.qbk
Normal file
72
asio/src/doc/requirements/TimeTraits.qbk
Normal file
@ -0,0 +1,72 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:TimeTraits Time traits requirements]
|
||||
|
||||
In the table below, `X` denotes a time traits class for time type `Time`, `t`,
|
||||
`t1`, and `t2` denote values of type `Time`, and `d` denotes a value of type
|
||||
`X::duration_type`.
|
||||
|
||||
[table TimeTraits requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`X::time_type`]
|
||||
[`Time`]
|
||||
[
|
||||
Represents an absolute time. Must support default construction, and meet
|
||||
the requirements for `CopyConstructible` and `Assignable`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`X::duration_type`]
|
||||
[]
|
||||
[
|
||||
Represents the difference between two absolute times. Must support
|
||||
default construction, and meet the requirements for `CopyConstructible`
|
||||
and `Assignable`. A duration can be positive, negative, or zero.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`X::now();`]
|
||||
[`time_type`]
|
||||
[
|
||||
Returns the current time.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`X::add(t, d);`]
|
||||
[`time_type`]
|
||||
[
|
||||
Returns a new absolute time resulting from adding the duration `d` to the
|
||||
absolute time `t`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`X::subtract(t1, t2);`]
|
||||
[`duration_type`]
|
||||
[
|
||||
Returns the duration resulting from subtracting `t2` from `t1`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`X::less_than(t1, t2);`]
|
||||
[`bool`]
|
||||
[
|
||||
Returns whether `t1` is to be treated as less than `t2`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`X::to_posix_duration(d);`]
|
||||
[`date_time::time_duration_type`]
|
||||
[
|
||||
Returns the `date_time::time_duration_type` value that most closely
|
||||
represents the duration `d`.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
105
asio/src/doc/requirements/TimerService.qbk
Normal file
105
asio/src/doc/requirements/TimerService.qbk
Normal file
@ -0,0 +1,105 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:TimerService Timer service requirements]
|
||||
|
||||
A timer service must meet the requirements for an [link
|
||||
asio.reference.IoObjectService I/O object service], as well as the
|
||||
additional requirements listed below.
|
||||
|
||||
In the table below, `X` denotes a timer service class for time type `Time` and
|
||||
traits type `TimeTraits`, `a` denotes a value of type `X`, `b` denotes a value
|
||||
of type `X::implementation_type`, `t` denotes a value of type `Time`, `d`
|
||||
denotes a value of type `TimeTraits::duration_type`, `e` denotes a value of
|
||||
type `error_code`, and `h` denotes a value meeting [link
|
||||
asio.reference.WaitHandler `WaitHandler`] requirements.
|
||||
|
||||
[table TimerService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`a.destroy(b);`]
|
||||
[]
|
||||
[
|
||||
From [link asio.reference.IoObjectService IoObjectService]
|
||||
requirements. Implicitly cancels asynchronous wait operations, as if by
|
||||
calling `a.cancel(b, e)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.cancel(b, e);
|
||||
``]
|
||||
[`size_t`]
|
||||
[
|
||||
Causes any outstanding asynchronous wait operations to complete as soon
|
||||
as possible. Handlers for cancelled operations shall be passed the error
|
||||
code `error::operation_aborted`. Sets `e` to indicate success or failure.
|
||||
Returns the number of operations that were cancelled.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.expires_at(b);`]
|
||||
[`Time`]
|
||||
[]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.expires_at(b, t, e);
|
||||
``]
|
||||
[`size_t`]
|
||||
[
|
||||
Implicitly cancels asynchronous wait operations, as if by calling
|
||||
`a.cancel(b, e)`. Returns the number of operations that were cancelled.\n
|
||||
post: `a.expires_at(b) == t`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[`a.expires_from_now(b);`]
|
||||
[`TimeTraits::duration_type`]
|
||||
[
|
||||
Returns a value equivalent to `TimeTraits::subtract(a.expires_at(b),
|
||||
TimeTraits::now())`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.expires_from_now(b, d, e);
|
||||
``]
|
||||
[`size_t`]
|
||||
[
|
||||
Equivalent to `a.expires_at(b, TimeTraits::add(TimeTraits::now(), d), e)`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.wait(b, e);
|
||||
``]
|
||||
[`error_code`]
|
||||
[
|
||||
Sets `e` to indicate success or failure. Returns `e`.\n
|
||||
post: `!!e || !TimeTraits::lt(TimeTraits::now(), a.expires_at(b))`.
|
||||
]
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.async_wait(b, h);
|
||||
``]
|
||||
[]
|
||||
[
|
||||
Initiates an asynchronous wait operation that is performed via the
|
||||
`io_service` object `a.io_service()` and behaves according to [link
|
||||
asio.reference.asynchronous_operations asynchronous operation]
|
||||
requirements.\n
|
||||
\n
|
||||
The handler shall be posted for execution only if the condition
|
||||
`!!ec || !TimeTraits::lt(TimeTraits::now(), a.expires_at(b))`
|
||||
holds, where `ec` is the error code to be passed to the handler.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
[endsect]
|
15
asio/src/doc/requirements/WaitHandler.qbk
Normal file
15
asio/src/doc/requirements/WaitHandler.qbk
Normal file
@ -0,0 +1,15 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:WaitHandler Wait handler requirements]
|
||||
|
||||
A wait handler must meet the requirements for a [link
|
||||
asio.reference.Handler handler]. A value `h` of a wait handler class
|
||||
should work correctly in the expression `h(ec)`, where `ec` is an lvalue of
|
||||
type `const error_code`.
|
||||
|
||||
[endsect]
|
15
asio/src/doc/requirements/WriteHandler.qbk
Normal file
15
asio/src/doc/requirements/WriteHandler.qbk
Normal file
@ -0,0 +1,15 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:WriteHandler Write handler requirements]
|
||||
|
||||
A write handler must meet the requirements for a [link
|
||||
asio.reference.Handler handler]. A value `h` of a write handler class
|
||||
should work correctly in the expression `h(ec, s)`, where `ec` is an lvalue of
|
||||
type `const error_code` and `s` is an lvalue of type `const size_t`.
|
||||
|
||||
[endsect]
|
176
asio/src/doc/requirements/asynchronous_operations.qbk
Normal file
176
asio/src/doc/requirements/asynchronous_operations.qbk
Normal file
@ -0,0 +1,176 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:asynchronous_operations Requirements on asynchronous operations]
|
||||
|
||||
In Asio, an asynchronous operation is initiated by a function that is
|
||||
named with the prefix `async_`. These functions will be referred to as
|
||||
['initiating functions].
|
||||
|
||||
All initiating functions in Asio take a function object meeting [link
|
||||
asio.reference.Handler handler] requirements as the final parameter.
|
||||
These handlers accept as their first parameter an lvalue of type `const
|
||||
error_code`.
|
||||
|
||||
Implementations of asynchronous operations in Asio may call the
|
||||
application programming interface (API) provided by the operating system. If
|
||||
such an operating system API call results in an error, the handler will be
|
||||
invoked with a `const error_code` lvalue that evaluates to true. Otherwise the
|
||||
handler will be invoked with a `const error_code` lvalue that evaluates to
|
||||
false.
|
||||
|
||||
Unless otherwise noted, when the behaviour of an asynchronous operation is
|
||||
defined "as if" implemented by a __POSIX__ function, the handler will be
|
||||
invoked with a value of type `error_code` that corresponds to the failure
|
||||
condition described by __POSIX__ for that function, if any. Otherwise the
|
||||
handler will be invoked with an implementation-defined `error_code` value that
|
||||
reflects the operating system error.
|
||||
|
||||
Asynchronous operations will not fail with an error condition that indicates
|
||||
interruption by a signal (__POSIX__ `EINTR`). Asynchronous operations will not
|
||||
fail with any error condition associated with non-blocking operations
|
||||
(__POSIX__ `EWOULDBLOCK`, `EAGAIN` or `EINPROGRESS`; __Windows__
|
||||
`WSAEWOULDBLOCK` or `WSAEINPROGRESS`).
|
||||
|
||||
All asynchronous operations have an associated `io_service` object. Where the
|
||||
initiating function is a member function, the associated `io_service` is that
|
||||
returned by the `io_service()` member function on the same object. Where the
|
||||
initiating function is not a member function, the associated `io_service` is
|
||||
that returned by the `io_service()` member function of the first argument to
|
||||
the initiating function.
|
||||
|
||||
Arguments to initiating functions will be treated as follows:
|
||||
|
||||
[mdash] If the parameter is declared as a const reference or by-value, the
|
||||
program is not required to guarantee the validity of the argument after the
|
||||
initiating function completes. The implementation may make copies of the
|
||||
argument, and all copies will be destroyed no later than immediately after
|
||||
invocation of the handler.
|
||||
|
||||
[mdash] If the parameter is declared as a non-const reference, const pointer or
|
||||
non-const pointer, the program must guarantee the validity of the argument
|
||||
until the handler is invoked.
|
||||
|
||||
The library implementation is only permitted to make calls to an initiating
|
||||
function's arguments' copy constructors or destructors from a thread that
|
||||
satisfies one of the following conditions:
|
||||
|
||||
[mdash] The thread is executing any member function of the associated
|
||||
`io_service` object.
|
||||
|
||||
[mdash] The thread is executing the destructor of the associated `io_service`
|
||||
object.
|
||||
|
||||
[mdash] The thread is executing one of the `io_service` service access
|
||||
functions `use_service`, `add_service` or `has_service`, where the first
|
||||
argument is the associated `io_service` object.
|
||||
|
||||
[mdash] The thread is executing any member function, constructor or destructor
|
||||
of an object of a class defined in this clause, where the object's
|
||||
`io_service()` member function returns the associated `io_service` object.
|
||||
|
||||
[mdash] The thread is executing any function defined in this clause, where any
|
||||
argument to the function has an `io_service()` member function that returns the
|
||||
associated `io_service` object.
|
||||
|
||||
[blurb Asio may use one or more hidden threads to emulate asynchronous
|
||||
functionality. The above requirements are intended to prevent these hidden
|
||||
threads from making calls to program code. This means that a program can, for
|
||||
example, use thread-unsafe reference counting in handler objects, provided the
|
||||
program ensures that all calls to an `io_service` and related objects occur
|
||||
from the one thread.]
|
||||
|
||||
The `io_service` object associated with an asynchronous operation will have
|
||||
unfinished work, as if by maintaining the existence of one or more objects of
|
||||
class `io_service::work` constructed using the `io_service`, until immediately
|
||||
after the handler for the asynchronous operation has been invoked.
|
||||
|
||||
When an asynchronous operation is complete, the handler for the operation will
|
||||
be invoked as if by:
|
||||
|
||||
# Constructing a bound completion handler `bch` for the handler, as described
|
||||
below.
|
||||
|
||||
# Calling `ios.post(bch)` to schedule the handler for deferred invocation,
|
||||
where `ios` is the associated `io_service`.
|
||||
|
||||
This implies that the handler must not be called directly from within
|
||||
the initiating function, even if the asynchronous operation completes
|
||||
immediately.
|
||||
|
||||
A bound completion handler is a handler object that contains a copy of a
|
||||
user-supplied handler, where the user-supplied handler accepts one or more
|
||||
arguments. The bound completion handler does not accept any arguments, and
|
||||
contains values to be passed as arguments to the user-supplied handler. The
|
||||
bound completion handler forwards the `asio_handler_allocate()`,
|
||||
`asio_handler_deallocate()`, and `asio_handler_invoke()` calls to the
|
||||
corresponding functions for the user-supplied handler. A bound completion
|
||||
handler meets the requirements for a [link
|
||||
asio.reference.CompletionHandler completion handler].
|
||||
|
||||
For example, a bound completion handler for a `ReadHandler` may be implemented
|
||||
as follows:
|
||||
|
||||
template<class ReadHandler>
|
||||
struct bound_read_handler
|
||||
{
|
||||
bound_read_handler(ReadHandler handler, const error_code& ec, size_t s)
|
||||
: handler_(handler), ec_(ec), s_(s)
|
||||
{
|
||||
}
|
||||
|
||||
void operator()()
|
||||
{
|
||||
handler_(ec_, s_);
|
||||
}
|
||||
|
||||
ReadHandler handler_;
|
||||
const error_code ec_;
|
||||
const size_t s_;
|
||||
};
|
||||
|
||||
template<class ReadHandler>
|
||||
void* asio_handler_allocate(size_t size,
|
||||
bound_read_handler<ReadHandler>* this_handler)
|
||||
{
|
||||
using namespace asio;
|
||||
return asio_handler_allocate(size, &this_handler->handler_);
|
||||
}
|
||||
|
||||
template<class ReadHandler>
|
||||
void asio_handler_deallocate(void* pointer, std::size_t size,
|
||||
bound_read_handler<ReadHandler>* this_handler)
|
||||
{
|
||||
using namespace asio;
|
||||
asio_handler_deallocate(pointer, size, &this_handler->handler_);
|
||||
}
|
||||
|
||||
template<class F, class ReadHandler>
|
||||
void asio_handler_invoke(const F& f,
|
||||
bound_read_handler<ReadHandler>* this_handler)
|
||||
{
|
||||
using namespace asio;
|
||||
asio_handler_invoke(f, &this_handler->handler_);
|
||||
}
|
||||
|
||||
If the thread that initiates an asynchronous operation terminates before the
|
||||
associated handler is invoked, the behaviour is implementation-defined.
|
||||
Specifically, on __Windows__ versions prior to Vista, unfinished operations are
|
||||
cancelled when the initiating thread exits.
|
||||
|
||||
The handler argument to an initiating function defines a handler identity. That
|
||||
is, the original handler argument and any copies of the handler argument will
|
||||
be considered equivalent. If the implementation needs to allocate storage for
|
||||
an asynchronous operation, the implementation will perform
|
||||
`asio_handler_allocate(size, &h)`, where `size` is the required size in bytes,
|
||||
and `h` is the handler. The implementation will perform
|
||||
`asio_handler_deallocate(p, size, &h)`, where `p` is a pointer to the storage,
|
||||
to deallocate the storage prior to the invocation of the handler via
|
||||
`asio_handler_invoke`. Multiple storage blocks may be allocated for a single
|
||||
asynchronous operation.
|
||||
|
||||
[endsect]
|
7
asio/src/doc/std_exception_dox.txt
Normal file
7
asio/src/doc/std_exception_dox.txt
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
\namespace std
|
||||
*/
|
||||
|
||||
/**
|
||||
\class std::exception
|
||||
*/
|
226
asio/src/doc/tutorial.dox
Normal file
226
asio/src/doc/tutorial.dox
Normal file
@ -0,0 +1,226 @@
|
||||
# Doxyfile 1.4.5
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = "Asio Tutorial"
|
||||
PROJECT_NUMBER =
|
||||
OUTPUT_DIRECTORY = .
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF =
|
||||
ALWAYS_DETAILED_SEC = YES
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = ./../../
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = YES
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = YES
|
||||
DETAILS_AT_TOP = YES
|
||||
INHERIT_DOCS = YES
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 2
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
BUILTIN_STL_SUPPORT = NO
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = NO
|
||||
EXTRACT_PRIVATE = YES
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
HIDE_UNDOC_CLASSES = YES
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = NO
|
||||
INLINE_INFO = NO
|
||||
SORT_MEMBER_DOCS = NO
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = NO
|
||||
GENERATE_TESTLIST = NO
|
||||
GENERATE_BUGLIST = NO
|
||||
GENERATE_DEPRECATEDLIST= NO
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = NO
|
||||
SHOW_DIRECTORIES = NO
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = ./../examples/tutorial/index_dox.txt \
|
||||
./../examples/tutorial/timer_dox.txt \
|
||||
./../examples/tutorial/daytime_dox.txt \
|
||||
./boost_bind_dox.txt
|
||||
FILE_PATTERNS =
|
||||
RECURSIVE = NO
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH = ./../examples
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = YES
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 1
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = NO
|
||||
HTML_OUTPUT = .
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = YES
|
||||
ENUM_VALUES_PER_LINE = 1
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = YES
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED = GENERATING_DOCUMENTATION
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = YES
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = YES
|
||||
TEMPLATE_RELATIONS = YES
|
||||
INCLUDE_GRAPH = NO
|
||||
INCLUDED_BY_GRAPH = NO
|
||||
CALL_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = NO
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
MAX_DOT_GRAPH_DEPTH = 0
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = NO
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
File diff suppressed because it is too large
Load Diff
2406
asio/src/doc/tutorial.qbk
Normal file
2406
asio/src/doc/tutorial.qbk
Normal file
File diff suppressed because it is too large
Load Diff
271
asio/src/doc/tutorial.xsl
Normal file
271
asio/src/doc/tutorial.xsl
Normal file
@ -0,0 +1,271 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<!--
|
||||
Copyright (c) 2003-2007 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)
|
||||
-->
|
||||
|
||||
<xsl:output method="text"/>
|
||||
<xsl:strip-space elements="*"/>
|
||||
|
||||
|
||||
<xsl:variable name="newline">
|
||||
<xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:variable>
|
||||
|
||||
|
||||
<xsl:template match="/doxygen">
|
||||
<xsl:text>[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:tutorial Tutorial]
|
||||
|
||||
</xsl:text>
|
||||
|
||||
<xsl:for-each select="compounddef[@kind = 'page' and @id = 'indexpage']">
|
||||
<xsl:apply-templates select="detaileddescription"/>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="
|
||||
compounddef[
|
||||
@kind = 'page' and
|
||||
@id != 'indexpage' and
|
||||
not(contains(@id, 'src'))]">
|
||||
<xsl:text>[section:</xsl:text>
|
||||
<xsl:value-of select="concat(@id, ' ', title)"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:apply-templates select="detaileddescription"/>
|
||||
<xsl:variable name="srcid" select="concat(@id, 'src')"/>
|
||||
<xsl:if test="count(/doxygen/compounddef[@id = $srcid]) > 0">
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:text>[section:src </xsl:text>
|
||||
<xsl:value-of select="/doxygen/compounddef[@id = $srcid]/title"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:apply-templates select="/doxygen/compounddef[@id = $srcid]/detaileddescription"/>
|
||||
<xsl:text>[endsect]</xsl:text>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
</xsl:if>
|
||||
<xsl:text>[endsect]</xsl:text>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:text>[endsect]</xsl:text>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!--========== Markup ==========-->
|
||||
|
||||
<xsl:template match="para">
|
||||
<xsl:apply-templates/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="title">
|
||||
<xsl:variable name="title">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:variable>
|
||||
<xsl:if test="string-length($title) > 0">
|
||||
<xsl:text>[heading </xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>]</xsl:text>
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="programlisting">
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="codeline">
|
||||
<xsl:if test="string-length(.) > 0">
|
||||
<xsl:text> ``''''''``</xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates mode="codeline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="sp">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="sp" mode="codeline">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="linebreak">
|
||||
<xsl:value-of select="$newline"/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="listitem">
|
||||
<xsl:text>* </xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:value-of select="$newline"/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="emphasis">
|
||||
<xsl:text>[*</xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="computeroutput">
|
||||
<xsl:text>`</xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>`</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="text()">
|
||||
<xsl:variable name="text" select="."/>
|
||||
<xsl:variable name="starts-with-whitespace" select="
|
||||
starts-with($text, ' ') or starts-with($text, $newline)"/>
|
||||
<xsl:variable name="preceding-node-name">
|
||||
<xsl:for-each select="preceding-sibling::*">
|
||||
<xsl:if test="position() = last()">
|
||||
<xsl:value-of select="local-name()"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="after-newline" select="
|
||||
$preceding-node-name = 'programlisting' or
|
||||
$preceding-node-name = 'linebreak'"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$starts-with-whitespace and $after-newline">
|
||||
<xsl:call-template name="escape-text">
|
||||
<xsl:with-param name="text">
|
||||
<xsl:call-template name="strip-leading-whitespace">
|
||||
<xsl:with-param name="text" select="$text"/>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="escape-text">
|
||||
<xsl:with-param name="text" select="$text"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="strip-leading-whitespace">
|
||||
<xsl:param name="text"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="starts-with($text, ' ')">
|
||||
<xsl:call-template name="strip-leading-whitespace">
|
||||
<xsl:with-param name="text" select="substring($text, 2)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="starts-with($text, $newline)">
|
||||
<xsl:call-template name="strip-leading-whitespace">
|
||||
<xsl:with-param name="text" select="substring($text, 2)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$text"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="escape-text">
|
||||
<xsl:param name="text"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($text, '_')">
|
||||
<xsl:value-of select="substring-before($text, '_')"/>
|
||||
<xsl:text>\_</xsl:text>
|
||||
<xsl:call-template name="escape-text">
|
||||
<xsl:with-param name="text" select="substring-after($text, '_')"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$text"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="ref[@kindref='compound']">
|
||||
<xsl:variable name="refid">
|
||||
<xsl:value-of select="@refid"/>
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(/doxygen/compounddef[@id=$refid]) > 0">
|
||||
<xsl:text>[link asio.tutorial.</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($refid, 'src')">
|
||||
<xsl:value-of select="substring-before($refid, 'src')"/>
|
||||
<xsl:text>.src</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$refid"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:value-of select="concat(' ', .)"/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="ref[@kindref='member']">
|
||||
<xsl:variable name="refid">
|
||||
<xsl:value-of select="@refid"/>
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$refid='index_1index'">
|
||||
<xsl:text>[link asio.tutorial </xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="ulink">
|
||||
<xsl:text>[@</xsl:text>
|
||||
<xsl:value-of select="@url"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:text>]</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet>
|
@ -1,18 +0,0 @@
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>asio $projectnumber</B>
|
||||
</TD>
|
||||
<TD ALIGN="RIGHT">
|
||||
<A CLASS="qindex" HREF="../index.html">Home</A> |
|
||||
<A CLASS="qindex" HREF="../reference/index.html">Reference</A> |
|
||||
<A CLASS="qindex" HREF="../tutorial/index.html">Tutorial</A> |
|
||||
<A CLASS="qindex" HREF="../examples/index.html">Examples</A> |
|
||||
<A CLASS="qindex" HREF="../design/index.html">Design</A>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
@ -1,32 +0,0 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>$title</TITLE>
|
||||
<LINK HREF="asio.css" REL="stylesheet" TYPE="text/css">
|
||||
<LINK HREF="tabs.css" REL="stylesheet" TYPE="text/css">
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF">
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>asio $projectnumber</B>
|
||||
</TD>
|
||||
<TD ALIGN="RIGHT">
|
||||
<A CLASS="qindex" HREF="../index.html">Home</A> |
|
||||
<A CLASS="qindex" HREF="../reference/index.html">Reference</A> |
|
||||
<A CLASS="qindex" HREF="../tutorial/index.html">Tutorial</A> |
|
||||
<A CLASS="qindex" HREF="../examples/index.html">Examples</A> |
|
||||
<A CLASS="qindex" HREF="../design/index.html">Design</A>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
<DIV CLASS="qindex">
|
||||
<TABLE BORDER="0" WIDTH="100%">
|
||||
<TR>
|
||||
<TD ALIGN="LEFT">
|
||||
<B>Tutorial</B>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
133
asio/src/doc/using.qbk
Normal file
133
asio/src/doc/using.qbk
Normal file
@ -0,0 +1,133 @@
|
||||
[/
|
||||
/ Copyright (c) 2003-2007 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)
|
||||
/]
|
||||
|
||||
[section:using Using Asio]
|
||||
|
||||
[heading Supported Platforms]
|
||||
|
||||
The following platforms and compilers have been tested:
|
||||
|
||||
* Win32 and Win64 using Visual C++ 7.1 and Visual C++ 8.0.
|
||||
* Win32 using Borland C++Builder 6 patch 4.
|
||||
* Win32 using MinGW.
|
||||
* Win32 using Cygwin. (`__USE_W32_SOCKETS` must be defined.)
|
||||
* Linux (2.4 or 2.6 kernels) using g++ 3.3 or later.
|
||||
* Solaris using g++ 3.3 or later.
|
||||
* Mac OS X 10.4 using g++ 3.3 or later.
|
||||
|
||||
The following platforms may also work:
|
||||
|
||||
* AIX 5.3 using XL C/C++ v9.
|
||||
* HP-UX 11i v3 using patched aC++ A.06.14.
|
||||
* QNX Neutrino 6.3 using g++ 3.3 or later.
|
||||
* Solaris using Sun Studio 11 or later.
|
||||
* Tru64 v5.1 using Compaq C++ v7.1.
|
||||
|
||||
[heading Dependencies]
|
||||
|
||||
The following libraries must be available in order to link programs that use
|
||||
Asio:
|
||||
|
||||
* Boost.Regex (optional) if you use any of the [link
|
||||
asio.reference.read_until `read_until()`] or [link
|
||||
asio.reference.async_read_until `async_read_until()`] overloads that take
|
||||
a `boost::regex` parameter.
|
||||
|
||||
* [@http://www.openssl.org OpenSSL] (optional) if you use Asio's SSL
|
||||
support.
|
||||
|
||||
Furthermore, some of the examples also require Boost.Date_Time or
|
||||
Boost.Serialization libraries.
|
||||
|
||||
[note With MSVC or Borland C++ you may want to add `-DBOOST_DATE_TIME_NO_LIB`
|
||||
and `-DBOOST_REGEX_NO_LIB` to your project settings to disable autolinking of
|
||||
the Boost.Date_Time and Boost.Regex libraries respectively. Alternatively, you
|
||||
may choose to build these libraries and link to them.]
|
||||
|
||||
[heading Building the tests and examples on Linux or UNIX]
|
||||
|
||||
If the boost directory (e.g. the directory called `boost_1_34_1`) is in the
|
||||
same directory as the asio source kit, then you may configure asio by simply
|
||||
going:
|
||||
|
||||
./configure
|
||||
|
||||
in the root directory of the asio source kit. Note that configure will always
|
||||
use the most recent boost version it knows about (i.e. 1.34.1) in preference to
|
||||
earlier versions, if there is more than one version present.
|
||||
|
||||
If the boost directory is in some other location, then you need to
|
||||
specify this directory when running configure:
|
||||
|
||||
./configure --with-boost=``['path_to_boost]``
|
||||
|
||||
When specifying the boost directory in this way you should ensure that you use
|
||||
an absolute path.
|
||||
|
||||
To build, simply run `make` in the root directory of the asio source kit. To
|
||||
test that asio is working correctly, run `make check` after a successful build.
|
||||
|
||||
[heading Building the tests and examples with MSVC]
|
||||
|
||||
To build using the MSVC 7.1 or MSVC 8.0 command line compiler, perform the
|
||||
following steps in a Command Prompt window:
|
||||
|
||||
* If you are using a version of boost other than 1.34.1, or if the boost
|
||||
directory (i.e. the directory called `boost_1_34_1`) is not in the same
|
||||
directory as the asio source kit, then specify the location of boost by
|
||||
running a command similar to [^set BOOSTDIR=['path_to_boost]]. Ensure that
|
||||
you specify an absolute path.
|
||||
|
||||
* Change to the asio `src` directory.
|
||||
|
||||
* Execute the command `nmake -f Makefile.msc`.
|
||||
|
||||
* Execute the command `nmake -f Makefile.msc check` to run a suite of tests to
|
||||
confirm that asio is working correctly.
|
||||
|
||||
[heading Building the test and examples with Borland C++]
|
||||
|
||||
To build using the Borland C++ Builder command line compiler, perform the
|
||||
following steps in a Command Prompt window:
|
||||
|
||||
* If you are using a version of boost other than 1.34.1, or if the boost
|
||||
directory (i.e. the directory called `boost_1_34_1`) is not in the same
|
||||
directory as the asio source kit, then specify the location of boost by
|
||||
running a command similar to [^set BOOSTDIR=['path_to_boost]]. Ensure that
|
||||
you specify an absolute path.
|
||||
|
||||
* Change to the asio `src` directory.
|
||||
|
||||
* Execute the command `make -f Makefile.bor`.
|
||||
|
||||
* Execute the command `make -f Makefile.bor check` to run a suite of tests to
|
||||
confirm that asio is working correctly.
|
||||
|
||||
[heading Building the tests and examples with MinGW]
|
||||
|
||||
To build using the MinGW g++ compiler from the command line, perform the
|
||||
following steps in a Command Prompt window:
|
||||
|
||||
* If you are using a version of boost other than 1.34.1, or if the boost
|
||||
directory (i.e. the directory called `boost_1_34_1`) is not in the same
|
||||
directory as the asio source kit, then specify the location of boost by
|
||||
running a command similar to [^set BOOSTDIR=['path_to_boost]]. Ensure that
|
||||
you specify an absolute path using ['forward slashes] (i.e.
|
||||
`c:/projects/boost_1_34_1` rather than `c:\projects\boost_1_34_1`).
|
||||
|
||||
* Change to the asio `src` directory.
|
||||
|
||||
* Execute the command `make -f Makefile.mgw`.
|
||||
|
||||
* Execute the command `make -f Makefile.mgw check` to run a suite of tests to
|
||||
confirm that asio is working correctly.
|
||||
|
||||
[note The above instructions do not work when building inside MSYS. If you want
|
||||
to build using MSYS, you should use [^export] rather than [^set] to specify the
|
||||
location of boost.]
|
||||
|
||||
[endsect]
|
@ -195,8 +195,8 @@ operation that refers to it.
|
||||
\until }
|
||||
\until }
|
||||
|
||||
In the function <tt>start()</tt>, we call \ref async_write to serve the data to
|
||||
the client. Note that we are using \ref async_write, rather than
|
||||
In the function <tt>start()</tt>, we call asio::async_write() to serve the data
|
||||
to the client. Note that we are using asio::async_write(), rather than
|
||||
asio::ip::tcp::socket::async_write_some(), to ensure that the entire block of
|
||||
data is sent.
|
||||
|
||||
@ -233,7 +233,8 @@ that it looks like:
|
||||
}
|
||||
\endcode
|
||||
|
||||
The \ref async_write call used to initiate the call can then be changed to just:
|
||||
The asio::async_write() call used to initiate the call can then be changed to
|
||||
just:
|
||||
|
||||
\code
|
||||
asio::async_write(socket_, asio::buffer(message_),
|
||||
|
Loading…
Reference in New Issue
Block a user