RTI Connext .NET API (legacy)  Version 6.1.1
RTI.Connext.Queuing.QueueReplier< TReq, TRep > Class Template Reference

Allows receiving requests and sending replies. More...

Inherits AlreadyDisposedHelper< QueueReplier< TReq, TRep >>, and IDisposable.

Public Member Functions

 QueueReplier (QueueReplierParams< TReq, TRep > parameters)
 Creates a Replier with parameters. More...
 
 QueueReplier (DomainParticipant participant, String requestQueueTopicName, String sharedSubscriber, TypeSupport requestQueueTypeSupport, TypeSupport replyQueueTypeSupport)
 Creates a QueueReplier with the minimum set of parameters. More...
 
void SendReply (TRep sample, SampleInfo relatedRequestInfo)
 Sends a reply for a previous request. More...
 
void SendReply (WriteSample< TRep > sample, SampleInfo relatedRequestInfo)
 Sends a reply for a previous request. More...
 
bool WaitForAcknowledgements (Duration_t maxWait)
 Blocks the calling thread until all replies written by this QueueReplier are acknowledged by Queuing Service, or until a timeout occurs. More...
 
bool WaitForAcknowledgements (SampleIdentity_t identity, Duration_t maxWait)
 Blocks the calling thread until the reply identified by identity is acknowledged by Queuing Service, or until a timeout occurs. More...
 
bool HasMatchingReplySharedReaderQueue ()
 Checks whether or not this QueueReplier has matched with at least one reply SharedReaderQueue. More...
 
bool HasMatchingRequestSharedReaderQueue ()
 Checks whether or not this QueueReplier has matched with at least one request SharedReaderQueue. More...
 
WriteSample< TRep > CreateReplySample ()
 Creates a WriteSample for sending replies. More...
 
WriteSample< TRep > CreateReplySample (TRep data)
 Creates a WriteSample for sending replies. More...
 
bool ReceiveRequest (Sample< TReq > request, Duration_t maxWait)
 Waits for a request and copies its contents into a Sample. More...
 
IList< Sample< TReq > > ReceiveRequests (IList< Sample< TReq >> requests, int maxCount, Duration_t maxWait)
 Waits for multiple requests and copies them into a list. More...
 
IList< Sample< TReq > > ReceiveRequests (IList< Sample< TReq >> requests, int minCount, int maxCount, Duration_t maxWait)
 Waits for multiple requests and copies them into a list. More...
 
RTI.Connext.Infrastructure.LoanedSamples< TReq > ReceiveRequests (Duration_t maxWait)
 Waits for multiple requests and provides a loaned container to access them. More...
 
RTI.Connext.Infrastructure.LoanedSamples< TReq > ReceiveRequests (int minCount, int maxCount, Duration_t maxWait)
 Waits for multiple requests and provides a loaned container to access them. More...
 
bool TakeRequest (Sample< TReq > request)
 Copies the contents of a request into a Sample. More...
 
RTI.Connext.Infrastructure.LoanedSamples< TReq > TakeRequests ()
 Provides a loaned container to access the existing requests. More...
 
RTI.Connext.Infrastructure.LoanedSamples< TReq > TakeRequests (int maxCount)
 Provides a loaned container to access the existing requests. More...
 
IList< Sample< TReq > > TakeRequests (IList< Sample< TReq >> requests, int maxCount)
 Copies existing requests into a list. More...
 
bool ReadRequest (Sample< TReq > request)
 Copies the contents of a request into a Sample. More...
 
RTI.Connext.Infrastructure.LoanedSamples< TReq > ReadRequests ()
 Provides a loaned container from which you can access the existing requests. More...
 
RTI.Connext.Infrastructure.LoanedSamples< TReq > ReadRequests (int maxCount)
 Provides a loaned container from which you can access the existing requests. More...
 
IList< Sample< TReq > > ReadRequests (IList< Sample< TReq >> requests, int maxCount)
 Copies existing requests into a list. More...
 
bool WaitForRequests (Duration_t maxWait)
 Waits for requests. More...
 
bool WaitForRequests (int minCount, Duration_t maxWait)
 Waits for requests. More...
 
