OpenDDS::DCPS::DataSampleHeader Struct Reference

#include <DataSampleHeader.h>

Collaboration diagram for OpenDDS::DCPS::DataSampleHeader:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DataSampleHeader ()
 DataSampleHeader (ACE_Message_Block &buffer)
 Construct with values extracted from a buffer.
DataSampleHeaderoperator= (ACE_Message_Block &buffer)
 Assignment from an ACE_Message_Block.
size_t marshaled_size () const
 Amount of data read when initializing from a buffer.
void init (ACE_Message_Block *buffer)
 Implement load from buffer.

Static Public Member Functions

static long mask_flag (DataSampleHeaderFlag flag)
static void clear_flag (DataSampleHeaderFlag flag, ACE_Message_Block *buffer)
static void set_flag (DataSampleHeaderFlag flag, ACE_Message_Block *buffer)
static bool test_flag (DataSampleHeaderFlag flag, const ACE_Message_Block *buffer)
static bool partial (const ACE_Message_Block &mb)
 Does the data in this mb constitute a partial Sample Header?
static void add_cfentries (const GUIDSeq *guids, ACE_Message_Block *mb)
static void split (const ACE_Message_Block &orig, size_t size, ACE_Message_Block *&head, ACE_Message_Block *&tail)
static bool join (const DataSampleHeader &first, const DataSampleHeader &second, DataSampleHeader &result)
static size_t max_marshaled_size ()
 Similar to IDL compiler generated methods.

Public Attributes

char message_id_
 The enum MessageId.
char submessage_id_
 Implementation-specific sub-message Ids.
bool byte_order_: 1
bool coherent_change_: 1
bool historic_sample_: 1
bool lifespan_duration_: 1
bool group_coherent_: 1
bool content_filter_: 1
bool sequence_repair_: 1
bool more_fragments_: 1
 The current "Data Sample" needs reassembly before further processing.
ACE_UINT32 message_length_
SequenceNumber sequence_
ACE_INT32 source_timestamp_sec_
ACE_UINT32 source_timestamp_nanosec_
ACE_INT32 lifespan_duration_sec_
ACE_UINT32 lifespan_duration_nanosec_
PublicationId publication_id_
RepoId publisher_id_
GUIDSeq content_filter_entries_

Static Public Attributes

static const size_t FLAGS_OFFSET = 2

Private Attributes

size_t marshaled_size_
 Keep track of the amount of data read from a buffer.

Detailed Description

The header message of a data sample. This header and the data sample are in different message block and will be chained together.


Constructor & Destructor Documentation

ACE_INLINE OpenDDS::DCPS::DataSampleHeader::DataSampleHeader (  ) 

ACE_INLINE OpenDDS::DCPS::DataSampleHeader::DataSampleHeader ( ACE_Message_Block &  buffer  )  [explicit]

Construct with values extracted from a buffer.


Member Function Documentation

void OpenDDS::DCPS::DataSampleHeader::add_cfentries ( const GUIDSeq guids,
ACE_Message_Block *  mb 
) [static]

Marshal the "guids" as an optional header chained as to the continuation of "mb" (which must already be a valid DataSampleHeader serialization). Any existing payload of "mb" (its continuation) will be chained after the new optional header part. "guids" may be null, same serialization as 0.

ACE_INLINE void OpenDDS::DCPS::DataSampleHeader::clear_flag ( DataSampleHeaderFlag  flag,
ACE_Message_Block *  buffer 
) [static]

The clear_flag and set_flag methods are a hack to update the header flags after a sample has been serialized without deserializing the entire message. This method will break if the current Serializer behavior changes.

void OpenDDS::DCPS::DataSampleHeader::init ( ACE_Message_Block *  buffer  ) 

Implement load from buffer.

bool OpenDDS::DCPS::DataSampleHeader::join ( const DataSampleHeader first,
const DataSampleHeader second,
DataSampleHeader result 
) [static]

If "first" and "second" are two fragments of the same original message (as created by split()), return true and set up the "result" header to match the original header. Joining the data payload is the responsibility of the caller (manipulate the continuation chain).

ACE_INLINE size_t OpenDDS::DCPS::DataSampleHeader::marshaled_size (  )  const

Amount of data read when initializing from a buffer.

ACE_INLINE long OpenDDS::DCPS::DataSampleHeader::mask_flag ( DataSampleHeaderFlag  flag  )  [static]

ACE_INLINE size_t OpenDDS::DCPS::DataSampleHeader::max_marshaled_size (  )  [static]

Similar to IDL compiler generated methods.

ACE_INLINE OpenDDS::DCPS::DataSampleHeader & OpenDDS::DCPS::DataSampleHeader::operator= ( ACE_Message_Block &  buffer  ) 

Assignment from an ACE_Message_Block.

