| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
Replier Class Referenceabstract

Base class for a Replier in the RPC communication. More...

`#include <Replier.hpp>`

Inheritance diagram for Replier:
[legend]

## Public Member 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.
virtual ReturnCode_t | take_request (void *data, RequestInfo &info)=0
| Take a request message from the Replier DataReader's history.
virtual ReturnCode_t | take_request (LoanableCollection &data, LoanableSequence< RequestInfo > &info)=0
| Take all request messages stored in the Replier DataReader's history.
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.
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.
Public Member Functions inherited from RPCEntity
virtual ReturnCode_t | enable ()=0
| Enables the entity.
virtual ReturnCode_t | close ()=0
| Disables the entity.
virtual bool | is_enabled () const =0
| Check if the entity is enabled.

## Protected Member Functions

| ~Replier ()=default
| Destructor.
Protected Member Functions inherited from RPCEntity
| ~RPCEntity ()=default
| Destructor.

## Detailed Description

Base class for a Replier in the RPC communication.

## Constructor & Destructor Documentation

## ◆ ~Replier()

~Replier | ( |  | ) |

protected default

Destructor.

## Member Function Documentation

## ◆ get_replier_reader()

virtual DataReader * get_replier_reader | ( |  | ) | const

pure virtual

Getter for the Replier's DataReader.

## ◆ get_replier_writer()

virtual DataWriter * get_replier_writer | ( |  | ) | const

pure virtual

Getter for the Replier's DataWriter.

## ◆ get_service_name()

virtual const std::string & get_service_name | ( |  | ) | const

pure virtual

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

## ◆ return_loan()

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

pure virtual

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

  [in,out] | data | A LoanableCollection object where the received data samples were obtained from an earlier invocation of take_request on this Replier.
  [in,out] | info | A LoanableSequence where the received request infos were obtained from an earlier invocation of take_request on this Replier.

## ◆ send_reply()

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

pure virtual

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
  RETCODE_PRECONDITION_NOT_MET if the replier is not enabled
  RETCODE_NO_DATA if the requester that sent the request has disconnected (this usually means that the reply can be dropped)
  RETCODE_TIMEOUT if waiting for the requester to be fully matched timed out
  a ReturnCode from the underlying DataWriter

## ◆ take_request() [1/2]

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

pure virtual

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

## ◆ take_request() [2/2]

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

pure virtual

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

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

- include/fastdds/dds/rpc/Replier.hpp