void AcknowledgeAll (bool isPositiveAck)
 Acknowledges all previously accessed requests. More...
 
void AcknowledgeRequest (SampleInfo sampleInfo, bool isPositiveAck)
 Explicitly acknowledges a single request. More...
 
void SendAvailability (ConsumerAvailabilityParams_t parameters)
 Sends an availability sample with the specified parameters. The availability applies to the reply queue. More...
 
Sample< TReq > CreateRequestSample ()
 Creates a Sample for receiving requests. More...
 
Sample< TReq > CreateRequestSample (TReq data)
 Creates a Sample for receiving requests. More...
 

Properties

TypedDataWriter< TRep > Writer [get]
 Retrieves the underlying DDS::DataWriter used to send replies. More...
 
GUID_t Guid [get]
 Returns the GUID of this QueueReplier. More...
 
TypedDataReader< TReq > Reader [get]
 Retrieves the underlying DDS::DataReader used to receive requests. More...
 
QueueProducer< TRep > Producer [get]
 Retrieves the underlying DDS::DataWriter. More...
 
QueueConsumer< TReq > Consumer [get]
 Retrieves the underlying DDS::DataReader. More...
 

Detailed Description

Allows receiving requests and sending replies.

A QueueReplier is a component suited for the queuing request-reply use case. A QueueReplier plays the role of a request QueueConsumer and reply QueueProducer.

A QueueReplier is an entity that allows you to receive requests from a request SharedReaderQueue and send replies to a reply SharedReaderQueue, which are hosted by Queuing Service.

To communicate with the SharedReaderQueues, the QueueReplier creates two topics. The first topic corresponds to the request SharedReaderQueue topic and the second topic to the reply SharedReaderQueue topic.

Valid types for these topics (TReq and TRep) are: those generated by the rtiddsgen code generator, the DDS built-in types, and DDS::DynamicData.

For example:

QueueReplier<Foo, Bar> replier
QueueReplier<DynamicData, Bar> replier
QueueReplier<Foo, Octets> repliei
See also
RTI::Connext::Queuing::QueueConsumer<T>
RTI::Connext::Queuing::QueueProducer<T>
Template Parameters
TReqThe data type for the request SharedReaderQueue topic
TRepThe data type for the reply SharedReaderQueue topic
Type Constraints
TReq :class 
TReq :global 
TReq :DDS.ICopyable<TReq> 
TReq :new() 
TRep :class 
TRep :global 
TRep :DDS.ICopyable<TRep> 
TRep :new() 

Constructor & Destructor Documentation

◆ QueueReplier() [1/2]

RTI.Connext.Queuing.QueueReplier< TReq, TRep >.QueueReplier ( QueueReplierParams< TReq, TRep >  parameters)
inline

Creates a Replier with parameters.

Parameters
parametersAll the parameters that configure this QueueReplier See RTI::Connext::Queuing::QueueReplierParams<TReq,TRep> for the list of required parameters.
Exceptions
Oneof the Standard Return Codes
See also
RTI::Connext::Queuing::QueueReplierParams<TReq,TRep>

◆ QueueReplier() [2/2]

RTI.Connext.Queuing.QueueReplier< TReq, TRep >.QueueReplier ( DomainParticipant  participant,
String  requestQueueTopicName,
String  sharedSubscriber,
TypeSupport  requestQueueTypeSupport,
TypeSupport  replyQueueTypeSupport 
)
inline

Creates a QueueReplier with the minimum set of parameters.

Parameters
participantThe DomainParticipant this replier uses to join a DDS domain
requestQueueTopicNameThe request queue topic name as specified in a Queuing Service SharedReaderQueue configuration. See RTI::Connext::Queuing::QueueReplierParams<TReq,TRep>::SetRequestQueueTopicName
sharedSubscriberThe name of the SharedSubscriber in a Queuing Service that hosts the queue. See RTI::Connext::Queuing::QueueReplierParams<TReq,TRep>::SetSharedSubscriberName
requestQueueTypeSupportThe type support for type TReq
replyQueueTypeSupportThe type support for type TRep
Exceptions
Oneof the Standard Return Codes

Member Function Documentation

◆ SendReply() [1/2]

