2
0
mirror of https://github.com/boostorg/cobalt.git synced 2026-01-19 04:02:16 +00:00

added dtors decls to all ops.

This commit is contained in:
Klemens Morgenstern
2025-07-04 08:14:58 +08:00
committed by Klemens Morgenstern
parent 57e4141d82
commit a52639e3e0
10 changed files with 27 additions and 7 deletions

View File

@@ -35,6 +35,7 @@ struct BOOST_SYMBOL_VISIBLE acceptor
accept_op(asio::basic_socket_acceptor<protocol_type, executor> & acceptor, socket& sock)
: acceptor_(acceptor), sock_(sock) {}
~accept_op() = default;
protected:
asio::basic_socket_acceptor<protocol_type, executor> &acceptor_;
socket & sock_;
@@ -46,6 +47,7 @@ struct BOOST_SYMBOL_VISIBLE acceptor
void initiate(completion_handler<system::error_code, stream_socket> h) override;
accept_stream_op(asio::basic_socket_acceptor<protocol_type, executor> & acceptor) : acceptor_(acceptor) {}
~accept_stream_op() = default;
private:
asio::basic_socket_acceptor<protocol_type, executor> &acceptor_;
stream_socket sock_{acceptor_.get_executor()};
@@ -57,6 +59,7 @@ struct BOOST_SYMBOL_VISIBLE acceptor
void initiate(completion_handler<system::error_code, seq_packet_socket> h) override;
accept_seq_packet_op(asio::basic_socket_acceptor<protocol_type, executor> & acceptor) : acceptor_(acceptor) {}
~accept_seq_packet_op() = default;
private:
asio::basic_socket_acceptor<protocol_type, executor> &acceptor_;
seq_packet_socket sock_{acceptor_.get_executor()};
@@ -70,7 +73,7 @@ struct BOOST_SYMBOL_VISIBLE acceptor
wait_op(asio::basic_socket_acceptor<protocol_type, executor> & acceptor, wait_type wt)
: acceptor_(acceptor), wt_(wt) {}
~wait_op() = default;
private:
asio::basic_socket_acceptor<protocol_type, executor> &acceptor_;
wait_type wt_;

View File

@@ -48,6 +48,7 @@ struct [[nodiscard]] write_op final : op<system::error_code, std::size_t>
if (try_implementation_)
try_implementation_(this_, buffer, std::move(handler));
}
~write_op() = default;
private:
void *this_;
@@ -84,6 +85,7 @@ struct [[nodiscard]] read_op final : op<system::error_code, std::size_t>
if (try_implementation_)
try_implementation_(this_, buffer, std::move(handler));
}
~read_op() = default;
private:
void *this_;
@@ -122,7 +124,7 @@ struct [[nodiscard]] write_at_op final : op<system::error_code, std::size_t>
if (try_implementation_)
try_implementation_(this_, offset, buffer, std::move(handler));
}
~write_at_op() = default;
private:
void *this_;
implementation_t *implementation_;
@@ -160,7 +162,7 @@ struct [[nodiscard]] read_at_op final : op<system::error_code, std::size_t>
if (try_implementation_)
try_implementation_(this_, offset, buffer, std::move(handler));
}
~read_at_op() = default;
private:
void *this_;
implementation_t *implementation_;
@@ -193,6 +195,7 @@ struct [[nodiscard]] wait_op final : op<system::error_code>
if (try_implementation_)
try_implementation_(this_, std::move(handler));
}
~wait_op() = default;
private:
void *this_;

View File

@@ -20,6 +20,7 @@ struct BOOST_SYMBOL_VISIBLE read_all final : op<system::error_code, std::size_t>
{
read_op step;
read_all(read_op op) : step(op) {}
~read_all() = default;
BOOST_COBALT_IO_DECL void initiate(completion_handler<system::error_code, std::size_t>) final;
};
@@ -40,6 +41,7 @@ struct BOOST_SYMBOL_VISIBLE read_all_at final : op<system::error_code, std::siz
{
read_at_op step;
read_all_at(read_at_op op) : step(op) {}
~read_all_at() = default;
BOOST_COBALT_IO_DECL void initiate(completion_handler<system::error_code, std::size_t>) final;
};

View File

@@ -38,6 +38,7 @@ struct BOOST_SYMBOL_VISIBLE resolver
resolve_op_(asio::ip::basic_resolver<protocol_type, executor> & resolver,
std::string_view host, std::string_view service, flags flags_ = {})
: resolver_(resolver), host_(host), service_(service), flags_(flags_) {}
~resolve_op_() = default;
private:
asio::ip::basic_resolver<protocol_type, executor> & resolver_;
std::string_view host_;
@@ -56,14 +57,14 @@ struct BOOST_SYMBOL_VISIBLE resolver
asio::ip::basic_resolver<protocol_type, executor> resolver_;
};
struct BOOST_SYMBOL_VISIBLE lookup : op<system::error_code, endpoint_sequence>
struct BOOST_SYMBOL_VISIBLE lookup final : op<system::error_code, endpoint_sequence>
{
lookup(std::string_view host, std::string_view service,
const executor & exec = this_thread::get_executor(),
resolver::flags flags_ = {})
: host_(host), service_(service), resolver_{exec}, flags_{flags_} {}
BOOST_COBALT_IO_DECL void initiate(completion_handler<system::error_code, endpoint_sequence> h) final override;
~lookup() = default;
private:
std::string_view host_;
std::string_view service_;

View File

@@ -38,6 +38,7 @@ struct BOOST_SYMBOL_VISIBLE seq_packet_socket final : socket
BOOST_COBALT_IO_DECL
void initiate(completion_handler<system::error_code, std::size_t> handler) final;
~send_op() = default;
private:
asio::basic_seq_packet_socket<protocol_type, executor> & socket_;
};
@@ -53,6 +54,7 @@ struct BOOST_SYMBOL_VISIBLE seq_packet_socket final : socket
BOOST_COBALT_IO_DECL
void initiate(completion_handler<system::error_code, std::size_t> handler) final;
~receive_op() = default;
private:
asio::basic_seq_packet_socket<protocol_type, executor> & socket_;
};

