OpenSplice C# API  v6.x
OpenSplice C# Data Distribution Service Data-Centric Publish-Subscribe API
DDS.SampleInfo Class Reference

The class SampleInfo represents the additional information that accompanies the data in each sample that is read or taken. More...

Collaboration diagram for DDS.SampleInfo:
Collaboration graph

Public Attributes

int AbsoluteGenerationRank
 The generation difference between the time the sample was received and the time the most recent sample was received. More...
 
int DisposedGenerationCount
 The number of times the instance has become alive after it was disposed of explicitly by a DataWriter. More...
 
int GenerationRank
 The generation difference between the time the sample was received and the time the most recent sample in the collection was received. More...
 
InstanceHandle InstanceHandle
 The handle that identifies locally the corresponding instance. More...
 
InstanceStateKind InstanceState
 The instance_state of the related instance (i.e., if the instance is ALIVE, NOT_ALIVE_DISPOSED, or NOT_ALIVE_NO_WRITERS). More...
 
int NoWritersGenerationCount
 The number of times the instance has become alive after it was disposed of because there were no DataWriter objects. More...
 
InstanceHandle PublicationHandle
 The handle that identifies locally the DataWriter that modified the instance. More...
 
Time ReceptionTimestamp
 The timestamp provided by the DataReader when the sample was received. More...
 
int SampleRank
 The number of samples related to the same instance that are found in the collection returned by a read or take operation. More...
 
SampleStateKind SampleState
 The sample_state of the Data value (i.e., if the sample has already been READ or NOT_READ by that same DataReader). More...
 
Time SourceTimestamp
 The timestamp provided by the DataWriter at the time the sample was produced. More...
 
bool ValidData
 Indicates whether the DataSample contains any meaningful data. More...
 
ViewStateKind ViewState
 The view_state of the related instance (i.e., if the instance is NEW, or NOT_NEW for that DataReader). More...
 

Detailed Description

The class SampleInfo represents the additional information that accompanies the data in each sample that is read or taken.

Generations

A generation is defined as: ‘the number of times an instance has become alive (with instance_state==ALIVE_INSTANCE_STATE) at the time the sample was received’. Note that the generation counters are initialized to zero when a DataReader first detects a never-seen-before instance. Two types of generations are distinguished: DisposedGenerationCount and NoWritersGenerationCount. After a DataWriter disposes an instance, the disposed_generation_count for all DataReaders that already knew that instance will be incremented the next time the instance is written again. If the DataReader detects that there are no live DataWriter entities, the instance_state of the sample_info will change from ALIVE_INSTANCE_STATE to NOT_ALIVE_NO_WRITERS_INSTANCE_STATE. The next time the instance is written, no_writers_generation_count will be incremented.

Sample Information

SampleInfo is the additional information that accompanies the data in each sample that is ‘read’ or ‘taken’. It contains the following information:

  • SampleState (READ_SAMPLE_STATE or NOT_READ_SAMPLE_STATE) indicates whether or not the corresponding data sample has already been read.
  • ViewState (NEW_VIEW_STATE or NOT_NEW_VIEW_STATE) indicates whether the DataReader has already seen samples of the most-current generation of the related instance.
  • InstanceState (ALIVE_INSTANCE_STATE, NOT_ALIVE_DISPOSED_ INSTANCE_STATE, or NOT_ALIVE_NO_WRITERS_INSTANCE_STATE) indicates whether the instance is alive, has no writers or if it has been disposed of:
    • ALIVE_INSTANCE_STATE if this instance is currently in existence.
    • NOT_ALIVE_DISPOSED_INSTANCE_STATE if this instance was disposed of by a DataWriter.
    • NOT_ALIVE_NO_WRITERS_INSTANCE_STATE none of the DataWriter objects currently “alive” (according to the LivelinessQosPolicy) are writing the instance.
  • SourceTimestamp indicates the time provided by the DataWriter when the sample was written.
  • InstanceHandle indicates locally the corresponding instance.
  • PublicationHandle is used by the DDS implementation to locally identify the corresponding source DataWriter. You can access more detailed information about this particular publication by passing its PublicationHandle to either the get_matched_publication_data operation on the DataReader or to the read_instance operation on the built-in reader for the “DCPSPublication" "topic.

