| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
Requester Class Referenceabstract

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

`#include <Requester.hpp>`

Inheritance diagram for Requester:
[legend]

## Public Member Functions

virtual const std::string & | get_service_name () const =0
| Returns the name of the service to which the requester belongs.
virtual ReturnCode_t | send_request (void *data, RequestInfo &info)=0
| Send a request message.
virtual ReturnCode_t | take_reply (void *data, RequestInfo &info)=0
| Take a reply message from the Requester DataReader's history.
virtual ReturnCode_t | take_reply (LoanableCollection &data, LoanableSequence< RequestInfo > &info)=0
| Take all reply messages stored in the Requester DataReader's history.
virtual ReturnCode_t | return_loan (LoanableCollection &data, LoanableSequence< RequestInfo > &info)=0
| This operation indicates to the Requester's DataReader that the application is done accessing the collection of Reply `datas` and `infos` obtained by some earlier invocation of take_reply.
virtual DataWriter * | get_requester_writer () const =0
| Getter for the Requester's DataWriter.
virtual DataReader * | get_requester_reader () const =0
| Getter for the Requester'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

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

## Detailed Description

Base class for a Requester in the RPC communication.

## Constructor & Destructor Documentation

## ◆ ~Requester()

~Requester | ( |  | ) |

protected default

Destructor.

## Member Function Documentation

## ◆ get_requester_reader()

virtual DataReader * get_requester_reader | ( |  | ) | const

pure virtual

Getter for the Requester's DataReader.

## ◆ get_requester_writer()

virtual DataWriter * get_requester_writer | ( |  | ) | const

pure virtual

Getter for the Requester's DataWriter.

## ◆ get_service_name()

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

pure virtual

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

## ◆ return_loan()

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

pure virtual

This operation indicates to the Requester's DataReader that the application is done accessing the collection of Reply `datas` and `infos` obtained by some earlier invocation of take_reply.

Parameters

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

## ◆ send_request()

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

pure virtual

Send a request message.

Parameters

  data | Data to send
  info | Information about the request sample. This information is used to match the request with the reply through the SampleIdentity

Returns
  RETCODE_OK if the reply was sent successfully
  RETCODE_PRECONDITION_NOT_MET if the requester is not enabled or it is not fully matched
  a ReturnCode from the underlying DataWriter

## ◆ take_reply() [1/2]

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

pure virtual

Take all reply messages stored in the Requester 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 replies
  info | Information about the reply samples

Returns
  RETCODE_OK if the replies were taken successfully or a ReturnCode related to the specific error otherwise

## ◆ take_reply() [2/2]

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

pure virtual

Take a reply message from the Requester DataReader's history.

Parameters

  data | Data to receive the reply
  info | Information about the reply sample

Returns
  RETCODE_OK if the reply 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/Requester.hpp