Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P1322r3 changes #77

Open
wants to merge 23 commits into
base: sg4-approved-changes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8d86159
Add Executor template parameter to forward declarations.
chriskohlhoff Jan 13, 2020
a622bd2
Custom executor support for basic_resolver.
chriskohlhoff Jan 13, 2020
7d34f25
Custom executor support for basic_waitable_timer.
chriskohlhoff Jan 13, 2020
ca3b1fd
Custom executor support for connect and async_connect.
chriskohlhoff Jan 13, 2020
c833bde
Custom executor support for basic_socket_streambuf and basic_socket_i…
chriskohlhoff Jan 13, 2020
21a2734
Add executor template parameters to socket synopsis.
chriskohlhoff Jan 13, 2020
1a5c8ce
Custom executor support for socket_base.
chriskohlhoff Jan 13, 2020
e2a6b34
Add custom executor support to basic_socket definition.
chriskohlhoff Jan 13, 2020
10f1beb
Add custom executor support to basic_datagram_socket and basic_stream…
chriskohlhoff Jan 13, 2020
5a8a047
Add custom executor support to basic_socket_acceptor definition.
chriskohlhoff Jan 13, 2020
17ce7b2
Update basic_socket constructors and assignment to add custom executors.
chriskohlhoff Jan 13, 2020
3fc1ee3
Fix constructor definitions in basic_datagram_socket and basic_stream…
chriskohlhoff Jan 13, 2020
63076d0
Update basic_datagram_socket constructors and assignment to add custo…
chriskohlhoff Jan 13, 2020
4065ebb
Update basic_stream_socket constructors and assignment to add custom …
chriskohlhoff Jan 13, 2020
1edccac
Update basic_socket_acceptor constructors and assignment to add custo…
chriskohlhoff Jan 13, 2020
ab3de91
Add custom executor wording for basic_socket_acceptor operations.
chriskohlhoff Jan 13, 2020
f0c8f8b
Reinstate basic_socket_acceptor::socket_type.
chriskohlhoff Aug 19, 2020
caf24d0
Add template type alias basic_socket_acceptor::rebind_socket_executor.
chriskohlhoff Aug 20, 2020
161464f
Change rebind_executor to be a template type alias.
chriskohlhoff Aug 20, 2020
fb9a803
Add AcceptableProtocol::socket_for. Rename rebind_socket_executor to …
chriskohlhoff Oct 14, 2020
fa00086
Add socket_for type alias to ip::tcp and ip::udp.
chriskohlhoff Feb 3, 2021
ac31799
Remove diff markup.
chriskohlhoff Sep 18, 2021
8e0a4d2
Use constraints.
chriskohlhoff Sep 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/forward.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@
class io_context;

template<class Clock> struct wait_traits;
template<class Clock, class WaitTraits = wait_traits<Clock>>
template<class Clock, class WaitTraits = wait_traits<Clock>, class Executor = executor>
class basic_waitable_timer;
using system_timer = basic_waitable_timer<chrono::system_clock>;
using steady_timer = basic_waitable_timer<chrono::steady_clock>;
using high_resolution_timer = basic_waitable_timer<chrono::high_resolution_clock>;

template<class Protocol>
template<class Protocol, class Executor = executor>
class basic_socket;
template<class Protocol>
template<class Protocol, class Executor = executor>
class basic_datagram_socket;
template<class Protocol>
template<class Protocol, class Executor = executor>
class basic_stream_socket;
template<class Protocol>
template<class Protocol, class Executor = executor>
class basic_socket_acceptor;
template<class Protocol, class Clock = chrono::steady_clock,
class WaitTraits = wait_traits<Clock>>
class WaitTraits = wait_traits<Clock>, class Executor = executor>
class basic_socket_streambuf;
template<class Protocol, class Clock = chrono::steady_clock,
class WaitTraits = wait_traits<Clock>>
class WaitTraits = wait_traits<Clock>, class Executor = executor>
class basic_socket_iostream;