void RTI.Connext.Queuing.QueueReplier< TReq, TRep >.SendReply ( TRep  sample,
SampleInfo  relatedRequestInfo 
)
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>).

Parameters
sampleThe reply to be sent
relatedRequestInfoThe identity of a previously received request
Exceptions
Oneof the Standard Return Codes
See also
RTI::Connext::Queuing::QueueProducer<T>::SendSample(T)

◆ SendReply() [2/2]

void RTI.Connext.Queuing.QueueReplier< TReq, TRep >.SendReply ( WriteSample< TRep >  sample,
SampleInfo  relatedRequestInfo 
)
inline

Sends a reply for a previous request.

Allows you to set custom parameters for writing a reply.

Contrary to the RTI::Connext::Queuing::QueueRequester<TReq,TRep>, where retrieving the sample identity for correlation is common, on the QueueReplier side using a WriteSample is only necessary when the default write parameters need to be overridden, and SendReply(TRep, SampleInfo) may be used if that is not necessary.

See also
RTI::Connext::Queuing::QueueProducer<T>::SendSample(WriteSample<T>)

◆ WaitForAcknowledgements() [1/2]

bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.WaitForAcknowledgements ( Duration_t  maxWait)
inline

◆ WaitForAcknowledgements() [2/2]

bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.WaitForAcknowledgements ( SampleIdentity_t  identity,
Duration_t  maxWait 
)
inline

◆ HasMatchingReplySharedReaderQueue()

bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.HasMatchingReplySharedReaderQueue ( )
inline

◆ HasMatchingRequestSharedReaderQueue()

bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.HasMatchingRequestSharedReaderQueue ( )
inline

◆ CreateReplySample() [1/2]

WriteSample<TRep> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.CreateReplySample ( )
inline

Creates a WriteSample for sending replies.

See also
RTI::Connext::Queuing::QueueProducer<T>::CreateWriteSample()

◆ CreateReplySample() [2/2]

WriteSample<TRep> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.CreateReplySample ( TRep  data)
inline

Creates a WriteSample for sending replies.

See also
RTI::Connext::Queuing::QueueProducer<T>::CreateWriteSample(T)

◆ ReceiveRequest()

bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReceiveRequest ( Sample< TReq >  request,
Duration_t  maxWait 
)
inline

◆ ReceiveRequests() [1/4]

IList<Sample<TReq> > RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReceiveRequests ( IList< Sample< TReq >>  requests,
int  maxCount,
Duration_t  maxWait 
)
inline

◆ ReceiveRequests() [2/4]

IList<Sample<TReq> > RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReceiveRequests ( IList< Sample< TReq >>  requests,
int  minCount,
int  maxCount,
Duration_t  maxWait 
)
inline

Waits for multiple requests and copies them into a list.

See also
RTI::Connext::Queuing::QueueConsumer<T>::ReceiveSamples(IList<Sample<T>>,int,int,Duration_t)

◆ ReceiveRequests() [3/4]

RTI.Connext.Infrastructure.LoanedSamples<TReq> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReceiveRequests ( Duration_t  maxWait)
inline

Waits for multiple requests and provides a loaned container to access them.

See also
RTI::Connext::Queuing::QueueConsumer<T>::ReceiveSamples(Duration_t)
WaitForRequests(int,Duration_t)
TakeRequests(int)

◆ ReceiveRequests() [4/4]

RTI.Connext.Infrastructure.LoanedSamples<TReq> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReceiveRequests ( int  minCount,
int  maxCount,
Duration_t  maxWait 
)
inline

Waits for multiple requests and provides a loaned container to access them.

See also
RTI::Connext::Queuing::QueueConsumer<T>::ReceiveSamples(int,int,Duration_t)
WaitForRequests(int,Duration_t)
TakeRequests(int)

◆ TakeRequest()

bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.TakeRequest ( Sample< TReq >  request)
inline

Copies the contents of a request into a Sample.

See also
RTI::Connext::Queuing::QueueConsumer<T>::TakeSample(Sample<T>)

◆ TakeRequests() [1/3]

Provides a loaned container to access the existing requests.

See also
RTI::Connext::Queuing::QueueConsumer<T>::TakeSamples()

◆ TakeRequests() [2/3]