Be aware that since an Instance Handle is an opaque datatype, it does not necessarily mean that the handle obtained from the publication_handle has the same value as the one that appears in the instance_handle field of the SampleInfo when retrieving the publication info through corresponding "DCPSPublication" built-in reader. You can’t just compare two handles to determine whether they represent the same publication. If you want to know whether two handles actually do represent the same publication, use both handles to retrieve their corresponding PublicationBuiltinTopicData samples and then compare the key field of both samples.

Definition at line 3059 of file DdsDcpsStructs.cs.

Member Data Documentation

◆ AbsoluteGenerationRank

int DDS.SampleInfo.AbsoluteGenerationRank

The generation difference between the time the sample was received and the time the most recent sample was received.

Definition at line 3092 of file DdsDcpsStructs.cs.

◆ DisposedGenerationCount

int DDS.SampleInfo.DisposedGenerationCount

The number of times the instance has become alive after it was disposed of explicitly by a DataWriter.

Definition at line 3076 of file DdsDcpsStructs.cs.

◆ GenerationRank

int DDS.SampleInfo.GenerationRank

The generation difference between the time the sample was received and the time the most recent sample in the collection was received.

Definition at line 3088 of file DdsDcpsStructs.cs.

◆ InstanceHandle

InstanceHandle DDS.SampleInfo.InstanceHandle

The handle that identifies locally the corresponding instance.

Definition at line 3100 of file DdsDcpsStructs.cs.

◆ InstanceState

InstanceStateKind DDS.SampleInfo.InstanceState

The instance_state of the related instance (i.e., if the instance is ALIVE, NOT_ALIVE_DISPOSED, or NOT_ALIVE_NO_WRITERS).

Definition at line 3072 of file DdsDcpsStructs.cs.

◆ NoWritersGenerationCount

int DDS.SampleInfo.NoWritersGenerationCount

The number of times the instance has become alive after it was disposed of because there were no DataWriter objects.

Definition at line 3080 of file DdsDcpsStructs.cs.

◆ PublicationHandle

InstanceHandle DDS.SampleInfo.PublicationHandle

The handle that identifies locally the DataWriter that modified the instance.

In fact it is an instance_handle of the built-in DCPSPublication sample that describes this DataWriter. It can be used as a parameter to the DataReader operation GetMatchedPublicationData to obtain this built-in DCPSPublication sample.

Definition at line 3109 of file DdsDcpsStructs.cs.

◆ ReceptionTimestamp

Time DDS.SampleInfo.ReceptionTimestamp

The timestamp provided by the DataReader when the sample was received.

Definition at line 3122 of file DdsDcpsStructs.cs.

◆ SampleRank

int DDS.SampleInfo.SampleRank

The number of samples related to the same instance that are found in the collection returned by a read or take operation.

Definition at line 3084 of file DdsDcpsStructs.cs.

◆ SampleState

SampleStateKind DDS.SampleInfo.SampleState

The sample_state of the Data value (i.e., if the sample has already been READ or NOT_READ by that same DataReader).

Definition at line 3064 of file DdsDcpsStructs.cs.

◆ SourceTimestamp

Time DDS.SampleInfo.SourceTimestamp

The timestamp provided by the DataWriter at the time the sample was produced.

Definition at line 3096 of file DdsDcpsStructs.cs.

◆ ValidData

bool DDS.SampleInfo.ValidData

Indicates whether the DataSample contains any meaningful data.

If not, the sample is only used to communicate a change in the instance_state of the instance.

Definition at line 3118 of file DdsDcpsStructs.cs.

◆ ViewState

ViewStateKind DDS.SampleInfo.ViewState

The view_state of the related instance (i.e., if the instance is NEW, or NOT_NEW for that DataReader).

Definition at line 3068 of file DdsDcpsStructs.cs.


The documentation for this class was generated from the following file: