Skip to content

Commit 4afe423

Browse files
author
Andrei Popescu
authored
Extend Network.h abstract API Doxygen for Cancel. (#1247)
The current Doxygen description for the API Network::Cancel() did not state clearly how the cancelled NetworkResponse will look like. This commit adds the missing description with an example code snippet to illustrate how the response will look like so that the user can check the appropriate parameters properly. Resolves: #1246 Signed-off-by: Andrei Popescu <andrei.popescu@here.com>
1 parent b1d8384 commit 4afe423

File tree

1 file changed

+19
-3
lines changed
  • olp-cpp-sdk-core/include/olp/core/http

1 file changed

+19
-3
lines changed

olp-cpp-sdk-core/include/olp/core/http/Network.h

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,26 @@ class CORE_API Network {
9292
DataCallback data_callback = nullptr) = 0;
9393

9494
/**
95-
* @brief Cancels the request using `RequestId`.
95+
* @brief Cancels the request associated with the given `RequestId`.
9696
*
97-
* When the request is canceled, the user receives a final `Callback` with
98-
* an appropriate `NetworkResponse` marked as canceled.
97+
* When the request is canceled, the user receives a final callback with
98+
* an appropriate `NetworkResponse` marked as canceled as illustrated in the
99+
* following code snippet:
100+
*
101+
* @code
102+
*
103+
* auto response =
104+
* http::NetworkResponse()
105+
* .WithRequestId(id)
106+
* .WithBytesDownloaded(download_bytes)
107+
* .WithBytesUploaded(upload_bytes)
108+
* .WithStatus(static_cast<int>(http::ErrorCode::CANCELLED_ERROR))
109+
* .WithError("Cancelled");
110+
*
111+
* @endcode
112+
*
113+
* @note If the provided `RequestId` does not match any pending requests, no
114+
* operations will be performed, and no callbacks will be called.
99115
*
100116
* @param[in] id The unique ID of the request that you want to cancel.
101117
*/

0 commit comments

Comments
 (0)