20.1.7.13. RpcClientReader¶
-
template<typename T>
class RpcClientReader¶ An interface for a client-side RPC reader.
Would be used to read replies from a server on an operation with a
@feed
annotated return type.Public Functions
-
virtual ~RpcClientReader() = default¶
Destructor.
-
virtual bool read(T &value) = 0¶
Blocking read operation.
Will block until a reply is available or the replies feed has finished.
- Parameters:
value – The value to read the reply into.
- Throws:
RpcOperationError – if the server communicates an error.
RpcBrokenPipeException – if the communication with the server breaks.
- Returns:
True if a reply was read, false if the feed has finished or has been cancelled.
-
virtual bool read(T &value, const eprosima::fastdds::dds::Duration_t &timeout) = 0¶
Blocking read operation with timeout.
Will block until a reply is available, the replies feed has finished, or the timeout expires.
- Parameters:
value – The value to read the reply into.
timeout – The maximum time to wait for a reply.
- Throws:
RpcOperationError – if the server communicates an error.
RpcBrokenPipeException – if the communication with the server breaks.
RpcTimeoutException – if the timeout expires.
- Returns:
True if a reply was read, false if the feed has finished or has been cancelled.
-
virtual void cancel() = 0¶
Cancel the replies feed.
Will tell the server to stop sending replies, and block until the server acknowledges the cancellation. The replies feed would then be finished locally, so all pending read operations will return false.
- Throws:
RpcBrokenPipeException – if the communication with the server breaks.
-
virtual ~RpcClientReader() = default¶