20.1.7.20. RpcServerReader¶
-
template<typename T>
class RpcServerReader¶ An interface for a server-side RPC reader.
Would be used to read inputs from a client on an operation with
@feed
annotated inputs.Public Functions
-
virtual ~RpcServerReader() noexcept = default¶
Destructor.
-
virtual bool read(T &value) = 0¶
Blocking read operation.
Will block until an input is available or the input feed has finished.
- Parameters:
value – The value to read the input into.
- Throws:
RpcBrokenPipeException – if the communication with the client breaks.
RpcFeedCancelledException – if the client cancels the input feed.
- Returns:
True if a value was read, false if the feed has finished.
-
virtual bool read(T &value, const eprosima::fastdds::dds::Duration_t &timeout) = 0¶
Blocking read operation with timeout.
Will block until an input is available, the input feed has finished, or the timeout expires.
- Parameters:
value – The value to read the input into.
timeout – The maximum time to wait for an input.
- Throws:
RpcTimeoutException – if the timeout expires.
RpcBrokenPipeException – if the communication with the client breaks.
RpcFeedCancelledException – if the client cancels the input feed.
- Returns:
True if a value was read, false if the feed has finished.
-
virtual ~RpcServerReader() noexcept = default¶