A replier receives requests and send replies. More...
Public Member Functions | |
Replier () | |
Default constructor. More... | |
Replier (const ReplierParams ¶ms) | |
Constructor that accepts ReplierParams configuration. | |
virtual | ~Replier () |
Destructor. | |
void | send_reply (WriteSample< TRep > &reply, const DDS::SampleIdentity_t &related_request_id) |
Sends the provided 'reply' associated with 'related_request_id'. | |
void | send_reply (WriteSampleRef< TRep > &reply, const DDS::SampleIdentity_t &related_request_id) |
Sends the provided 'reply' associated with 'related_request_id'. | |
bool | receive_request (Sample< TReq > &request, const DDS::Duration_t &max_wait) |
Attempt to access the next request. More... | |
bool | receive_request (SampleRef< TReq > request, const DDS::Duration_t &max_wait) |
Attempt to access the next request. More... | |
LoanedSamplesType | receive_requests (const DDS::Duration_t &max_wait) |
Attempt to access any available requests. More... | |
LoanedSamplesType | receive_requests (uint32_t min_request_count, uint32_t max_request_count, const DDS::Duration_t &max_wait) |
Attempt to access up to 'max_request_count' requests. More... | |
bool | wait_for_requests (const DDS::Duration_t &max_wait) |
Block until at least one request is available. More... | |
bool | wait_for_requests (uint32_t min_count, const DDS::Duration_t &max_wait) |
Block until at least 'min_count requests available. More... | |
bool | take_request (Sample< TReq > &request) |
Attempt to access the next request. More... | |
bool | take_request (SampleRef< TReq > request) |
Attempt to access the next request. More... | |
LoanedSamplesType | take_requests (int max_samples) |
Attempt to access up to 'max_samples' requests. More... | |
bool | read_request (Sample< TReq > &request) |
Attempt to access the next request. More... | |
bool | read_request (SampleRef< TReq > request) |
Attempt to access the next request. More... | |
LoanedSamplesType | read_requests (int max_samples) |
Attempt to access up to 'max_samples' requests. More... | |
const ReplierParams & | get_replier_params () const |
Access the ReplierParams values that define the configuration of the Replier. | |
bool | receive_nondata_samples (bool enable) |
Toggle the underlying entities to deliver non-data samples to the application. More... | |
RequestDataReader | get_request_datareader () const |
Access the underlying DataReader used to receive Requests. | |
ReplyDataWriter | get_reply_datawriter () const |
Access the underlying DataWriter used to send Replies. | |
Public Member Functions inherited from DDS::rpc::RPCEntity | |
void | close () |
Release the underlying resources including any DDS entities. More... | |
bool | is_null () const |
Indicates if the entity has been 'closed'. More... | |
A replier receives requests and send replies.
An instance of Replier is configured at the time of construction using ReplierParams, which is a container of configuration parameters such as domain participant, QoS, listeners and more.
Replier allows listener-based and polling-based reception of requests.
SimpleReplierListener and ReplierListener interfaces enable call-back based notification when a request is available. On the other hand, Replier provides functions to allow polling reception of requests.
DDS::rpc::Replier< TReq, TRep >::Replier | ( | ) |
Default constructor.
Without any configuration, the Replier will construct DDS Entities as required in domain '0'.
bool DDS::rpc::Replier< TReq, TRep >::read_request | ( | Sample< TReq > & | request | ) |
Attempt to access the next request.
This may will block until a request is available.
true | if able to access a request. |
false | otherwise |
bool DDS::rpc::Replier< TReq, TRep >::read_request | ( | SampleRef< TReq > | request | ) |
Attempt to access the next request.
This may will block until a request is available.
true | if able to access a request. |
false | otherwise |
LoanedSamplesType DDS::rpc::Replier< TReq, TRep >::read_requests | ( | int | max_samples | ) |
Attempt to access up to 'max_samples' requests.
This call may block if no requests are available.
collection | of requests |
bool DDS::rpc::Replier< TReq, TRep >::receive_nondata_samples | ( | bool | enable | ) |
Toggle the underlying entities to deliver non-data samples to the application.
bool DDS::rpc::Replier< TReq, TRep >::receive_request | ( | Sample< TReq > & | request, |
const DDS::Duration_t & | max_wait | ||
) |
Attempt to access the next request.
This may block for up to 'max_wait' if no request is immediately available.
bool DDS::rpc::Replier< TReq, TRep >::receive_request | ( | SampleRef< TReq > | request, |
const DDS::Duration_t & | max_wait | ||
) |
Attempt to access the next request.
This may block for up to 'max_wait' if no request is immediately available.
LoanedSamplesType DDS::rpc::Replier< TReq, TRep >::receive_requests | ( | const DDS::Duration_t & | max_wait | ) |
Attempt to access any available requests.
This may block for up to 'max_wait' if no requests are immediately available.
LoanedSamplesType DDS::rpc::Replier< TReq, TRep >::receive_requests | ( | uint32_t | min_request_count, |
uint32_t | max_request_count, | ||
const DDS::Duration_t & | max_wait | ||
) |
Attempt to access up to 'max_request_count' requests.
This may block for up to 'max_wait' if there are not at least 'min_request_count' requests immediately available.
bool DDS::rpc::Replier< TReq, TRep >::take_request | ( | Sample< TReq > & | request | ) |
Attempt to access the next request.
This call will not block.
true | if able to access a request. |
false | otherwise |
bool DDS::rpc::Replier< TReq, TRep >::take_request | ( | SampleRef< TReq > | request | ) |
Attempt to access the next request.
This call will not block.
true | if able to access a request. |
false | otherwise |
LoanedSamplesType DDS::rpc::Replier< TReq, TRep >::take_requests | ( | int | max_samples | ) |
Attempt to access up to 'max_samples' requests.
This call will not block.
collection | of requests (possibly empty) |
bool DDS::rpc::Replier< TReq, TRep >::wait_for_requests | ( | const DDS::Duration_t & | max_wait | ) |
Block until at least one request is available.
This may block for up to 'max_wait'.
bool DDS::rpc::Replier< TReq, TRep >::wait_for_requests | ( | uint32_t | min_count, |
const DDS::Duration_t & | max_wait | ||
) |
Block until at least 'min_count requests available.
This may block for up to 'max_wait'.