RTI Connext Modern C++ API  Version 6.1.0
dds::sub::status::ViewState Class Reference

Indicates whether or not an instance is new. More...

#include <dds/sub/status/DataState.hpp>

Inherits bitset< OMG_DDS_STATE_BIT_COUNT >.

Public Types

typedef std::bitset< OMG_DDS_STATE_BIT_COUNT > MaskType
 An std::bitset of ViewStates. More...
 

Public Member Functions

 ViewState (const MaskType &other)
 Create an ViewState from MaskType. More...
 

Static Public Member Functions

static const ViewState new_view ()
 Creates a new_view ViewState object. More...
 
static const ViewState not_new_view ()
 Creates a not_new_view ViewState object. More...
 
static const ViewState any ()
 Creates a ViewState object representing any view state. More...
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, const ViewState &s)
 Prints a view state as a readable string. More...
 

Detailed Description

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 dds::sub::DataReader. The view state can be either:

The view_state available in the dds::sub::SampleInfo is a snapshot of the view state of the instance relative to the dds::sub::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 dds::sub::DataReader, the middleware can reclaim all local resources regarding the instance. Future samples will be treated as "never seen."

Member Typedef Documentation

◆ MaskType

typedef std::bitset<OMG_DDS_STATE_BIT_COUNT > dds::sub::status::ViewState::MaskType

An std::bitset of ViewStates.

Constructor & Destructor Documentation

◆ ViewState()

dds::sub::status::ViewState::ViewState ( const MaskType other)
inline

Create an ViewState from MaskType.

Parameters
otherThe MaskType to create the ViewState with

Member Function Documentation

◆ new_view()

static const ViewState dds::sub::status::ViewState::new_view ( )
inlinestatic

Creates a new_view ViewState object.

A new_view ViewState indicates that the latest generation of the instance has not previously been accessed.

Referenced by dds::sub::status::DataState::new_instance().

◆ not_new_view()

static const ViewState dds::sub::status::ViewState::not_new_view ( )
inlinestatic

Creates a not_new_view ViewState object.

Indicates that the latest generation of an instance has previously been accessed.

◆ any()

static const ViewState dds::sub::status::ViewState::any ( )
inlinestatic

Creates a ViewState object representing any view state.

This is equivalent to new_view() | not_new_view()

Referenced by dds::sub::status::DataState::any(), dds::sub::status::DataState::any_data(), and dds::sub::status::DataState::new_data().

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const ViewState s 
)
related

Prints a view state as a readable string.