diff --git a/cpp/include/ucxx/address.h b/cpp/include/ucxx/address.h index ba45786e..4306c85d 100644 --- a/cpp/include/ucxx/address.h +++ b/cpp/include/ucxx/address.h @@ -63,8 +63,7 @@ class Address : public Component { * * @returns The `shared_ptr` object. */ - [[nodiscard]] friend std::shared_ptr
createAddressFromWorker( - std::shared_ptr worker); + friend std::shared_ptr
createAddressFromWorker(std::shared_ptr worker); /** * @brief Constructor for `shared_ptr` from string. @@ -76,7 +75,7 @@ class Address : public Component { * * @returns The `shared_ptr` object. */ - [[nodiscard]] friend std::shared_ptr
createAddressFromString(std::string addressString); + friend std::shared_ptr
createAddressFromString(std::string addressString); /** * @brief Get the underlying `ucp_address_t*` handle. diff --git a/cpp/include/ucxx/constructors.h b/cpp/include/ucxx/constructors.h index f9e4d849..338bc874 100644 --- a/cpp/include/ucxx/constructors.h +++ b/cpp/include/ucxx/constructors.h @@ -32,87 +32,87 @@ class RequestTagMulti; class Worker; // Components -std::shared_ptr
createAddressFromWorker(std::shared_ptr worker); +[[nodiscard]] std::shared_ptr
createAddressFromWorker(std::shared_ptr worker); -std::shared_ptr
createAddressFromString(std::string addressString); +[[nodiscard]] std::shared_ptr
createAddressFromString(std::string addressString); -std::shared_ptr createContext(const ConfigMap ucxConfig, const uint64_t featureFlags); +[[nodiscard]] std::shared_ptr createContext(const ConfigMap ucxConfig, + const uint64_t featureFlags); -std::shared_ptr createEndpointFromHostname(std::shared_ptr worker, - std::string ipAddress, - uint16_t port, - bool endpointErrorHandling); +[[nodiscard]] std::shared_ptr createEndpointFromHostname(std::shared_ptr worker, + std::string ipAddress, + uint16_t port, + bool endpointErrorHandling); -std::shared_ptr createEndpointFromConnRequest(std::shared_ptr listener, - ucp_conn_request_h connRequest, - bool endpointErrorHandling); +[[nodiscard]] std::shared_ptr createEndpointFromConnRequest( + std::shared_ptr listener, ucp_conn_request_h connRequest, bool endpointErrorHandling); -std::shared_ptr createEndpointFromWorkerAddress(std::shared_ptr worker, - std::shared_ptr
address, - bool endpointErrorHandling); +[[nodiscard]] std::shared_ptr createEndpointFromWorkerAddress( + std::shared_ptr worker, std::shared_ptr
address, bool endpointErrorHandling); -std::shared_ptr createListener(std::shared_ptr worker, - uint16_t port, - ucp_listener_conn_callback_t callback, - void* callbackArgs); +[[nodiscard]] std::shared_ptr createListener(std::shared_ptr worker, + uint16_t port, + ucp_listener_conn_callback_t callback, + void* callbackArgs); -std::shared_ptr createWorker(std::shared_ptr context, - const bool enableDelayedSubmission, - const bool enableFuture); +[[nodiscard]] std::shared_ptr createWorker(std::shared_ptr context, + const bool enableDelayedSubmission, + const bool enableFuture); -std::shared_ptr createMemoryHandle( +[[nodiscard]] std::shared_ptr createMemoryHandle( std::shared_ptr context, const size_t size, void* buffer = nullptr, const ucs_memory_type_t memoryType = UCS_MEMORY_TYPE_HOST); -std::shared_ptr createRemoteKeyFromMemoryHandle( +[[nodiscard]] std::shared_ptr createRemoteKeyFromMemoryHandle( std::shared_ptr memoryHandle); -std::shared_ptr createRemoteKeyFromSerialized(std::shared_ptr endpoint, - SerializedRemoteKey serializedRemoteKey); +[[nodiscard]] std::shared_ptr createRemoteKeyFromSerialized( + std::shared_ptr endpoint, SerializedRemoteKey serializedRemoteKey); // Transfers -std::shared_ptr createRequestAm( +[[nodiscard]] std::shared_ptr createRequestAm( std::shared_ptr endpoint, const std::variant requestData, const bool enablePythonFuture, RequestCallbackUserFunction callbackFunction, RequestCallbackUserData callbackData); -std::shared_ptr createRequestEndpointClose( +[[nodiscard]] std::shared_ptr createRequestEndpointClose( std::shared_ptr endpoint, const data::EndpointClose requestData, const bool enablePythonFuture, RequestCallbackUserFunction callbackFunction, RequestCallbackUserData callbackData); -std::shared_ptr createRequestFlush(std::shared_ptr endpointOrWorker, - const data::Flush requestData, - const bool enablePythonFuture, - RequestCallbackUserFunction callbackFunction, - RequestCallbackUserData callbackData); +[[nodiscard]] std::shared_ptr createRequestFlush( + std::shared_ptr endpointOrWorker, + const data::Flush requestData, + const bool enablePythonFuture, + RequestCallbackUserFunction callbackFunction, + RequestCallbackUserData callbackData); -std::shared_ptr createRequestStream( +[[nodiscard]] std::shared_ptr createRequestStream( std::shared_ptr endpoint, const std::variant requestData, const bool enablePythonFuture); -std::shared_ptr createRequestTag( +[[nodiscard]] std::shared_ptr createRequestTag( std::shared_ptr endpointOrWorker, const std::variant requestData, const bool enablePythonFuture, RequestCallbackUserFunction callbackFunction, RequestCallbackUserData callbackData); -std::shared_ptr createRequestMem( +[[nodiscard]] std::shared_ptr createRequestMem( std::shared_ptr endpoint, const std::variant requestData, const bool enablePythonFuture, RequestCallbackUserFunction callbackFunction, RequestCallbackUserData callbackData); -std::shared_ptr createRequestTagMulti( +[[nodiscard]] std::shared_ptr createRequestTagMulti( std::shared_ptr endpoint, const std::variant requestData, const bool enablePythonFuture); diff --git a/cpp/include/ucxx/context.h b/cpp/include/ucxx/context.h index cfb42c7e..b0014e3e 100644 --- a/cpp/include/ucxx/context.h +++ b/cpp/include/ucxx/context.h @@ -72,8 +72,7 @@ class Context : public Component { * @param[in] featureFlags feature flags to be used at UCP context construction time. * @return The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createContext(ConfigMap ucxConfig, - const uint64_t featureFlags); + friend std::shared_ptr createContext(ConfigMap ucxConfig, const uint64_t featureFlags); /** * @brief `ucxx::Context` destructor diff --git a/cpp/include/ucxx/endpoint.h b/cpp/include/ucxx/endpoint.h index 024d865a..e54426db 100644 --- a/cpp/include/ucxx/endpoint.h +++ b/cpp/include/ucxx/endpoint.h @@ -157,11 +157,10 @@ class Endpoint : public Component { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createEndpointFromHostname( - std::shared_ptr worker, - std::string ipAddress, - uint16_t port, - bool endpointErrorHandling); + friend std::shared_ptr createEndpointFromHostname(std::shared_ptr worker, + std::string ipAddress, + uint16_t port, + bool endpointErrorHandling); /** * @brief Constructor for `shared_ptr`. @@ -185,8 +184,9 @@ class Endpoint : public Component { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createEndpointFromConnRequest( - std::shared_ptr listener, ucp_conn_request_h connRequest, bool endpointErrorHandling); + friend std::shared_ptr createEndpointFromConnRequest(std::shared_ptr listener, + ucp_conn_request_h connRequest, + bool endpointErrorHandling); /** * @brief Constructor for `shared_ptr`. @@ -207,8 +207,9 @@ class Endpoint : public Component { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createEndpointFromWorkerAddress( - std::shared_ptr worker, std::shared_ptr
address, bool endpointErrorHandling); + friend std::shared_ptr createEndpointFromWorkerAddress(std::shared_ptr worker, + std::shared_ptr
address, + bool endpointErrorHandling); /** * @brief Get the underlying `ucp_ep_h` handle. diff --git a/cpp/include/ucxx/listener.h b/cpp/include/ucxx/listener.h index 435f6524..7fff1607 100644 --- a/cpp/include/ucxx/listener.h +++ b/cpp/include/ucxx/listener.h @@ -92,11 +92,10 @@ class Listener : public Component { * * @returns The `shared_ptr` object. */ - [[nodiscard]] friend std::shared_ptr createListener( - std::shared_ptr worker, - uint16_t port, - ucp_listener_conn_callback_t callback, - void* callbackArgs); + friend std::shared_ptr createListener(std::shared_ptr worker, + uint16_t port, + ucp_listener_conn_callback_t callback, + void* callbackArgs); /** * @brief Constructor for `shared_ptr`. diff --git a/cpp/include/ucxx/memory_handle.h b/cpp/include/ucxx/memory_handle.h index bcd9d369..28384db0 100644 --- a/cpp/include/ucxx/memory_handle.h +++ b/cpp/include/ucxx/memory_handle.h @@ -109,11 +109,10 @@ class MemoryHandle : public Component { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createMemoryHandle( - std::shared_ptr context, - const size_t size, - void* buffer, - const ucs_memory_type_t memoryType); + friend std::shared_ptr createMemoryHandle(std::shared_ptr context, + const size_t size, + void* buffer, + const ucs_memory_type_t memoryType); ~MemoryHandle(); diff --git a/cpp/include/ucxx/remote_key.h b/cpp/include/ucxx/remote_key.h index 6e5fca60..85d14d74 100644 --- a/cpp/include/ucxx/remote_key.h +++ b/cpp/include/ucxx/remote_key.h @@ -112,7 +112,7 @@ class RemoteKey : public Component { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createRemoteKeyFromMemoryHandle( + friend std::shared_ptr createRemoteKeyFromMemoryHandle( std::shared_ptr memoryHandle); /** @@ -140,7 +140,7 @@ class RemoteKey : public Component { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createRemoteKeyFromSerialized( + friend std::shared_ptr createRemoteKeyFromSerialized( std::shared_ptr endpoint, SerializedRemoteKey serializedRemoteKey); ~RemoteKey(); diff --git a/cpp/include/ucxx/request_am.h b/cpp/include/ucxx/request_am.h index b7937c0c..0b40d9a7 100644 --- a/cpp/include/ucxx/request_am.h +++ b/cpp/include/ucxx/request_am.h @@ -89,7 +89,7 @@ class RequestAm : public Request { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createRequestAm( + friend std::shared_ptr createRequestAm( std::shared_ptr endpoint, const std::variant requestData, const bool enablePythonFuture, diff --git a/cpp/include/ucxx/request_endpoint_close.h b/cpp/include/ucxx/request_endpoint_close.h index f1299b7c..754c35d4 100644 --- a/cpp/include/ucxx/request_endpoint_close.h +++ b/cpp/include/ucxx/request_endpoint_close.h @@ -75,7 +75,7 @@ class RequestEndpointClose : public Request { * * @returns The `shared_ptr` object. */ - [[nodiscard]] friend std::shared_ptr createRequestEndpointClose( + friend std::shared_ptr createRequestEndpointClose( std::shared_ptr endpoint, const data::EndpointClose requestData, const bool enablePythonFuture, diff --git a/cpp/include/ucxx/request_flush.h b/cpp/include/ucxx/request_flush.h index 18a2f55c..9502dfe4 100644 --- a/cpp/include/ucxx/request_flush.h +++ b/cpp/include/ucxx/request_flush.h @@ -86,7 +86,7 @@ class RequestFlush : public Request { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createRequestFlush( + friend std::shared_ptr createRequestFlush( std::shared_ptr endpointOrWorker, const data::Flush requestData, const bool enablePythonFuture, diff --git a/cpp/include/ucxx/request_mem.h b/cpp/include/ucxx/request_mem.h index ed5efc7b..31cb0d1c 100644 --- a/cpp/include/ucxx/request_mem.h +++ b/cpp/include/ucxx/request_mem.h @@ -88,7 +88,7 @@ class RequestMem : public Request { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createRequestMem( + friend std::shared_ptr createRequestMem( std::shared_ptr endpoint, const std::variant requestData, const bool enablePythonFuture, diff --git a/cpp/include/ucxx/request_stream.h b/cpp/include/ucxx/request_stream.h index b32eb8c0..5233682a 100644 --- a/cpp/include/ucxx/request_stream.h +++ b/cpp/include/ucxx/request_stream.h @@ -67,7 +67,7 @@ class RequestStream : public Request { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createRequestStream( + friend std::shared_ptr createRequestStream( std::shared_ptr endpoint, const std::variant requestData, const bool enablePythonFuture); diff --git a/cpp/include/ucxx/request_tag.h b/cpp/include/ucxx/request_tag.h index 41a78eb8..6ac5fe0e 100644 --- a/cpp/include/ucxx/request_tag.h +++ b/cpp/include/ucxx/request_tag.h @@ -84,7 +84,7 @@ class RequestTag : public Request { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createRequestTag( + friend std::shared_ptr createRequestTag( std::shared_ptr endpointOrWorker, const std::variant requestData, const bool enablePythonFuture, diff --git a/cpp/include/ucxx/request_tag_multi.h b/cpp/include/ucxx/request_tag_multi.h index 4cec0cdc..4e9c3af8 100644 --- a/cpp/include/ucxx/request_tag_multi.h +++ b/cpp/include/ucxx/request_tag_multi.h @@ -171,7 +171,7 @@ class RequestTagMulti : public Request { * * @returns Request to be subsequently checked for the completion and its state. */ - [[nodiscard]] friend std::shared_ptr createRequestTagMulti( + friend std::shared_ptr createRequestTagMulti( std::shared_ptr endpoint, const std::variant requestData, const bool enablePythonFuture); diff --git a/cpp/include/ucxx/worker.h b/cpp/include/ucxx/worker.h index 30fd1220..5443ff6c 100644 --- a/cpp/include/ucxx/worker.h +++ b/cpp/include/ucxx/worker.h @@ -187,9 +187,9 @@ class Worker : public Component { * `ucxx::Request`, currently used only by `ucxx::python::Worker`. * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr createWorker(std::shared_ptr context, - const bool enableDelayedSubmission, - const bool enableFuture); + friend std::shared_ptr createWorker(std::shared_ptr context, + const bool enableDelayedSubmission, + const bool enableFuture); /** * @brief `ucxx::Worker` destructor. diff --git a/cpp/python/include/ucxx/python/constructors.h b/cpp/python/include/ucxx/python/constructors.h index cb2286ed..17b23886 100644 --- a/cpp/python/include/ucxx/python/constructors.h +++ b/cpp/python/include/ucxx/python/constructors.h @@ -19,16 +19,17 @@ class Worker; namespace python { -std::shared_ptr<::ucxx::Future> createFuture(std::shared_ptr<::ucxx::Notifier> notifier); +[[nodiscard]] std::shared_ptr<::ucxx::Future> createFuture( + std::shared_ptr<::ucxx::Notifier> notifier); -std::shared_ptr<::ucxx::Future> createFutureWithEventLoop( +[[nodiscard]] std::shared_ptr<::ucxx::Future> createFutureWithEventLoop( PyObject* asyncioEventLoop, std::shared_ptr<::ucxx::Notifier> notifier); -std::shared_ptr<::ucxx::Notifier> createNotifier(); +[[nodiscard]] std::shared_ptr<::ucxx::Notifier> createNotifier(); -std::shared_ptr<::ucxx::Worker> createWorker(std::shared_ptr context, - const bool enableDelayedSubmission, - const bool enableFuture); +[[nodiscard]] std::shared_ptr<::ucxx::Worker> createWorker(std::shared_ptr context, + const bool enableDelayedSubmission, + const bool enableFuture); } // namespace python diff --git a/cpp/python/include/ucxx/python/notifier.h b/cpp/python/include/ucxx/python/notifier.h index 2e72ebc8..d5d9449f 100644 --- a/cpp/python/include/ucxx/python/notifier.h +++ b/cpp/python/include/ucxx/python/notifier.h @@ -84,7 +84,7 @@ class Notifier : public ::ucxx::Notifier { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr<::ucxx::Notifier> createNotifier(); + friend std::shared_ptr<::ucxx::Notifier> createNotifier(); /** * @brief Virtual destructor. diff --git a/cpp/python/include/ucxx/python/python_future.h b/cpp/python/include/ucxx/python/python_future.h index bbfab7ba..a55f8c5c 100644 --- a/cpp/python/include/ucxx/python/python_future.h +++ b/cpp/python/include/ucxx/python/python_future.h @@ -64,8 +64,7 @@ class Future : public ::ucxx::Future { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr<::ucxx::Future> createFuture( - std::shared_ptr<::ucxx::Notifier> notifier); + friend std::shared_ptr<::ucxx::Future> createFuture(std::shared_ptr<::ucxx::Notifier> notifier); /** * @brief Constructor of `shared_ptr`. @@ -81,7 +80,7 @@ class Future : public ::ucxx::Future { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr<::ucxx::Future> createFutureWithEventLoop( + friend std::shared_ptr<::ucxx::Future> createFutureWithEventLoop( PyObject* asyncioEventLoop, std::shared_ptr<::ucxx::Notifier> notifier); /** diff --git a/cpp/python/include/ucxx/python/worker.h b/cpp/python/include/ucxx/python/worker.h index 3140305a..c09d590a 100644 --- a/cpp/python/include/ucxx/python/worker.h +++ b/cpp/python/include/ucxx/python/worker.h @@ -82,8 +82,9 @@ class Worker : public ::ucxx::Worker { * * @returns The `shared_ptr` object */ - [[nodiscard]] friend std::shared_ptr<::ucxx::Worker> createWorker( - std::shared_ptr context, const bool enableDelayedSubmission, const bool enableFuture); + friend std::shared_ptr<::ucxx::Worker> createWorker(std::shared_ptr context, + const bool enableDelayedSubmission, + const bool enableFuture); /** * @brief Populate the Python futures pool.