CoreDX DDS C# Reference Manual
Public Member Functions | List of all members
Requester< TReq, TRep > Class Template Reference
Inheritance diagram for Requester< TReq, TRep >:
ServiceProxy< TReq, TRep > RPCEntity

Public Member Functions

 Requester ()
 
 Requester (RequesterParams req_params)
 
ReturnCode_t send_request (TReq request)
 
ReturnCode_t send_request_oneway (TReq request)
 
bool receive_reply (Sample< TRep > reply, Duration_t timeout)
 
bool receive_reply (Sample< TRep > reply, SampleIdentity_t relatedRequestId)
 
LoanedSamples< TRep > receive_replies (Duration_t max_wait)
 
LoanedSamples< TRep > receive_replies (int min_count, int max_count, Duration_t max_wait)
 
bool wait_for_replies (int min_count, Duration_t max_wait)
 
bool wait_for_replies (Duration_t max_wait)
 
bool wait_for_replies (int min_count, Duration_t max_wait, SampleIdentity_t related_request_id)
 
bool take_reply (Sample< TRep > reply)
 
bool take_reply (Sample< TRep > reply, SampleIdentity_t related_request_id)
 
LoanedSamples< TRep > take_replies (int max_count)
 
LoanedSamples< TRep > take_replies (int max_count, SampleIdentity_t related_request_id)
 
LoanedSamples< TRep > take_replies (SampleIdentity_t related_request_id)
 
bool read_reply (Sample< TRep > reply)
 
bool read_reply (Sample< TRep > reply, SampleIdentity_t related_request_id)
 
LoanedSamples< TRep > read_replies (int max_count)
 
LoanedSamples< TRep > read_replies (int max_count, SampleIdentity_t related_request_id)
 
LoanedSamples< TRep > read_replies (SampleIdentity_t related_request_id)
 
bool receive_nondata_samples (bool enable)
 
RequesterParams get_requester_params ()
 
DataWriterI< TReq > get_request_datawriter ()
 
DataReaderI< TRep > get_reply_datareader ()
 
- Public Member Functions inherited from ServiceProxy< TReq, TRep >
void close ()
 
bool is_null ()
 
void bind (String i_name)
 
void unbind ()
 
bool is_bound ()
 
String get_bound_instance_name ()
 
List< String > get_discovered_service_instances ()
 
ReturnCode_t wait_for_service ()
 
ReturnCode_t wait_for_service (Duration_t maxWait)
 
ReturnCode_t wait_for_service (String instanceName)
 
ReturnCode_t wait_for_service (Duration_t max_wait, String instanceName)
 
ReturnCode_t wait_for_services (uint count)
 
ReturnCode_t wait_for_services (Duration_t max_wait, uint count)
 
ReturnCode_t wait_for_services (List< String > instanceNames)
 
ReturnCode_t wait_for_services (Duration_t max_wait, List< String > instanceNames)
 

Detailed Description

A Requester sends requests and receives replies.

An instance of a Requester is configured at the time of construction using RequesterParams, which is a container of configuration parameters, such as domain participant, QoS, listeners and more.

Requester is inherently asynchronous as sending a request and receiving its corresponding reply (or replies) are separated. Requester allows listener-based, polling-based, and future-based reception of replies.

SimpleRequesterListener<TRep> and RequesterListener<TReq, TRep> interfaces enable callback-based notification when a reply is available. On the other hand, Requester provides functions to allow polling reception of replies.

Future-based notification of replies is analogous to callback-based notification, however, no request-reply correlation is necessary because every future represents a reply to a unique request.

A requester reference may be bound to a specific service instance. Requests sent through a bound requester reference shall be sent to the bound service instance only.

Type Constraints
TReq :RequestType 
TReq :new() 
TRep :ReplyType 
TRep :new() 

Constructor & Destructor Documentation

Requester ( )
inline

Default constructor.

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

Requester ( RequesterParams  req_params)
inline

Constructor that accepts RequesterParams for configuration.

Member Function Documentation

DataReaderI<TRep> get_reply_datareader ( )
inline

Obtain access to the underlying DataReader used for receiving Replies.

DataWriterI<TReq> get_request_datawriter ( )
inline

Obtain access to the underlying DataWriter used for sending Requests.

RequesterParams get_requester_params ( )
inline

Obtain the parameters used to configure this Reqeuster.

LoanedSamples<TRep> read_replies ( int  max_count)
inline

Attempts to access up to 'max_count' replies.

The available replies (up to 'max_count') are returned in a LoanedSamples<TRep> object. This routine will not block.

LoanedSamples<TRep> read_replies ( int  max_count,
SampleIdentity_t  related_request_id 
)
inline

Attempts to access up to 'max_count' replies that match 'related_request_id'.

The available matching replies (up to 'max_count') are returned in a LoanedSamples<TRep> object. This routine will not block.