namespace ip {
Expand All @@ -64,7 +64,7 @@
class basic_resolver_entry;
template<class InternetProtocol>
class basic_resolver_results;
template<class InternetProtocol>
template<class InternetProtocol, class Executor = executor>
class basic_resolver;
class tcp;
class udp;
Expand Down
35 changes: 29 additions & 6 deletions src/internetprotocol.tex
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@

class resolver_base;

template<class InternetProtocol>
template<class InternetProtocol, class Executor = executor>
class basic_resolver;

string host_name();
Expand Down Expand Up @@ -3060,26 +3060,31 @@
\rSec1[internet.resolver]{Class template \tcode{ip::basic_resolver}}

\pnum
Objects of type \tcode{basic_resolver<InternetProtocol>} are used to perform name resolution. Name resolution is the translation of a host name and service name into a sequence of endpoints, or the translation of an endpoint into its corresponding host name and service name.
Objects of type \tcode{basic_resolver<InternetProtocol, Executor>} are used to perform name resolution. Name resolution is the translation of a host name and service name into a sequence of endpoints, or the translation of an endpoint into its corresponding host name and service name.

\begin{codeblock}
namespace std::experimental::net::inline @\namespacever@ {
namespace ip {

template<class InternetProtocol>
template<class InternetProtocol, class Executor = executor>
class basic_resolver : public resolver_base
{
public:
// types:

using executor_type = io_context::executor_type;
using executor_type = Executor;
using protocol_type = InternetProtocol;
using endpoint_type = typename InternetProtocol::endpoint;
using results_type = basic_resolver_results<InternetProtocol>;

template<class OtherExecutor>
using rebind_executor =
basic_resolver<InternetProtocol, OtherExecutor>;

// \ref{internet.resolver.cons}, construct / copy / destroy

explicit basic_resolver(io_context& ctx);
explicit basic_resolver(const executor_type& ex);
template<class ExecutionContext> explicit basic_resolver(ExecutionContext& ctx);
basic_resolver(const basic_resolver&) = delete;
basic_resolver(basic_resolver&& rhs) noexcept;

Expand Down Expand Up @@ -3146,10 +3151,24 @@
\rSec2[internet.resolver.cons]{\tcode{ip::basic_resolver} constructors}

\begin{itemdecl}
explicit basic_resolver(io_context& ctx);
explicit basic_resolver(const executor_type& ex);
\end{itemdecl}

\begin{itemdescr}
\pnum
\postconditions \tcode{get_executor() == ex}.
\end{itemdescr}

\begin{itemdecl}
template<class ExecutionContext> explicit basic_resolver(ExecutionContext\& ctx);
\end{itemdecl}

\begin{itemdescr}
\pnum
\constraints
\tcode{is_convertible_v<Exec\-ution\-Context\&, execution_context\&>} is \tcode{true}
and \tcode{is_constructible_v<executor_type, typename Exec\-ution\-Context::executor_type>} is \tcode{true}.

\pnum
\postconditions \tcode{get_executor() == ctx.get_executor()}.
\end{itemdescr}
Expand Down Expand Up @@ -3506,6 +3525,8 @@
using endpoint = basic_endpoint<tcp>;
using resolver = basic_resolver<tcp>;
using socket = basic_stream_socket<tcp>;
template<class Executor>
using socket_for = basic_stream_socket<tcp, Executor>
using acceptor = basic_socket_acceptor<tcp>;
using iostream = basic_socket_iostream<tcp>;
class no_delay;
Expand Down Expand Up @@ -3614,6 +3635,8 @@
using endpoint = basic_endpoint<udp>;
using resolver = basic_resolver<udp>;
using socket = basic_datagram_socket<udp>;
template<class Executor>
using socket_for = basic_datagram_socket<udp, Executor>

// static members:
static constexpr udp v4() noexcept;
Expand Down
48 changes: 24 additions & 24 deletions src/socketalgorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
\rSec1[socket.algo.connect]{Synchronous connect operations}

\begin{itemdecl}
template<class Protocol, class EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol>& s,
template<class Protocol, class Executor, class EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints);
template<class Protocol, class EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol>& s,
template<class Protocol, class Executor, class EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints,
error_code& ec);
\end{itemdecl}
Expand All @@ -21,12 +21,12 @@
\end{itemdescr}

\begin{itemdecl}
template<class Protocol, class EndpointSequence, class ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol>& s,
template<class Protocol, class Executor, class EndpointSequence, class ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints,
ConnectCondition c);
template<class Protocol, class EndpointSequence, class ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol>& s,
template<class Protocol, class Executor, class EndpointSequence, class ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints,
ConnectCondition c, error_code& ec);
\end{itemdecl}
Expand Down Expand Up @@ -57,11 +57,11 @@
\end{itemdescr}

