Enum ViewStateKind

Enum Documentation

enum eprosima::fastdds::dds::ViewStateKind

Indicates whether or not an instance is new.

For each instance (identified by the key), the middleware internally maintains a view state relative to each DataReader. This view state can have the following values:

  • NEW_VIEW_STATE indicates that either this is the first time that the DataReader has ever accessed samples of that instance, or else that the DataReader has accessed previous samples of the instance, but the instance has since been reborn (i.e. become not-alive and then alive again). These two cases are distinguished by examining the SampleInfo::disposed_generation_count and the SampleInfo::no_writers_generation_count.

  • NOT_NEW_VIEW_STATE indicates that the DataReader has already accessed samples of the same instance and that the instance has not been reborn since.

The view_state available in the SampleInfo is a snapshot of the view state of the instance relative to the DataReader used to access the samples at the time the collection was obtained (i.e. at the time read or take was called). The view_state is therefore the same for all samples in the returned collection that refer to the same instance.

Once an instance has been detected as not having any “live” writers and all the samples associated with the instance are “taken” from the DDSDataReader, the middleware can reclaim all local resources regarding the instance. Future samples will be treated as “never seen.”

Values:

enumerator NEW_VIEW_STATE

New instance.This latest generation of the instance has not previously been accessed.

enumerator NOT_NEW_VIEW_STATE

Not a new instance. This latest generation of the instance has previously been accessed.