RTI Connext Java API  Version 6.1.1
WriteParams_t Class Reference

<<extension>> Input parameters for writing with com.rti.ndds.example.FooDataWriter.write_w_params, com.rti.ndds.example.FooDataWriter.dispose_w_params, com.rti.ndds.example.FooDataWriter.register_instance_w_params, com.rti.ndds.example.FooDataWriter.unregister_instance_w_params More...

Inheritance diagram for WriteParams_t:
Copyable PublicationPriority

Public Member Functions

 WriteParams_t ()
 Construct a new WriteParams_t. More...
 
 WriteParams_t (boolean replace_auto, SampleIdentity_t identity, SampleIdentity_t related_sample_identity, Time_t source_timestamp, Cookie_t cookie, InstanceHandle_t handle, int priority, int flag, GUID_t source_guid, GUID_t related_source_guid, GUID_t related_reader_guid)
 Construct a new WriteParams_t with the given members. More...
 
Object copy_from (Object src)
 Copy value of a data type from source. More...
 

Public Attributes

SampleIdentity_t identity
 Identity of the sample. More...
 
final SampleIdentity_t related_sample_identity
 The identity of another sample related to this one. More...
 
Time_t source_timestamp = new Time_t(Time_t.TIME_INVALID)
 Source timestamp upon write. More...
 
InstanceHandle_t handle = new InstanceHandle_t()
 Instance handle. More...
 
int priority = UNDEFINED
 Publication priority. More...
 
int flag = 0
 Flags associated with the sample. More...
 
GUID_t source_guid = new GUID_t(GUID_t.GUID_AUTO)
 Identifies the application logical data source associated with the sample being written. More...
 
GUID_t related_source_guid = new GUID_t()
 Identifies the application logical data source that is related to the sample being written. More...
 
GUID_t related_reader_guid = new GUID_t()
 Identifies a DataReader that is logically related to the sample that is being written. More...
 

Additional Inherited Members

- Static Public Attributes inherited from PublicationPriority
static final int UNDEFINED
 Initializer value for com.rti.dds.infrastructure.PublishModeQosPolicy.priority and/or com.rti.dds.infrastructure.ChannelSettings_t.priority. More...
 
static final int AUTOMATIC
 Constant value for com.rti.dds.infrastructure.PublishModeQosPolicy.priority and/or com.rti.dds.infrastructure.ChannelSettings_t.priority. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ WriteParams_t() [1/2]

◆ WriteParams_t() [2/2]

WriteParams_t ( boolean  replace_auto,
SampleIdentity_t  identity,
SampleIdentity_t  related_sample_identity,
Time_t  source_timestamp,
Cookie_t  cookie,
InstanceHandle_t  handle,
int  priority,
int  flag,
GUID_t  source_guid,
GUID_t  related_source_guid,
GUID_t  related_reader_guid 
)

Member Function Documentation

◆ copy_from()

Object copy_from ( Object  src)

Copy value of a data type from source.

Copy data into this object from another. This copy is intended to be a deep copy, so that all data members (recursively) are copied (not just resetting Object references).

This operation returns the object that is copied if copy is successful.

Parameters
src<<in>> The Object which contains the data to be copied.
Returns
Generally, return this but special cases (such as Enum) exist.
Exceptions
NullPointerExceptionIf src is null.
ClassCastExceptionIf src is not the same type as this.

Implements Copyable.

References SampleIdentity_t.AUTO_SAMPLE_IDENTITY, InstanceHandle_t.copy_from(), Time_t.copy_from(), AbstractPrimitiveSequence.copy_from(), WriteParams_t.flag, GUID_t.GUID_UNKNOWN, WriteParams_t.handle, WriteParams_t.identity, Time_t.nanosec, WriteParams_t.priority, WriteParams_t.related_reader_guid, WriteParams_t.related_sample_identity, WriteParams_t.related_source_guid, Time_t.sec, WriteParams_t.source_guid, WriteParams_t.source_timestamp, Time_t.TIME_INVALID, Cookie_t.value, and WriteParams_t.WriteParams_t().

Member Data Documentation

◆ identity

SampleIdentity_t identity
Initial value:
=
new SampleIdentity_t(SampleIdentity_t.AUTO_SAMPLE_IDENTITY)

Identity of the sample.

Identifies the sample being written. The identity consists of a pair (Virtual Writer GUID, Virtual Sequence Number).

Use the default value to let RTI Connext determine the sample identity as follows:

  • The sequence number is increased by one with respect to the previous value.

