20.1.7.1. Replier

class Replier : public eprosima::fastdds::dds::rpc::RPCEntity

Base class for a Replier in the RPC communication.

Public Functions

virtual const std::string &get_service_name() const = 0

Returns the name of the service to which the replier belongs.

virtual ReturnCode_t send_reply(void *data, const RequestInfo &info) = 0

Send a reply message.

Parameters:
  • data – Data to send

  • info – Information about the reply sample. This information is used to match the reply with the request through the SampleIdentity

Returns:

RETCODE_OK if the reply was sent successfully or a ReturnCode related to the specific error otherwise

virtual ReturnCode_t take_request(void *data, RequestInfo &info) = 0

Take a request message from the Replier DataReader’s history.

Parameters:
  • data – Data to receive the request

  • info – Information about the request sample

Returns:

RETCODE_OK if the request was taken successfully or a ReturnCode related to the specific error otherwise

virtual ReturnCode_t take_request(LoanableCollection &data, LoanableSequence<RequestInfo> &info) = 0

Take all request messages stored in the Replier DataReader’s history.

Note

This method does not allow to take only the samples associated to a given request. User must implement a zero-copy solution to link request and reply samples.

Parameters:
  • data – Data to receive the request

  • info – Information about the request sample

Returns:

RETCODE_OK if the request was taken successfully or a ReturnCode related to the specific error otherwise

virtual ReturnCode_t return_loan(LoanableCollection &data, LoanableSequence<RequestInfo> &info) = 0

This operation indicates to the Replier’s DataReader that the application is done accessing the collection of Request datas and infos obtained by some earlier invocation of take_request.

Parameters:
  • data[inout] A LoanableCollection object where the received data samples were obtained from an earlier invocation of take_request on this Replier.

  • info[inout] A LoanableSequence where the received request infos were obtained from an earlier invocation of take_request on this Replier.

virtual DataWriter *get_replier_writer() const = 0

Getter for the Replier’s DataWriter.

virtual DataReader *get_replier_reader() const = 0

Getter for the Replier’s DataReader.