\begin{itemdecl}
template<class Protocol, class InputIterator>
InputIterator connect(basic_socket<Protocol>& s,
template<class Protocol, class Executor, class InputIterator>
InputIterator connect(basic_socket<Protocol, Executor>& s,
InputIterator first, InputIterator last);
template<class Protocol, class InputIterator>
InputIterator connect(basic_socket<Protocol>& s,
template<class Protocol, class Executor, class InputIterator>
InputIterator connect(basic_socket<Protocol, Executor>& s,
InputIterator first, InputIterator last,
error_code& ec);
\end{itemdecl}
Expand All @@ -72,12 +72,12 @@
\end{itemdescr}

\begin{itemdecl}
template<class Protocol, class InputIterator, class ConnectCondition>
InputIterator connect(basic_socket<Protocol>& s,
template<class Protocol, class Executor, class InputIterator, class ConnectCondition>
InputIterator connect(basic_socket<Protocol, Executor>& s,
InputIterator first, InputIterator last,
ConnectCondition c);
template<class Protocol, class InputIterator, class ConnectCondition>
InputIterator connect(basic_socket<Protocol>& s,
template<class Protocol, class Executor, class InputIterator, class ConnectCondition>
InputIterator connect(basic_socket<Protocol, Executor>& s,
InputIterator first, InputIterator last,
ConnectCondition c, error_code& ec);
\end{itemdecl}
Expand Down Expand Up @@ -112,8 +112,8 @@
\rSec1[socket.algo.async.connect]{Asynchronous connect operations}

\begin{itemdecl}
template<class Protocol, class EndpointSequence, class CompletionToken>
@\DEDUCED@ async_connect(basic_socket<Protocol>& s,
template<class Protocol, class Executor, class EndpointSequence, class CompletionToken>
@\DEDUCED@ async_connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints,
CompletionToken&& token);
\end{itemdecl}
Expand All @@ -127,9 +127,9 @@
\end{itemdescr}

\begin{itemdecl}
template<class Protocol, class EndpointSequence,
template<class Protocol, class Executor, class EndpointSequence,
class ConnectCondition, class CompletionToken>
@\DEDUCED@ async_connect(basic_socket<Protocol>& s,
@\DEDUCED@ async_connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints,
ConnectCondition c,
CompletionToken&& token);
Expand Down Expand Up @@ -168,8 +168,8 @@
\end{itemdescr}

\begin{itemdecl}
template<class Protocol, class InputIterator, class CompletionToken>
@\DEDUCED@ async_connect(basic_socket<Protocol>& s,
template<class Protocol, class Executor, class InputIterator, class CompletionToken>
@\DEDUCED@ async_connect(basic_socket<Protocol, Executor>& s,
InputIterator first, InputIterator last,
CompletionToken&& token);
\end{itemdecl}
Expand All @@ -184,9 +184,9 @@
\end{itemdescr}

\begin{itemdecl}
template<class Protocol, class InputIterator,
template<class Protocol, class Executor, class InputIterator,
class ConnectCondition, class CompletionToken>
@\DEDUCED@ async_connect(basic_socket<Protocol>& s,
@\DEDUCED@ async_connect(basic_socket<Protocol, Executor>& s,
InputIterator first, InputIterator last,
ConnectCondition c,
CompletionToken&& token);
Expand Down
Loading