slbotbm commented on code in PR #3733:
URL: https://github.com/apache/iggy/pull/3733#discussion_r3798813108


##########
foreign/cpp/include/iggy.hpp:
##########
@@ -370,4 +449,441 @@ class TopicOption final {
     TopicOption() = delete;
 };
 
+/**
+ * @brief Exception thrown when an Iggy client operation fails.
+ */
+class IggyException : public std::runtime_error {
+  public:
+    explicit IggyException(const char *message) : std::runtime_error(message) 
{}
+    explicit IggyException(const std::string &message) : 
std::runtime_error(message) {}
+};
+
+/**
+ * @brief Owning client connection to an Apache Iggy server.
+ *
+ * Create instances with Builder or FromConnectionString(). The client owns a
+ * handle to the underlying Rust client. Destroying the C++ object releases 
that
+ * handle, but does not stop heartbeat processing started by Connect().
+ *
+ * Builder initializes a TCP client. To use QUIC, HTTP, or WebSocket, create 
the
+ * client with FromConnectionString().
+ *
+ * @code{.cpp}
+ * auto client = iggy::IggyBlockingClient::Builder()
+ *                   .WithServerAddress("127.0.0.1:8090")
+ *                   .Build();
+ * client.Connect();
+ * client.Login("iggy", "iggy");
+ * client.Shutdown();
+ * @endcode
+ */
+class IggyBlockingClient final {
+  public:
+    class Builder;
+
+    /** @brief IggyBlockingClient is move-only. */
+    IggyBlockingClient(const IggyBlockingClient &)            = delete;
+    IggyBlockingClient &operator=(const IggyBlockingClient &) = delete;
+
+    /**
+     * @brief Transfers ownership of a client.
+     * @param other Client whose connection ownership is transferred.
+     *
+     * The moved-from client may be destroyed or assigned a new value, but must
+     * not be used for client operations.
+     */
+    IggyBlockingClient(IggyBlockingClient &&other) noexcept;
+
+    /**
+     * @brief Replaces this client by taking ownership from another client.
+     * @param other Client whose connection ownership is transferred.
+     * @return Reference to this client.
+     *
+     * Any Rust client handle currently owned by this object is released first.
+     * Call Shutdown() before replacing a connected client. The moved-from
+     * client must not be used for client operations.
+     */
+    IggyBlockingClient &operator=(IggyBlockingClient &&other) noexcept;
+
+    /**
+     * @brief Releases the handle to the underlying Rust client.
+     *
+     * Destruction does not stop the heartbeat task started by Connect(). For

Review Comment:
   This was left over from the previous change. Fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to