RTI Connext .NET API (legacy)
Version 6.1.1
|
Allows you to send samples to a specific SharedReaderQueue hosted by Queuing Service. More...
Inherits AlreadyDisposedHelper< QueueProducer< T >>, and IDisposable.
Public Member Functions | |
QueueProducer (DomainParticipant participant, String queueTopicName, TypeSupport queueTypeSupport) | |
Creates a QueueProducer with the minimum set of parameters. More... | |
QueueProducer (QueueProducerParams< T > parameters) | |
Creates a QueueProducer with parameters. More... | |
void | SendSample (T sample) |
Sends a sample. More... | |
void | SendSample (WriteSample< T > sample) |
Sends a sample with the specified parameters and gets back metadata information related to the sample sent. More... | |
bool | WaitForAcknowledgements (Duration_t maxWait) |
Blocks the calling thread until all samples written by this QueueProducer since the last call to this method are acknowledged by Queuing Service. More... | |
bool | WaitForAcknowledgements (SampleIdentity_t identity, Duration_t maxWait) |
Blocks the calling thread until the sample identified by identity is acknowledged by Queuing Service. More... | |
bool | HasMatchingSharedReaderQueue () |
Checks whether this QueueProducer has matched with at least one SharedReaderQueue. More... | |
WriteSample< T > | CreateWriteSample () |
Creates a WriteSample for sending samples. More... | |
WriteSample< T > | CreateWriteSample (T data) |
Creates a WriteSample for sending samples. More... | |
Properties | |
TypedDataWriter< T > | Writer [get] |
Retrieves the underlying DDS::DataWriter. More... | |
GUID_t | Guid [get] |
Returns the GUID of this QueueProducer. More... | |
Allows you to send samples to a specific SharedReaderQueue hosted by Queuing Service.
A QueueProducer is an entity that allows you to send samples to a SharedReaderQueue hosted by Queuing Service. A QueueProducer has one underlying DDS::DataWriter to communicate with a SharedReaderQueue.
Valid types for the topic of the DataWriter (T
) are those generated by the rtiddsgen code generator , the DDS built-in types , and DDS::DynamicData.
For example:
To send samples to a SharedReaderQueue, a QueueProducer must set its topic name (see RTI::Connext::Queuing::QueueProducerParams<T>::SetQueueTopicName) equal to the SharedReaderQueue topic name.
The QueueProducer and the SharedReadeeQueue must also be in the same DDS domain (that is, they must have the same domain ID).
A QueueProducer has an associated DDS::DomainParticipant, which can be shared with other QueueProducers or RTI Connext routines. All the other RTI Connext entities required for queuing interaction, including a DDS::DataWriter for writing samples, are automatically created when the QueueProducer is constructed.
Quality of Service (QoS) for the underlying DataWriter is configurable (see RTI::Connext::Queuing::QueueProducerParams<T>::SetQosProfile and RTI::Connext::Queuing::QueueProducerParams<T>::SetDataWriterQos).
If no QoS is specified in the RTI::Connext::Queuing::QueueProducerParams<T>, the default DataWriterQos will be used.
A QueueProducer must always be reliable in order to match and communicate with the SharedReaderQueue. Hence, whichever DataWriterQos is selected, the following QoS setting is always overriden:
The underlying DataWriter is created with an internal DDS::DataWriterListener, which is required to provide the behavior of a QueueProducer, including the notification of events via RTI::Connext::Queuing::QueueProducerListener<T>. For this reason, when accessing the underlying DataWriter, the listener should not be set, removed or modified; otherwise the behavior of the QueueProducer will be incorrect and unpredictable.
T | The data type for the SharedReaderQueue topic |
T | : | class | |
T | : | global | |
T | : | DDS.ICopyable<T> | |
T | : | new() |
|
inline |
Creates a QueueProducer with the minimum set of parameters.
participant | The DomainParticipant this requester uses to join a DDS domain |
queueTopicName | The queue topic name as specified in a Queuing Service SharedReaderQueue configuration. See RTI::Connext::Queuing::QueueProducerParams<T>::SetQueueTopicName |
queueTypeSupport | The type support for type T |
One | of the Standard Return Codes |
|
inline |
Creates a QueueProducer with parameters.
parameters | All the parameters that configure this QueueProducer. See RTI::Connext::Queuing::QueueProducerParams<T> for the list of required parameters. |
One | of the Standard Return Codes |
|
inline |
Sends a sample.
This operation is equivalent to calling SendSample(WriteSample<T>) using a default RTI::Connext::Infrastructure::WriteSample<T>.
sample | The sample to be sent |
One | of the Standard Return Codes or RTI::Connext::Queuing::Infrastructure::NoMatchingQueueException |
Referenced by RTI.Connext.Queuing.QueueReplier< TReq, TRep >.SendReply(), and RTI.Connext.Queuing.QueueRequester< TReq, TRep >.SendRequest().
|
inline |
Sends a sample with the specified parameters and gets back metadata information related to the sample sent.
After calling this operation, the sample contains valid metadata information associated with the sample sent.
The metadata field DDS::WriteParams_t::source_guid of the write parameters in the sample is always set to this QueueProducer's GUID.
sample | <<inout>> Contains the sample and optional write parameters. When this call ends successfully, RTI::Connext::Infrastructure::WriteSample<T> contains valid metadata information associated with the sample sent. |
One | of the Standard Return Codes or RTI::Connext::Queuing::Infrastructure::NoMatchingQueueException if by the time this operation is called there is not a single matching SharedReaderQueue. |
|
inline |
Blocks the calling thread until all samples written by this QueueProducer since the last call to this method are acknowledged by Queuing Service.
This operation will keep the calling thread blocked as long as there are samples pending on acknowledgement, unless a timeout occurs.
After unblocking, the return value is true if all samples have been acknowledged positively or false if at least one of them was acknowledged negatively.
If there is a timeout, this operation throws DDS::Retcode_Timeout.
This operation requires setting RTI::Connext::Queuing::QueueProducerParams<T>::SetEnableWaitForAck to true. Otherwise, it will throw DDS::Retcode_PreconditionNotMet.
When a SharedReaderQueue is not replicated, a sample is acknowledged positively once the running Queuing Service instance has enqueued the sample.
When a SharedReaderQueue is replicated, a sample is acknowledged positively once it has been enqueued by the Queuing Service instance acting as a master. This means that the sample has been received and enqueued by a configurable quorum of instances (using <replication_settings>/<queue_instances>).
This operation waits until all the previously written samples since the last call to this method are acknowledged. If you want to wait for a specific sample, use the method RTI::Connext::Queuing::QueueProducer<T>::WaitForAcknowledgements(SampleIdentity_t,Duration_t).
This operation cannot be called by two threads concurrently. If this occurs, the second thread will throw DDS::Retcode_PreconditionNotMet.
This operation cannot be called concurrently with RTI::Connext::Queuing::QueueProducer<T>::WaitForAcknowledgements(SampleIdentity_t,Duration_t) either.
maxWait | <<in>> Maximum waiting time. |
One | of the Standard Return Codes ; RTI::Connext::Queuing::Infrastructure::NoMatchingQueueException if during this call, the QueueProducer lost the matching status with Queuing Service. DDS::Retcode_Timeout if a timeout occurs before receiving all the acknowledgments. |
Referenced by RTI.Connext.Queuing.QueueRequester< TReq, TRep >.WaitForAcknowledgements(), and RTI.Connext.Queuing.QueueReplier< TReq, TRep >.WaitForAcknowledgements().
|
inline |
Blocks the calling thread until the sample identified by identity is acknowledged by Queuing Service.
This operation blocks the calling thread until the sample identified by identity is acknowledged by Queuing Service or there is a timeout.
After unblocking, the return value is true if the sample has been acknowledged positively or false if the sample has been acknowledged negatively.
If there is a timeout, this operation throws DDS::Retcode_Timeout.
This operation requires setting RTI::Connext::Queuing::QueueProducerParams<T>::SetEnableWaitForAck to true. Otherwise, it will throw DDS::Retcode_PreconditionNotMet.
When a SharedReaderQueue is not replicated, a sample is acknowledged positively once the running Queuing Service instance has enqueued the sample.
When a SharedReaderQueue is replicated, a sample is acknowledged positively once it has been enqueued by the Queuing Service instance acting as a master. This means that the sample has been received and enqueued by a configurable quorum of instances (using <replication_settings>/<queue_instances>).
This operation cannot be called by two threads concurrently on the same identity. If this occurs, the second thread will throw DDS::Retcode_PreconditionNotMet.
This operation cannot be called concurrently with RTI::Connext::Queuing::QueueProducer<T>::WaitForAcknowledgements(Duration_t) either.
One | of the Standard Return Codes ; RTI::Connext::Queuing::Infrastructure::NoMatchingQueueException if during this call, the QueueProducer lost the matching status with Queuing Service. DDS::Retcode_Timeout if a timeout occurs before receiving all the acknowledgments. |
|
inline |
Checks whether this QueueProducer has matched with at least one SharedReaderQueue.
One | of the Standard Return Codes ; |
Referenced by RTI.Connext.Queuing.QueueReplier< TReq, TRep >.HasMatchingReplySharedReaderQueue(), and RTI.Connext.Queuing.QueueRequester< TReq, TRep >.HasMatchingRequestSharedReaderQueue().
|
inline |
Creates a WriteSample for sending samples.
T
initialized with default values and default write parameters. Referenced by RTI.Connext.Queuing.QueueReplier< TReq, TRep >.CreateReplySample(), and RTI.Connext.Queuing.QueueRequester< TReq, TRep >.CreateRequestSample().
|
inline |
Creates a WriteSample for sending samples.
|
get |
Retrieves the underlying DDS::DataWriter.
Accessing the DataWriter may be useful for a number of advanced use cases, such as getting the DataWriter protocol or cache statuses.
Referenced by RTI.Connext.Queuing.QueueReplier< TReq, TRep >.QueueReplier(), and RTI.Connext.Queuing.QueueRequester< TReq, TRep >.QueueRequester().
|
get |
Returns the GUID of this QueueProducer.
The GUID of the QueueProducer is determined based on the value of RTI::Connext::Queuing::QueueProducerParams<T>::SetEntityName and RTI::Connext::Queuing::QueueProducerParams<T>::SetQueueTopicName. Note that the QueueProducer GUID may be equal to or different than the GUID of the underlying DataWriter virtual GUID.
The GUID identifies a QueueProducer and the samples it writes. This is the value set in the source GUID of the samples sent by the QueueProducer.
Referenced by RTI.Connext.Queuing.QueueRequester< TReq, TRep >.QueueRequester().