RTI.Connext.Infrastructure.LoanedSamples<TReq> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.TakeRequests ( int  maxCount)
inline

Provides a loaned container to access the existing requests.

See also
RTI::Connext::Queuing::QueueConsumer<T>::TakeSamples(int)

◆ TakeRequests() [3/3]

IList<Sample<TReq> > RTI.Connext.Queuing.QueueReplier< TReq, TRep >.TakeRequests ( IList< Sample< TReq >>  requests,
int  maxCount 
)
inline

◆ ReadRequest()

bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReadRequest ( Sample< TReq >  request)
inline

Copies the contents of a request into a Sample.

This operation is equivalent to RTI::Connext::Queuing::QueueReplier<TReq,TRep>::TakeRequest(Sample<TReq>), except the sample remains in the QueueReplier and can be read or taken again.

◆ ReadRequests() [1/3]

Provides a loaned container from which you can access the existing requests.

This operation is equivalent to RTI::Connext::Queuing::QueueReplier<TReq,TRep>::TakeRequests(), except the sample remains in the QueueReplier and can be read or taken again.

◆ ReadRequests() [2/3]

RTI.Connext.Infrastructure.LoanedSamples<TReq> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReadRequests ( int  maxCount)
inline

Provides a loaned container from which you can access the existing requests.

This operation is equivalent to RTI::Connext::Queuing::QueueReplier<TReq,TRep>::TakeRequests(int), except the sample remains in the QueueReplier and can be read or taken again.

◆ ReadRequests() [3/3]

IList<Sample<TReq> > RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReadRequests ( IList< Sample< TReq >>  requests,
int  maxCount 
)
inline

Copies existing requests into a list.

This operation is equivalent to RTI::Connext::Queuing::QueueReplier<TReq,TRep>::TakeRequests(IList<Sample<TReq>>,int), except the sample remains in the QueueReplier and can be read or taken again.

◆ WaitForRequests() [1/2]

bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.WaitForRequests ( Duration_t  maxWait)
inline

◆ WaitForRequests() [2/2]

bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.WaitForRequests ( int  minCount,
Duration_t  maxWait 
)
inline

◆ AcknowledgeAll()

void RTI.Connext.Queuing.QueueReplier< TReq, TRep >.AcknowledgeAll ( bool  isPositiveAck)
inline

◆ AcknowledgeRequest()

void RTI.Connext.Queuing.QueueReplier< TReq, TRep >.AcknowledgeRequest ( SampleInfo  sampleInfo,
bool  isPositiveAck 
)
inline

◆ SendAvailability()

void RTI.Connext.Queuing.QueueReplier< TReq, TRep >.SendAvailability ( ConsumerAvailabilityParams_t  parameters)
inline

Sends an availability sample with the specified parameters. The availability applies to the reply queue.

See also
RTI::Connext::Queuing::QueueConsumer<T>::SendAvailability(ConsumerAvailabilityParams_t)
RTI::Connext::Queuing::QueueReplierParams<TReq,TRep>::SetEnableAvailability

◆ CreateRequestSample() [1/2]

Sample<TReq> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.CreateRequestSample ( )
inline

Creates a Sample for receiving requests.

See also
RTI::Connext::Queuing::QueueConsumer<T>::CreateSample()

◆ CreateRequestSample() [2/2]

Sample<TReq> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.CreateRequestSample ( TReq  data)
inline

Creates a Sample for receiving requests.

See also
RTI::Connext::Queuing::QueueConsumer<T>::CreateSample(T)

Property Documentation

◆ Writer

TypedDataWriter<TRep> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.Writer
get

Retrieves the underlying DDS::DataWriter used to send replies.

See also
RTI::Connext::Queuing::QueueProducer<T>::Writer

◆ Guid

◆ Reader

TypedDataReader<TReq> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.Reader
get

Retrieves the underlying DDS::DataReader used to receive requests.

See also
RTI::Connext::Queuing::QueueConsumer<T>::Reader

◆ Producer

QueueProducer<TRep> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.Producer
get

Retrieves the underlying DDS::DataWriter.

◆ Consumer

QueueConsumer<TReq> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.Consumer
get

Retrieves the underlying DDS::DataReader.