bool OpenDDS::DCPS::DataSampleHeader::partial ( const ACE_Message_Block &  mb  )  [static]

Does the data in this mb constitute a partial Sample Header?

ACE_INLINE void OpenDDS::DCPS::DataSampleHeader::set_flag ( DataSampleHeaderFlag  flag,
ACE_Message_Block *  buffer 
) [static]

void OpenDDS::DCPS::DataSampleHeader::split ( const ACE_Message_Block &  orig,
size_t  size,
ACE_Message_Block *&  head,
ACE_Message_Block *&  tail 
) [static]

Create two new serialized headers (owned by caller), the "head" having at most "size" bytes (header + data) and the "tail" having the rest. Precondition: size must be larger than the max_marshaled_size().

ACE_INLINE bool OpenDDS::DCPS::DataSampleHeader::test_flag ( DataSampleHeaderFlag  flag,
const ACE_Message_Block *  buffer 
) [static]


Member Data Documentation

bool OpenDDS::DCPS::DataSampleHeader::byte_order_

0 - Message encoded using little-endian byte order. 1 - Message encoded using network byte order.

bool OpenDDS::DCPS::DataSampleHeader::coherent_change_

The flag indicates the sample belongs to a coherent change set (i.e. PRESENTATION coherent_access == true).

bool OpenDDS::DCPS::DataSampleHeader::content_filter_

The publishing side has applied content filtering, and the optional content_filter_entries_ field is present in the marshaled header.

GUIDSeq OpenDDS::DCPS::DataSampleHeader::content_filter_entries_

Optional field present if the content_filter_ flag bit is set. Indicates which readers should not receive the data.

const size_t OpenDDS::DCPS::DataSampleHeader::FLAGS_OFFSET = 2 [static]

bool OpenDDS::DCPS::DataSampleHeader::group_coherent_

bool OpenDDS::DCPS::DataSampleHeader::historic_sample_

This flag indicates a sample has been resent from a non-VOLATILE DataWriter.

bool OpenDDS::DCPS::DataSampleHeader::lifespan_duration_

This flag indicates the sample header contains non-default LIFESPAN duration fields.

ACE_UINT32 OpenDDS::DCPS::DataSampleHeader::lifespan_duration_nanosec_

ACE_INT32 OpenDDS::DCPS::DataSampleHeader::lifespan_duration_sec_

The LIFESPAN duration field is generated from the DataWriter or supplied by the application at the time of the write. This field is used to determine if a given sample is considered 'stale' and should be discarded by associated DataReader. These fields are optional and are controlled by the lifespan_duration_ flag.

size_t OpenDDS::DCPS::DataSampleHeader::marshaled_size_ [private]

Keep track of the amount of data read from a buffer.

char OpenDDS::DCPS::DataSampleHeader::message_id_

The enum MessageId.

ACE_UINT32 OpenDDS::DCPS::DataSampleHeader::message_length_

The size of the data sample (without header). After this header is demarshaled, the transport expects to see this many bytes in the stream before the start of the next header (or end of the Transport PDU).

bool OpenDDS::DCPS::DataSampleHeader::more_fragments_

The current "Data Sample" needs reassembly before further processing.

PublicationId OpenDDS::DCPS::DataSampleHeader::publication_id_

Identify the DataWriter that produced the sample data being sent.

RepoId OpenDDS::DCPS::DataSampleHeader::publisher_id_

Id representing the coherent group. Optional field that's only present if the flag for group_coherent_ is set.

SequenceNumber OpenDDS::DCPS::DataSampleHeader::sequence_

The sequence number is obtained from the Publisher associated with the DataWriter based on the PRESENTATION requirement for the sequence value (access_scope == GROUP).

bool OpenDDS::DCPS::DataSampleHeader::sequence_repair_

Due to content filtering, a gap in the sequence numbers may be an expected condition. If this bit is set, assume prior sequence numbers were filtered-out and are not missing.

ACE_UINT32 OpenDDS::DCPS::DataSampleHeader::source_timestamp_nanosec_

ACE_INT32 OpenDDS::DCPS::DataSampleHeader::source_timestamp_sec_

The SOURCE_TIMESTAMP field is generated from the DataWriter or supplied by the application at the time of the write. This value is derived from the local hosts system clock, which is assumed to be synchronized with the clocks on other hosts within the domain. This field is required for DESTINATION_ORDER and LIFESPAN policy behaviors of subscriptions. It is also required to be present for all data in the SampleInfo structure supplied along with each data sample.

char OpenDDS::DCPS::DataSampleHeader::submessage_id_

Implementation-specific sub-message Ids.


The documentation for this struct was generated from the following files:
Generated on Wed Nov 16 15:28:40 2011 for OpenDDS by  doxygen 1.4.7