RTI Connext .Net APIs  Version 5.2.0
 All Classes Namespaces Functions Variables Enumerations Properties Groups Pages
RTI.Connext.Queuing.QueueReplier< TReq, TRep > Class Template Reference

Allows receiving requests and sending replies. More...

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

Inherited by RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReplierConsumerListenerAdapter, and RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReplierProducerListenerAdapter.

Public Member Functions

 QueueReplier (QueueReplierParams< TReq, TRep > parameters)
 Creates a Replier with parameters.
 
 QueueReplier (DomainParticipant participant, String requestQueueTopicName, String sharedSubscriber, TypeSupport requestQueueTypeSupport, TypeSupport replyQueueTypeSupport)
 Creates a QueueReplier with the minimum set of parameters.
 
void SendReply (TRep sample, SampleInfo relatedRequestInfo)
 Sends a reply for a previous request.
 
void SendReply (WriteSample< TRep > sample, SampleInfo relatedRequestInfo)
 Sends a reply for a previous request.
 
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.
 
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.
 
bool HasMatchingReplySharedReaderQueue ()
 Checks whether or not this QueueReplier has matched with at least one reply SharedReaderQueue.
 
bool HasMatchingRequestSharedReaderQueue ()
 
WriteSample< TRep > CreateReplySample ()
 Creates a WriteSample for sending replies.
 
WriteSample< TRep > CreateReplySample (TRep data)
 Creates a WriteSample for sending replies.
 
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 >> requests, int maxCount, Duration_t maxWait)
 Waits for multiple requests and copies them into a list.
 
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.
 
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 from which you can access the existing requests.
 
LoanedSamples< TReq > ReadRequests (int maxCount)
 Provides a loaned container from which you can 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.
 
void AcknowledgeAll (bool isPositiveAck)
 Acknowledges all previously accessed requests.
 
void AcknowledgeRequest (SampleInfo sampleInfo, bool isPositiveAck)
 Explicitly acknowledges a single request.
 
void SendAvailability (ConsumerAvailabilityParams_t parameters)
 Sends an availability sample with the specified parameters. The availability applies to the reply queue.
 
Sample< TReq > CreateRequestSample ()
 Creates a Sample for receiving requests.
 
Sample< TReq > CreateRequestSample (TReq data)
 Creates a Sample for receiving requests.
 

Static Public Member Functions

static WriteParams_t GetWriteParamsForRelatedRequest (WriteParams_t parameters, SampleInfo relatedRequestInfo)
 

Properties

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

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 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

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

Creates a Replier with parameters.

Parameters
paramsAll 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>
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
sharedSubscriberNameThe 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

static WriteParams_t RTI.Connext.Queuing.QueueReplier< TReq, TRep >.GetWriteParamsForRelatedRequest ( WriteParams_t  parameters,
SampleInfo  relatedRequestInfo 
)
inlinestatic
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
replyThe reply to be sent
relatedRequestIdThe identity of a previously received request
Exceptions
Oneof the Standard Return Codes
See Also
RTI::Connext::Queuing::QueueProducer<T>::SendSample(T)
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, SampleIdentity_t) may be used if that is not necessary.

See Also
RTI::Connext::Queuing::QueueProducer<T>::SendSample(WriteSample<T>)
bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.WaitForAcknowledgements ( Duration_t  maxWait)
inline

Blocks the calling thread until all replies written by this QueueReplier are acknowledged by Queuing Service, or until a timeout occurs.

See Also
RTI::Connext::Queuing::QueueProducer<T>::WaitForAcknowledgements(Duration_t)
SendReply(TRep, SampleIdentity_t)
RTI::Connext::Queuing::QueueReplierListener<TReq,TRep>::OnReplyAcknowledged
bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.WaitForAcknowledgements ( SampleIdentity_t  identity,
Duration_t  maxWait 
)
inline

Blocks the calling thread until the reply identified by identity is acknowledged by Queuing Service, or until a timeout occurs.

See Also
RTI::Connext::Queuing::QueueProducer<T>::WaitForAcknowledgements(SampleIdentity_t,Duration_t)
SendReply(TRep, SampleIdentity_t)
RTI::Connext::Queuing::QueueReplierListener<TReq,TRep>::OnReplyAcknowledged
bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.HasMatchingReplySharedReaderQueue ( )
inline

Checks whether or not this QueueReplier has matched with at least one reply SharedReaderQueue.

See Also
RTI::Connext::Queuing::QueueConsumer<T>::HasMatchingSharedReaderQueue()
RTI::Connext::Queuing::QueueReplierListener<TReq,TRep>::OnReplySharedReaderQueueMatched
bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.HasMatchingRequestSharedReaderQueue ( )
inline
WriteSample<TRep> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.CreateReplySample ( )
inline

Creates a WriteSample for sending replies.

See Also
RTI::Connext::Queuing::QueueProducer<T>::CreateWriteSample()
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)
bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReceiveRequest ( Sample< TReq >  request,
Duration_t  maxWait 
)
inline
IList<Sample<TReq> > RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReceiveRequests ( IList< Sample< TReq >>  requests,
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,Duration_t)
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)
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)
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)
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>)
LoanedSamples<TReq> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.TakeRequests ( )
inline

Provides a loaned container to access the existing requests.

See Also
RTI::Connext::Queuing::QueueConsumer<T>::TakeSamples()
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)
IList<Sample<TReq> > RTI.Connext.Queuing.QueueReplier< TReq, TRep >.TakeRequests ( IList< Sample< TReq >>  requests,
int  maxCount 
)
inline
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 , except the sample remains in the QueueReplier and can be read or taken again.

LoanedSamples<TReq> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.ReadRequests ( )
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(), except the sample remains in the QueueReplier and can be read or taken again.

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.

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 , except the sample remains in the QueueReplier and can be read or taken again.

bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.WaitForRequests ( Duration_t  maxWait)
inline
bool RTI.Connext.Queuing.QueueReplier< TReq, TRep >.WaitForRequests ( int  minCount,
Duration_t  maxWait 
)
inline
void RTI.Connext.Queuing.QueueReplier< TReq, TRep >.AcknowledgeAll ( bool  isPositiveAck)
inline
void RTI.Connext.Queuing.QueueReplier< TReq, TRep >.AcknowledgeRequest ( SampleInfo  sampleInfo,
bool  isPositiveAck 
)
inline
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
Sample<TReq> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.CreateRequestSample ( )
inline

Creates a Sample for receiving requests.

See Also
RTI::Connext::Queuing::QueueConsumer<T>::CreateSample()
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

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_t RTI.Connext.Queuing.QueueReplier< TReq, TRep >.Guid
get

Returns the GUID of this QueueReplier.

The QueueReplier's GUID is the same GUID of both underlying QueueProducer and QueueConsumer.

See Also
RTI::Connext::Queuing::QueueReplierParams<TReq,TRep>::SetEntityName
RTI::Connext::Queuing::QueueProducer<T>::Guid
RTI::Connext::Queuing::QueueConsumer<T>::Guid
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
QueueProducer<TRep> RTI.Connext.Queuing.QueueReplier< TReq, TRep >.Producer
get

Retrieves the underlying DDS::DataWriter.

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

Retrieves the underlying DDS::DataReader.


RTI Connext .Net APIs Version 5.2.0 Copyright © Sun Jun 21 2015 Real-Time Innovations, Inc