Class PoseTreeUCXClient
Defined in File pose_tree_ucx_client.hpp
-
class PoseTreeUCXClient
UCX-based client for remote PoseTree synchronization.
This class provides a client that connects to a PoseTreeUCXServer to synchronize PoseTree updates across distributed systems using UCX (Unified Communication X).
WarningThis class is NOT thread-safe for its public methods. All public methods must be called from the same thread.
Public Types
-
enum class Error
Error codes used by this class.
Values:
-
enumerator kAlreadyConnected
kAlreadyConnected is returned when trying to connect while already connected
-
enumerator kInvalidArgument
kInvalidArgument is returned when invalid parameters are provided (e.g., empty host, invalid port)
-
enumerator kConnectionFailed
kConnectionFailed is returned when connection to the server fails
-
enumerator kNotConnected
kNotConnected is returned when trying to perform operations that require a connection
-
enumerator kThreadError
kThreadError is returned when thread operations fail
-
enumerator kShutdownError
kShutdownError is returned when errors occur during shutdown/disconnect
-
enumerator kInternalError
kInternalError is returned for unexpected internal errors
-
enumerator kAlreadyConnected
-
using unexpected = holoscan::unexpected<Error>
Unexpected type used by this class.
Public Functions
-
~PoseTreeUCXClient()
Destructor - ensures clean shutdown.
Automatically disconnects if still connected, joins the worker thread, and releases all resources. Any errors during disconnect are logged but do not throw exceptions (no-throw guarantee).
-
PoseTreeUCXClient(const PoseTreeUCXClient&) = delete
-
PoseTreeUCXClient &operator=(const PoseTreeUCXClient&) = delete
-
PoseTreeUCXClient(PoseTreeUCXClient&&) = delete
-
PoseTreeUCXClient &operator=(PoseTreeUCXClient&&) = delete
-
expected<void> connect(std::string_view host, uint16_t port, bool request_snapshot)
Connect to a PoseTreeUCXServer.
Starts an internal worker thread that handles UCX communication with the server. The thread runs until disconnect() is called or the destructor runs.
NoteThis method blocks until the connection is established or fails
- Parameters
host – The hostname or IP address of the server
port – The port number of the server
request_snapshot – Whether to request a full snapshot of the pose tree upon connection
- Returns
Success (void) or error status
-
expected<void> disconnect()
Disconnect from the server.
Signals the worker thread to stop, waits for it to finish (join), and cleans up all UCX resources. This method is automatically called by the destructor if needed.
NoteThis method is idempotent - calling it when already disconnected returns success
NoteThis method blocks until the worker thread has fully stopped
- Returns
Success (void) or error status
-
inline bool is_running() const
Public Static Functions
-
static const char *error_to_str(Error error)
Convert an error code to a human readable error string.
- Parameters
error – Error code to convert.
- Returns
Human-readable error string.
-
enum class Error