LoanedSamples<TRep> read_replies ( SampleIdentity_t  related_request_id)
inline

Attempts to access all available replies that match 'related_request_id'.

The available matching replies are returned in a LoanedSamples<TRep> object. This routine will not block.

bool read_reply ( Sample< TRep >  reply)
inline

Attempts to access the next available reply.

This routine will block until a reply is available. This routines copies the reply data into the provided Sample<TRep> 'reply'.

bool read_reply ( Sample< TRep >  reply,
SampleIdentity_t  related_request_id 
)
inline

Attempts to access the next available reply that matches 'related_reqeust_id'.

This routine will block until a matching reply is available.

bool receive_nondata_samples ( bool  enable)
inline

Toggle whether non-data samples are presented to the application.

Note
This is of little utility, as the only non-data samples are unregister, dispose, and not-alive indications which are uncommon with an un-keyed datatype.
LoanedSamples<TRep> receive_replies ( Duration_t  max_wait)
inline

Attempts to access multiple received replies.

This method will access all available replies and return them in a LoanedSamples<TRep> object. If no replies are currently available, the routine will block for up to 'max_wait'.

Return values
boolindicating if replies were found (true) or not (false).
LoanedSamples<TRep> receive_replies ( int  min_count,
int  max_count,
Duration_t  max_wait 
)
inline

Attempts to access at least 'min_count' replies.

This method will access all available replies up to 'max_count' and return them in a LoanedSamples<TRep> object. If at least 'min_count' replies are currently not available, the routine will block for up to 'max_wait'.

Return values
boolindicating if replies were found (true) or not (false).
bool receive_reply ( Sample< TRep >  reply,
Duration_t  timeout 
)
inline

Attempts to access a received reply.

This method accepts a parameter of Sample<TRep> & and a 'timeout'. The call will block until a reply is found, or the timeout period elapses.

Return values
boolindicating if a reply was found (true) or not (false).
bool receive_reply ( Sample< TRep >  reply,
SampleIdentity_t  relatedRequestId 
)
inline

Attempts to access a received reply.

This method accepts a parameter of Sample<TRep> & and a SampleIdentity_t. The call will block until a specific reply is found that matches the identity provided the 'relatedRequestId' parameter.

Return values
boolindicating if a reply was found (true) or not (false).
ReturnCode_t send_request ( TReq  request)
inline

Transmits a request to any matched instances of this service This method accepts a parameter of TReq. Populates request.requestHeader

ReturnCode_t send_request_oneway ( TReq  request)
inline

Transmits a request to any matched instances of this service This method accepts a parameter of TReq.

LoanedSamples<TRep> take_replies ( int  max_count)
inline

Attempts to access up to 'max_count' replies.

This method will access all available replies up to 'max_count' and return them in a LoanedSamples<TRep> object. This routine will not block.

LoanedSamples<TRep> take_replies ( int  max_count,
SampleIdentity_t  related_request_id 
)
inline

Attempts to access up to 'max_count' replies that match the 'related_request_id'.

This method will access all available replies up to 'max_count' and return them in a LoanedSamples<TRep> object. This routine will not block.

LoanedSamples<TRep> take_replies ( SampleIdentity_t  related_request_id)
inline

Attempts to access any replies that match the 'related_request_id'.

This method will access all available matching replies and return them in a LoanedSamples<TRep> object. This routine will not block.

bool take_reply ( Sample< TRep >  reply)
inline

Attempts to access a received reply.

This method accepts a parameter of Sample<TRep> & . The call will not block.

Return values
boolindicating if a reply was found (true) or not (false).
bool take_reply ( Sample< TRep >  reply,
SampleIdentity_t  related_request_id 
)
inline

Attempts to access a received reply.

This method accepts a parameter of Sample<TRep> & . The call will not block.

Return values
boolindicating if a reply was found (true) or not (false).
bool wait_for_replies ( int  min_count,
Duration_t  max_wait 
)
inline

Blocks until at least 'min_count' replies are available.

If at least 'min_count' replies are currently not available, the routine will block for up to 'max_wait'.

Return values
boolindicating if replies were found (true) or not (false).
bool wait_for_replies ( Duration_t  max_wait)
inline

Blocks until a reply is available.

If no replies are currently available, the routine will block for up to 'max_wait'.

Return values
boolindicating if replies were found (true) or not (false).
bool wait_for_replies ( int  min_count,
Duration_t  max_wait,
SampleIdentity_t  related_request_id 
)
inline

Blocks until at least 'min_count' replies to 'related_request_id' are available.

If at least 'min_count' matching replies are currently not available, the routine will block for up to 'max_wait'.

Return values
boolindicating if replies were found (true) or not (false).
Not Yet Supported:
This routine currently ignores 'related_request_id', and will return with success if any 'min_count' replies are available.

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