RTI Connext .Net APIs
Version 5.0.0
|
Allows receiving requests and sending replies. More...
Inherits AlreadyDisposedHelper< Replier< TReq, TRep >>, and IDisposable.
Inherited by RTI.Connext.RequestReply.Replier< TReq, TRep >.ReplierDataReaderListener.
Public Member Functions | |
Replier (ReplierParams< TReq, TRep > parameters) | |
Creates a Replier with parameters. | |
Replier (DomainParticipant participant, String serviceName, TypeSupport requestTypeSupport, TypeSupport replyTypeSupport) | |
Creates a Replier with the minimum set of parameters. | |
void | SendReply (TRep reply, SampleIdentity_t relatedRequestId) |
Sends a reply for a previous request. | |
void | SendReply (WriteSample< TRep > reply, SampleIdentity_t relatedRequestId) |
Sends a reply for a previous request. | |
bool | ReceiveRequest (Sample< TReq > request, Duration_t maxWait) |
Waits for a request and copies its contents into a Sample. | |
IList< Sample< TReq > > | ReceiveRequests (IList< Sample< TReq >> replies, int maxCount, Duration_t maxWait) |
Waits for multiple requests and copies them into a list. | |
IList< Sample< TReq > > | ReceiveRequests (IList< Sample< TReq >> replies, int minCount, int maxCount, Duration_t maxWait) |
Waits for multiple requests and copies them into a list. | |
LoanedSamples< TReq > | ReceiveRequests (Duration_t maxWait) |
Waits for multiple requests and provides a loaned container to access them. | |
LoanedSamples< TReq > | ReceiveRequests (int minCount, int maxCount, Duration_t maxWait) |
Waits for multiple requests and provides a loaned container to access them. | |
bool | TakeRequest (Sample< TReq > request) |
Copies the contents of a request into a Sample. | |
LoanedSamples< TReq > | TakeRequests () |
Provides a loaned container to access the existing requests. | |
LoanedSamples< TReq > | TakeRequests (int maxCount) |
Provides a loaned container to access the existing requests. | |
IList< Sample< TReq > > | TakeRequests (IList< Sample< TReq >> requests, int maxCount) |
Copies existing requests into a list. | |
bool | ReadRequest (Sample< TReq > request) |
Copies the contents of a request into a Sample. | |
LoanedSamples< TReq > | ReadRequests () |
Provides a loaned container to access the existing requests. | |
LoanedSamples< TReq > | ReadRequests (int maxCount) |
Provides a loaned container to access the existing requests. | |
IList< Sample< TReq > > | ReadRequests (IList< Sample< TReq >> requests, int maxCount) |
Copies existing requests into a list. | |
bool | WaitForRequests (Duration_t maxWait) |
Waits for requests. | |
bool | WaitForRequests (int minCount, Duration_t maxWait) |
Waits for requests. | |
WriteSample< TRep > | CreateReplySample () |
Creates a WriteSample for sending replies. | |
WriteSample< TRep > | CreateReplySample (TRep data) |
Creates a WriteSample for sending replies. | |
Sample< TReq > | CreateRequestSample () |
Creates a Sample for receiving replies. | |
Properties | |
TypedDataWriter< TRep > | ReplyDataWriter [get] |
Retrieves the underlying DDS::DataWriter. | |
TypedDataReader< TReq > | RequestDataReader [get] |
Retrieves the underlying DDS::DataReader. | |
Allows receiving requests and sending replies.
A Replier is an entity with two associated topics: a request topic and a reply topic. It can receive requests by subscribing to the request topic and can send replies to those requests by publishing the reply topic.
Valid types for these topics (TReq
and TRep
) are: those generated by the rtiddsgen code generator, the DDS built-in types, and DynamicData
. See Creating a Replier.
A Replier has four main types of operations:
Much like a Requester, a Replier has an associated DDS::DomainParticipant, which can be shared with other Repliers or RTI Connext routines. All the other entities required for the request-reply interaction, including a DDS::DataWriter for writing replies and a DDS::DataReader for reading requests, are automatically created when the Replier is constructed.
Quality of Service for the underlying DataWriter and DataReader can be configured (see RTI.Connext.RequestReply::RequesterParams::SetQosProfile). By default, they are created with reliable quality of service. The exact default configuration is described here: Configuring Request-Reply QoS profiles
There are several ways to use a Replier:
TReq | The data type for the request topic |
TRep | The data type for the reply topic |
TReq | : | class | |
TReq | : | global | |
TReq | : | DDS.ICopyable<TReq> | |
TReq | : | new() | |
TRep | : | class | |
TRep | : | global | |
TRep | : | DDS.ICopyable<TRep> | |
TRep | : | new() |
|
inline |
Creates a Replier with parameters.
params | All the parameters that configure this Replier |
One | of the Standard Return Codes |
|
inline |
Creates a Replier with the minimum set of parameters.
participant | The DomainParticipant that this Replier uses to join a domain. |
serviceName | The service name. See RTI.Connext.RequestReply::ReplierParams<TReq,TRep>::SetServiceName |
requestTypeSupport | The type support for type TReq |
replyTypeSupport | The type support for type TReq |
One | of the Standard Return Codes |
|
inline |
Sends a reply for a previous request.
The related request identity can be retrieved from an existing request sample (RTI.Connext.Infrastructure::Sample<T>).
reply | The reply to be sent. |
relatedRequestId | The identity of a previously received request |
One | of the Standard Return Codes |
|
inline |
Sends a reply for a previous request.
Allows you to set custom parameters for writing a reply.
Contrary to the RTI.Connext.RequestReply::Requester<TReq,TRep>, where retrieving the sample identity for correlation is common, on the Replier side using a WriteSample is only necessary when the default write parameters need to be overridden, and SendReply(TRep, SampleIdentity_t) may be used if that is not necessary.
|
inline |
Waits for a request and copies its contents into a Sample.
Equivalent to using WaitForRequests(int,Duration_t) and TakeRequest(Sample<TReq>)
|
inline |
Waits for multiple requests and copies them into a list.
Equivalent to ReceiveRequests(IList<Sample<TReq>>,int,int,Duration_t) with min_count = 0
|
inline |
Waits for multiple requests and copies them into a list.
Equivalent to using WaitForRequests(int,Duration_t) and TakeRequests(IList<Sample<TReq>>,int)
|
inline |
Waits for multiple requests and provides a loaned container to access them.
Equivalent to using ReceiveRequests(int,int,Duration_t) with min_count=1
and max_count=DDS::ResourceLimitsQosPolicy::LENGTH_UNLIMITED
|
inline |
Waits for multiple requests and provides a loaned container to access them.
Equivalent to using WaitForRequests(int,Duration_t) and TakeRequests(int)
|
inline |
Copies the contents of a request into a Sample.
|
inline |
Provides a loaned container to access the existing requests.
Equivalent to using TakeRequests(int) with max_count=DDS::ResourceLimitsQosPolicy::LENGTH_UNLIMITED
|
inline |
Provides a loaned container to access the existing requests.
|
inline |
Copies existing requests into a list.
|
inline |
Copies the contents of a request into a Sample.
This operation is equivalent to RTI.Connext.RequestReply::Replier<TReq,TRep>::TakeRequest(Sample<TReq>) except the request remains in the Replier and can be read or taken again.
|
inline |
Provides a loaned container to access the existing requests.
This operation is equivalent to RTI.Connext.RequestReply::Replier<TReq,TRep>::TakeRequests() except the requests remain in the Replier and can be read or taken again.
|
inline |
Provides a loaned container to access the existing requests.
This operation is equivalent to RTI.Connext.RequestReply::Replier<TReq,TRep>::TakeRequests(int) except the requests remain in the Replier and can be read or taken again.
|
inline |
Copies existing requests into a list.
This operation is equivalent to RTI.Connext.RequestReply::Replier<TReq,TRep>::TakeRequests(IList<Sample<TReq>>,int) except the requests remain in the Replier and can be read or taken again.
|
inline |
Waits for requests.
Equivalent to WaitForRequests(int,Duration_t) with min_count=1
|
inline |
Waits for requests.
This operation waits for minCount requests to be available. It will wait up to maxWait .
This operation is similar to RTI.Connext.RequestReply::Requester<TReq,TRep>::WaitForReplies(int,Duration_t).
minCount | Minimum number of requests that need to be available for this operation to unblock. |
maxWait | Maximum waiting time after which this operation unblocks regardless of how many requests are available. |
|
inline |
Creates a WriteSample for sending replies.
TReq
initialized with default values and default write parameters.
|
inline |
Creates a WriteSample for sending replies.
|
inline |
Creates a Sample for receiving replies.
TReq
and invalid SampleInfo.
|
get |
Retrieves the underlying DDS::DataWriter.
|
get |
Retrieves the underlying DDS::DataReader.