The virtual sequence numbers for a virtual writer must be strictly monotonically increasing. If the user tries to write a sample with a sequence number smaller or equal to the last sequence number, the write operation will fail.

A DataReader can access the identity of a received sample by using the fields com.rti.dds.subscription.SampleInfo.original_publication_virtual_guid and com.rti.dds.subscription.SampleInfo.original_publication_virtual_sequence_number in the com.rti.dds.subscription.SampleInfo.

[default] com.rti.dds.infrastructure.SampleIdentity_t.SampleIdentity_t.AUTO_SAMPLE_IDENTITY.

Referenced by WriteParams_t.copy_from().

◆ related_sample_identity

final SampleIdentity_t related_sample_identity
Initial value:
=
new SampleIdentity_t(SampleIdentity_t.UNKNOWN_SAMPLE_IDENTITY)

The identity of another sample related to this one.

Identifies another sample that is logically related to the one that is written.

When this field is set, the related sample identity is propagated and subscribing applications can retrieve it from the com.rti.dds.subscription.SampleInfo (see com.rti.dds.subscription.SampleInfo.get_related_sample_identity).

The default value is com.rti.dds.infrastructure.SampleIdentity_t.SampleIdentity_t.UNKNOWN_SAMPLE_IDENTITY, and is not propagated.

A DataReader can access the related identity of a received sample by using the fields com.rti.dds.subscription.SampleInfo.related_original_publication_virtual_guid and com.rti.dds.subscription.SampleInfo.related_original_publication_virtual_sequence_number in the com.rti.dds.subscription.SampleInfo.

[default] com.rti.dds.infrastructure.SampleIdentity_t.SampleIdentity_t.UNKNOWN_SAMPLE_IDENTITY

Referenced by WriteParams_t.copy_from(), and Replier< TReq, TRep >.createRequestSample().

◆ source_timestamp

Time_t source_timestamp = new Time_t(Time_t.TIME_INVALID)

Source timestamp upon write.

Specifies the source timestamp that will be available to the com.rti.dds.subscription.DataReader objects by means of the source_timestamp attribute within the com.rti.dds.subscription.SampleInfo.

[default] com.rti.dds.infrastructure.Time_t.INVALID.

Referenced by WriteParams_t.copy_from(), DynamicDataWriter.dispose_w_timestamp_untyped(), DynamicDataWriter.register_instance_w_timestamp(), DynamicDataWriter.unregister_instance_w_timestamp(), and DynamicDataWriter.write_w_timestamp().

◆ handle

◆ priority

int priority = UNDEFINED

Publication priority.

A positive integer value designating the relative priority of the com.rti.dds.publication.DataWriter, used to determine the transmission order of pending writes.

Use of publication priorities requires the asynchronous publisher (com.rti.dds.infrastructure.PublishModeQosPolicyKind.PublishModeQosPolicyKind.ASYNCHRONOUS_PUBLISH_MODE_QOS) with com.rti.dds.publication.FlowControllerProperty_t.scheduling_policy set to com.rti.dds.publication.FlowControllerSchedulingPolicy.FlowControllerSchedulingPolicy.HPF_FLOW_CONTROLLER_SCHED_POLICY.

Larger numbers have higher priority.

For multi-channel DataWriters, if the publication priority of any channel is set to any value other than com.rti.dds.infrastructure.PUBLICATION_PRIORITY_UNDEFINED, then the channel's priority will take precedence over that of the DataWriter.

For multi-channel DataWriters, if the publication priority of any channel is com.rti.dds.infrastructure.PUBLICATION_PRIORITY_UNDEFINED, then the channel will inherit the publication priority of the DataWriter.

If the publicaton priority of the DataWriter, and of any channel of a multi-channel DataWriter, are com.rti.dds.infrastructure.PUBLICATION_PRIORITY_UNDEFINED, then the priority of the DataWriter or DataWriter channel will be assigned the lowest priority value.

If the publication priority of the DataWriter is com.rti.dds.infrastructure.PUBLICATION_PRIORITY_AUTOMATIC, then the DataWriter will be assigned the priority of the largest publication priority of all samples in the DataWriter.

The publication priority of each sample can be set in the com.rti.dds.infrastructure.WriteParams_t of the com.rti.ndds.example.FooDataWriter.write_w_params function.

For dispose and unregister samples, use the com.rti.dds.infrastructure.WriteParams_t of com.rti.ndds.example.FooDataWriter.dispose_w_params and com.rti.ndds.example.FooDataWriter.unregister_instance_w_params.