View File

@@ -35,6 +35,7 @@ struct BOOST_SYMBOL_VISIBLE signal_set
BOOST_COBALT_IO_DECL
void initiate(completion_handler<system::error_code, int> h) final;
wait_op_(asio::basic_signal_set<cobalt::executor> & signal_set) : signal_set_(signal_set) {}
~wait_op_() = default;
private:
asio::basic_signal_set<cobalt::executor> & signal_set_;
};

View File

@@ -28,6 +28,7 @@ struct BOOST_SYMBOL_VISIBLE steady_sleep final : op<system::error_code>
h({});
}
BOOST_COBALT_IO_DECL void initiate(completion_handler<system::error_code> h) final override;
~steady_sleep() = default;
std::optional< asio::basic_waitable_timer<std::chrono::steady_clock, asio::wait_traits<std::chrono::steady_clock>, executor> > timer_;
};
@@ -47,6 +48,7 @@ struct BOOST_SYMBOL_VISIBLE system_sleep final : op<system::error_code>
}
BOOST_COBALT_IO_DECL void initiate(completion_handler<system::error_code> h) final override;
~system_sleep() = default;
std::optional<asio::basic_waitable_timer<std::chrono::system_clock, asio::wait_traits<std::chrono::system_clock>, executor> > timer_;
};

View File

@@ -95,7 +95,7 @@ struct BOOST_SYMBOL_VISIBLE socket
wait_op(wait_type wt, socket & sock) :
wt(wt), sock_(sock) {}
~wait_op() = default;
private:
socket & sock_;
@@ -114,6 +114,7 @@ struct BOOST_SYMBOL_VISIBLE socket
connect_op(struct endpoint endpoint, socket & socket) :
endpoint(endpoint), sock_(socket) {}
~connect_op() = default;
private:
socket & sock_;
};
@@ -132,6 +133,7 @@ struct BOOST_SYMBOL_VISIBLE socket
ranged_connect_op(endpoint_sequence eps, socket & socket) :
endpoints(eps), sock_(socket) {}
~ranged_connect_op() = default;
private:
socket & sock_;
};

View File

@@ -87,6 +87,7 @@ struct BOOST_SYMBOL_VISIBLE stream final : private detail::stream_impl, socket,
void initiate(completion_handler<system::error_code> h) final;
handshake_op_(handshake_type type, bool upgraded, asio::ssl::stream<asio::basic_stream_socket<protocol_type, executor>> & stream_socket)
: type_(type), upgraded_(upgraded), stream_socket_(stream_socket) {}
~handshake_op_() = default;
private:
handshake_type type_;
bool upgraded_;
@@ -103,6 +104,7 @@ struct BOOST_SYMBOL_VISIBLE stream final : private detail::stream_impl, socket,
handshake_buffer_op_(handshake_type type, bool upgraded, const_buffer_sequence buffer_,
asio::ssl::stream<asio::basic_stream_socket<protocol_type, executor>> & stream_socket)
: type_(type), upgraded_(upgraded), buffer_(buffer_), stream_socket_(stream_socket) {}
~handshake_buffer_op_() = default;
private:
handshake_type type_;
bool upgraded_;
@@ -119,6 +121,7 @@ struct BOOST_SYMBOL_VISIBLE stream final : private detail::stream_impl, socket,
void initiate(completion_handler<system::error_code> h) final;
shutdown_op_(bool upgraded, asio::ssl::stream<asio::basic_stream_socket<protocol_type, executor>> & stream_socket)
: upgraded_(upgraded), stream_socket_(stream_socket) {}
~shutdown_op_() = default;
private:
bool upgraded_;
asio::ssl::stream<asio::basic_stream_socket<protocol_type, executor>> &stream_socket_;

View File

@@ -21,6 +21,7 @@ struct BOOST_SYMBOL_VISIBLE write_all final : op<system::error_code, std::size_
write_op step;
write_all(write_op op) : step(op) {}
~write_all() = default;
BOOST_COBALT_IO_DECL void initiate(completion_handler<system::error_code, std::size_t>) final;
};
@@ -40,7 +41,7 @@ struct BOOST_SYMBOL_VISIBLE write_all_at final : op<system::error_code, std::si
{
write_at_op step;
write_all_at(write_at_op op) : step(op) {}
~write_all_at() = default;
BOOST_COBALT_IO_DECL void initiate(completion_handler<system::error_code, std::size_t>) final;
};