| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
RpcClientReader< T > Class Template Referenceabstract

An interface for a client-side RPC reader. More...

`#include <RpcClientReader.hpp>`

## Public Member Functions

virtual | ~RpcClientReader ()=default
| Destructor.
virtual bool | read (T &value)=0
| Blocking read operation.
virtual bool | read (T &value, const eprosima::fastdds::dds::Duration_t &timeout)=0
| Blocking read operation with timeout.
virtual void | cancel ()=0
| Cancel the replies feed.

## Detailed Description

template<typename T>
class eprosima::fastdds::dds::rpc::RpcClientReader< T >

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.

## Constructor & Destructor Documentation

## ◆ ~RpcClientReader()

template<typename T>

virtual ~RpcClientReader | ( |  | ) |

virtual default

Destructor.

## Member Function Documentation

## ◆ cancel()

template<typename T>

virtual void cancel | ( |  | ) |

pure virtual

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.

Exceptions

  RpcBrokenPipeException | if the communication with the server breaks.

## ◆ read() [1/2]

template<typename T>

virtual bool read | ( | T & | value | ) |

pure virtual

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.

Returns
  True if a reply was read, false if the feed has finished or has been cancelled.

Exceptions

  RpcOperationError | if the server communicates an error.
  RpcBrokenPipeException | if the communication with the server breaks.

## ◆ read() [2/2]

template<typename T>

virtual bool read | ( | T & | value,
|  | const eprosima::fastdds::dds::Duration_t & | timeout )

pure virtual

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.

Returns
  True if a reply was read, false if the feed has finished or has been cancelled.

Exceptions

  RpcOperationError | if the server communicates an error.
  RpcBrokenPipeException | if the communication with the server breaks.
  RpcTimeoutException | if the timeout expires.

The documentation for this class was generated from the following file:

- include/fastdds/dds/rpc/interfaces/RpcClientReader.hpp