CoreDX DDS C++ Reference Manual
Public Member Functions | List of all members
DDS::rpc::Replier< TReq, TRep > Class Template Reference

A replier receives requests and send replies. More...

Inheritance diagram for DDS::rpc::Replier< TReq, TRep >:
DDS::rpc::ReplierBase DDS::rpc::RPCEntity

Public Member Functions

 Replier ()
 Default constructor. More...
 
 Replier (const ReplierParams &params)
 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 ReplierParamsget_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...
 

Detailed Description

template<typename TReq, typename TRep>
class DDS::rpc::Replier< TReq, TRep >

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.

Constructor & Destructor Documentation

template<typename TReq, typename TRep>
DDS::rpc::Replier< TReq, TRep >::Replier ( )

Default constructor.

Without any configuration, the Replier will construct DDS Entities as required in domain '0'.

Member Function Documentation

template<typename TReq, typename TRep>
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.

Return values
trueif able to access a request.
falseotherwise
template<typename TReq, typename TRep>
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.

Return values
trueif able to access a request.
falseotherwise
template<typename TReq, typename TRep>
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.

Return values
collectionof requests
template<typename TReq, typename TRep>
bool DDS::rpc::Replier< TReq, TRep >::receive_nondata_samples ( bool  enable)

Toggle the underlying entities to deliver non-data samples to the application.

Not Yet Supported:
template<typename TReq, typename TRep>
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.

template<typename TReq, typename TRep>
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.

template<typename TReq, typename TRep>
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.

template<typename TReq, typename TRep>
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.

template<typename TReq, typename TRep>
bool DDS::rpc::Replier< TReq, TRep >::take_request ( Sample< TReq > &  request)

Attempt to access the next request.

This call will not block.

Return values
trueif able to access a request.
falseotherwise
template<typename TReq, typename TRep>
bool DDS::rpc::Replier< TReq, TRep >::take_request ( SampleRef< TReq >  request)

Attempt to access the next request.

This call will not block.

Return values
trueif able to access a request.
falseotherwise
template<typename TReq, typename TRep>
LoanedSamplesType DDS::rpc::Replier< TReq, TRep >::take_requests ( int  max_samples)

Attempt to access up to 'max_samples' requests.

This call will not block.

Return values
collectionof requests (possibly empty)
template<typename TReq, typename TRep>
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'.

template<typename TReq, typename TRep>
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'.


© 2009-2017 Twin Oaks Computing, Inc
Castle Rock, CO 80108
All rights reserved.