[default] com.rti.dds.infrastructure.PUBLICATION_PRIORITY_UNDEFINED

Referenced by WriteParams_t.copy_from(), and WriteParams_t.WriteParams_t().

◆ flag

int flag = 0

Flags associated with the sample.

The flags are represented as a 32-bit integer, of which only the 16 least-significant bits are used.

RTI reserves least-significant bits [0-7] for middleware-specific usage.

The application can use least-significant bits [8-15].

The first bit (com.rti.dds.infrastructure.SampleFlagBits.REDELIVERED_SAMPLE) is reserved for marking samples as redelivered when using RTI Queuing Service.

The second bit (com.rti.dds.infrastructure.SampleFlagBits.INTERMEDIATE_REPLY_SEQUENCE_SAMPLE) is used to indicate that a response sample is not the last response sample for a given request. This bit is usually set by a Replier sending multiple responses for a request.

An application can inspect the flags associated with a received sample by checking the field com.rti.dds.subscription.SampleInfo.flag.

[default] 0 (no flags are set)

Referenced by WriteParams_t.copy_from(), and WriteParams_t.WriteParams_t().

◆ source_guid

GUID_t source_guid = new GUID_t(GUID_t.GUID_AUTO)

Identifies the application logical data source associated with the sample being written.

When this field is set, the source_guid is propagated and subscribing applications can retrieve it from the com.rti.dds.subscription.SampleInfo (see com.rti.dds.subscription.SampleInfo.source_guid).

The default value is com.rti.dds.infrastructure.GUID_t.GUID_AUTO, and is not propagated.

The main use case for source_guid and related_source_guid is a request/reply scenario in which a reply has to be sent only to the Requester that issue the related request.

In this case, the Requester's DataWriter will send a request setting the source_guid to an unique value. This value must be the same value even after Requester restart.

The Replier's DataReader will get the request's source_guid from the SampleInfo and it will send it as the related_source_guid of the reply using the Replier's DataWriter.

The Requester's DataReader will install a CFT on the related_source_guid using a filter expression. For example:

@related_source_guid.value = &hex(00000000000000000000000000000001)

This way the reply will be send only to the right Requester.

The source_guid and related_source_guid fields are used by RTI Queuing Service in a request/reply scenario.

[default] com.rti.dds.infrastructure.GUID_t.GUID_AUTO (the source_guid is automatically set to the com.rti.dds.publication.DataWriter virtual GUID).

See also
com.rti.dds.infrastructure.WriteParams_t.related_source_guid

Referenced by WriteParams_t.copy_from().

◆ related_source_guid

GUID_t related_source_guid = new GUID_t()

Identifies the application logical data source that is related to the sample being written.

When this field is set, the related_source_guid is propagated and subscribing applications can retrieve it from the com.rti.dds.subscription.SampleInfo (see com.rti.dds.subscription.SampleInfo.related_source_guid).

The default value is com.rti.dds.infrastructure.GUID_t.GUID_UNKNOWN, and is not propagated.

[default] com.rti.dds.infrastructure.GUID_t.GUID_UNKNOWN

See also
com.rti.dds.infrastructure.WriteParams_t.source_guid

Referenced by WriteParams_t.copy_from().

◆ related_reader_guid

GUID_t related_reader_guid = new GUID_t()

Identifies a DataReader that is logically related to the sample that is being written.

When this field is set, the related_reader_guid is propagated and subscribing applications can retrieve it from the com.rti.dds.subscription.SampleInfo (see com.rti.dds.subscription.SampleInfo.related_subscription_guid).

The default value is com.rti.dds.infrastructure.GUID_t.GUID_UNKNOWN, and is not propagated.

The main use case for this field is point-to-point sample distribution using CFT. DataReaders install a CFT on the related_reader_guid using a unique GUID. For example, the filter for DataReader 'n' can be:

@related_reader_guid.value = &hex(00000000000000000000000000000001)

Then, a DataWriter that wants to send the sample to DataReader 'n' will use the com.rti.ndds.example.FooDataWriter.write_w_params method and set related_reader_guid to the value used by DataReader 'n' in its filter expression.

This field is currently used by RTI Queuing Service to distribute a sample to only one of the Consumer's DataReaders attached to a SharedReaderQueue.

[default] com.rti.dds.infrastructure.GUID_t.GUID_UNKNOWN

Referenced by WriteParams_t.copy_from().