RTI Connext .Net APIs
Version 5.2.3
|
Allows you to send samples to a specific SharedReaderQueue hosted by Queuing Service. More...
Inherits AlreadyDisposedHelper< QueueProducer< T >>, and IDisposable.
Inherited by RTI.Connext.Queuing.QueueProducer< T >.EmptyProducerListener, and RTI.Connext.Queuing.QueueProducer< T >.QueueProducerWriterListener.
Public Member Functions | |
QueueProducer (DomainParticipant participant, String queueTopicName, TypeSupport queueTypeSupport) | |
Creates a QueueProducer with the minimum set of parameters. | |
QueueProducer (QueueProducerParams< T > parameters) | |
Creates a QueueProducer with parameters. | |
void | SendSample (T sample) |
Sends a sample. | |
void | SendSample (WriteSample< T > sample) |
Sends a sample with the specified parameters and gets back metadata information related to the sample sent. | |
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. | |
bool | WaitForAcknowledgements (SampleIdentity_t identity, Duration_t maxWait) |
Blocks the calling thread until the sample identified by identity is acknowledged by Queuing Service. | |
bool | HasMatchingSharedReaderQueue () |
Checks whether this QueueProducer has matched with at least one SharedReaderQueue. | |
WriteSample< T > | CreateWriteSample () |
Creates a WriteSample for sending samples. | |
WriteSample< T > | CreateWriteSample (T data) |
Creates a WriteSample for sending samples. | |
Properties | |
TypedDataWriter< T > | Writer [get] |
Retrieves the underlying DDS::DataWriter. | |
GUID_t | Guid [get] |
Returns the GUID of this QueueProducer. | |
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 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.
params | 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 |
|
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. |
|
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 ; |
|
inline |
Creates a WriteSample for sending samples.
T
initialized with default values and default write parameters.
|
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.
|
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.