OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver Struct Reference

Collaboration diagram for OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MessageReceiver (const GuidPrefix_t &local)
void reset (const ACE_INET_Addr &remote_address, const RTPS::Header &hdr)
void submsg (const RTPS::Submessage &s)
void submsg (const RTPS::InfoDestinationSubmessage &id)
void submsg (const RTPS::InfoReplySubmessage &ir)
void submsg (const RTPS::InfoReplyIp4Submessage &iri4)
void submsg (const RTPS::InfoTimestampSubmessage &it)
void submsg (const RTPS::InfoSourceSubmessage &is)
void fill_header (DataSampleHeader &header) const

Public Attributes

GuidPrefix_t local_
RTPS::ProtocolVersion_t source_version_
RTPS::VendorId_t source_vendor_
GuidPrefix_t source_guid_prefix_
GuidPrefix_t dest_guid_prefix_
DCPS::LocatorSeq unicast_reply_locator_list_
DCPS::LocatorSeq multicast_reply_locator_list_
bool have_timestamp_
RTPS::Time_t timestamp_

Detailed Description

Definition at line 90 of file RtpsUdpReceiveStrategy.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::MessageReceiver ( const GuidPrefix_t local  )  [explicit]

Definition at line 397 of file RtpsUdpReceiveStrategy.cpp.

References OpenDDS::DCPS::assign(), dest_guid_prefix_, OpenDDS::RTPS::Time_t::fraction, local_, OpenDDS::RTPS::ProtocolVersion_t::major, OpenDDS::RTPS::ProtocolVersion_t::minor, OpenDDS::RTPS::Time_t::seconds, source_guid_prefix_, source_vendor_, source_version_, timestamp_, and OpenDDS::RTPS::VendorId_t::vendorId.

00398   : have_timestamp_(false)
00399 {
00400   RTPS::assign(local_, local);
00401   source_version_.major = source_version_.minor = 0;
00402   source_vendor_.vendorId[0] = source_vendor_.vendorId[1] = 0;
00403   for (size_t i = 0; i < sizeof(GuidPrefix_t); ++i) {
00404     source_guid_prefix_[i] = 0;
00405     dest_guid_prefix_[i] = 0;
00406   }
00407   timestamp_.seconds = 0;
00408   timestamp_.fraction = 0;
00409 }


Member Function Documentation

void OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::fill_header ( DataSampleHeader header  )  const

Definition at line 551 of file RtpsUdpReceiveStrategy.cpp.

References OpenDDS::DCPS::assign(), OpenDDS::RTPS::Time_t::fraction, have_timestamp_, header, OpenDDS::RTPS::NANOS_TO_RTPS_FRACS, OpenDDS::RTPS::Time_t::seconds, source_guid_prefix_, and timestamp_.

Referenced by OpenDDS::DCPS::RtpsUdpReceiveStrategy::deliver_sample(), and OpenDDS::DCPS::RtpsUdpReceiveStrategy::reassemble().

00553 {
00554   using namespace RTPS;
00555   if (have_timestamp_) {
00556     header.source_timestamp_sec_ = timestamp_.seconds;
00557     header.source_timestamp_nanosec_ =
00558       static_cast<ACE_UINT32>(timestamp_.fraction / NANOS_TO_RTPS_FRACS + .5);
00559   }
00560   assign(header.publication_id_.guidPrefix, source_guid_prefix_);
00561 }

void OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::reset ( const ACE_INET_Addr &  remote_address,
const RTPS::Header hdr 
)

Definition at line 412 of file RtpsUdpReceiveStrategy.cpp.

References OpenDDS::RTPS::address_to_bytes(), OpenDDS::RTPS::address_to_kind(), OpenDDS::DCPS::assign(), dest_guid_prefix_, OpenDDS::RTPS::Header::guidPrefix, have_timestamp_, local_, OpenDDS::RTPS::LOCATOR_ADDRESS_INVALID, OpenDDS::RTPS::LOCATOR_PORT_INVALID, multicast_reply_locator_list_, source_guid_prefix_, source_vendor_, source_version_, OpenDDS::RTPS::TIME_INVALID, timestamp_, unicast_reply_locator_list_, OpenDDS::RTPS::Header::vendorId, and OpenDDS::RTPS::Header::version.

Referenced by OpenDDS::DCPS::RtpsUdpReceiveStrategy::check_header().

00414 {
00415   using namespace RTPS;
00416   // see RTPS spec v2.1 section 8.3.4 table 8.16 and section 8.3.6.4
00417   source_version_ = hdr.version;
00418   source_vendor_ = hdr.vendorId;
00419 
00420   assign(source_guid_prefix_, hdr.guidPrefix);
00421   assign(dest_guid_prefix_, local_);
00422 
00423   unicast_reply_locator_list_.length(1);
00424   unicast_reply_locator_list_[0].kind = address_to_kind(addr);
00425   unicast_reply_locator_list_[0].port = LOCATOR_PORT_INVALID;
00426   RTPS::address_to_bytes(unicast_reply_locator_list_[0].address, addr);
00427 
00428   multicast_reply_locator_list_.length(1);
00429   multicast_reply_locator_list_[0].kind = address_to_kind(addr);
00430   multicast_reply_locator_list_[0].port = LOCATOR_PORT_INVALID;
00431   assign(multicast_reply_locator_list_[0].address, LOCATOR_ADDRESS_INVALID);
00432 
00433   have_timestamp_ = false;
00434   timestamp_ = TIME_INVALID;
00435 }

void OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::submsg ( const RTPS::InfoSourceSubmessage is  ) 

Definition at line 536 of file RtpsUdpReceiveStrategy.cpp.

References OpenDDS::DCPS::assign(), OpenDDS::RTPS::InfoSourceSubmessage::guidPrefix, have_timestamp_, OpenDDS::RTPS::LOCATOR_INVALID, multicast_reply_locator_list_, source_guid_prefix_, source_vendor_, source_version_, unicast_reply_locator_list_, OpenDDS::RTPS::InfoSourceSubmessage::vendorId, and OpenDDS::RTPS::InfoSourceSubmessage::version.

00538 {
00539   // see RTPS spec v2.1 section 8.3.7.9.4
00540   RTPS::assign(source_guid_prefix_, is.guidPrefix);
00541   source_version_ = is.version;
00542   source_vendor_ = is.vendorId;
00543   unicast_reply_locator_list_.length(1);
00544   unicast_reply_locator_list_[0] = RTPS::LOCATOR_INVALID;
00545   multicast_reply_locator_list_.length(1);
00546   multicast_reply_locator_list_[0] = RTPS::LOCATOR_INVALID;
00547   have_timestamp_ = false;
00548 }

void OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::submsg ( const RTPS::InfoTimestampSubmessage it  ) 

Definition at line 523 of file RtpsUdpReceiveStrategy.cpp.

References have_timestamp_, OpenDDS::RTPS::InfoTimestampSubmessage::smHeader, OpenDDS::RTPS::InfoTimestampSubmessage::timestamp, and timestamp_.

00525 {
00526   // see RTPS spec v2.1 section 8.3.7.9.10
00527   if (!(it.smHeader.flags & 2 /* InvalidateFlag */)) {
00528     have_timestamp_ = true;
00529     timestamp_ = it.timestamp;
00530   } else {
00531     have_timestamp_ = false;
00532   }
00533 }

void OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::submsg ( const RTPS::InfoReplyIp4Submessage iri4  ) 

Definition at line 503 of file RtpsUdpReceiveStrategy.cpp.

References OpenDDS::DCPS::assign(), OpenDDS::RTPS::LOCATOR_KIND_UDPv4, multicast_reply_locator_list_, OpenDDS::RTPS::InfoReplyIp4Submessage::multicastLocator, OpenDDS::RTPS::InfoReplyIp4Submessage::smHeader, unicast_reply_locator_list_, and OpenDDS::RTPS::InfoReplyIp4Submessage::unicastLocator.

00505 {
00506   // see RTPS spec v2.1 sections 8.3.7.8.4 and 9.4.5.14
00507   unicast_reply_locator_list_.length(1);
00508   unicast_reply_locator_list_[0].kind = RTPS::LOCATOR_KIND_UDPv4;
00509   unicast_reply_locator_list_[0].port = iri4.unicastLocator.port;
00510   RTPS::assign(unicast_reply_locator_list_[0].address, iri4.unicastLocator.address);
00511 
00512   if (iri4.smHeader.flags & 2 /* MulticastFlag */) {
00513     multicast_reply_locator_list_.length(1);
00514     multicast_reply_locator_list_[0].kind = RTPS::LOCATOR_KIND_UDPv4;
00515     multicast_reply_locator_list_[0].port = iri4.multicastLocator.port;
00516     RTPS::assign(multicast_reply_locator_list_[0].address, iri4.multicastLocator.address);
00517   } else {
00518     multicast_reply_locator_list_.length(0);
00519   }
00520 }

void OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::submsg ( const RTPS::InfoReplySubmessage ir  ) 

Definition at line 483 of file RtpsUdpReceiveStrategy.cpp.

References multicast_reply_locator_list_, OpenDDS::RTPS::InfoReplySubmessage::multicastLocatorList, OpenDDS::RTPS::InfoReplySubmessage::smHeader, unicast_reply_locator_list_, and OpenDDS::RTPS::InfoReplySubmessage::unicastLocatorList.

00484 {
00485   // see RTPS spec v2.1 section 8.3.7.8.4
00486   unicast_reply_locator_list_.length(ir.unicastLocatorList.length());
00487   for (CORBA::ULong i = 0; i < ir.unicastLocatorList.length(); ++i) {
00488     unicast_reply_locator_list_[i] = ir.unicastLocatorList[i];
00489   }
00490 
00491   if (ir.smHeader.flags & 2 /* MulticastFlag */) {
00492     multicast_reply_locator_list_.length(ir.multicastLocatorList.length());
00493     for (CORBA::ULong i = 0; i < ir.multicastLocatorList.length(); ++i) {
00494       multicast_reply_locator_list_[i] = ir.multicastLocatorList[i];
00495     }
00496 
00497   } else {
00498     multicast_reply_locator_list_.length(0);
00499   }
00500 }

void OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::submsg ( const RTPS::InfoDestinationSubmessage id  ) 

Definition at line 469 of file RtpsUdpReceiveStrategy.cpp.

References OpenDDS::DCPS::assign(), OpenDDS::RTPS::assign(), dest_guid_prefix_, and local_.

00471 {
00472   // see RTPS spec v2.1 section 8.3.7.7.4
00473   for (size_t i = 0; i < sizeof(GuidPrefix_t); ++i) {
00474     if (id.guidPrefix[i]) { // if some byte is > 0, it's not UNKNOWN
00475       RTPS::assign(dest_guid_prefix_, id.guidPrefix);
00476       return;
00477     }
00478   }
00479   RTPS::assign(dest_guid_prefix_, local_);
00480 }

void OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::submsg ( const RTPS::Submessage s  ) 

Definition at line 438 of file RtpsUdpReceiveStrategy.cpp.

References OpenDDS::RTPS::INFO_DST, OpenDDS::RTPS::Submessage::info_dst_sm, OpenDDS::RTPS::INFO_REPLY, OpenDDS::RTPS::INFO_REPLY_IP4, OpenDDS::RTPS::Submessage::info_reply_ipv4_sm, OpenDDS::RTPS::Submessage::info_reply_sm, OpenDDS::RTPS::INFO_SRC, OpenDDS::RTPS::Submessage::info_src_sm, OpenDDS::RTPS::INFO_TS, and OpenDDS::RTPS::Submessage::info_ts_sm.

Referenced by OpenDDS::DCPS::RtpsUdpReceiveStrategy::check_header().

00439 {
00440   using namespace RTPS;
00441 
00442   switch (s._d()) {
00443   case INFO_TS:
00444     submsg(s.info_ts_sm());
00445     break;
00446 
00447   case INFO_SRC:
00448     submsg(s.info_src_sm());
00449     break;
00450 
00451   case INFO_REPLY_IP4:
00452     submsg(s.info_reply_ipv4_sm());
00453     break;
00454 
00455   case INFO_DST:
00456     submsg(s.info_dst_sm());
00457     break;
00458 
00459   case INFO_REPLY:
00460     submsg(s.info_reply_sm());
00461     break;
00462 
00463   default:
00464     break;
00465   }
00466 }


Member Data Documentation

GuidPrefix_t OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::dest_guid_prefix_

Definition at line 109 of file RtpsUdpReceiveStrategy.h.

Referenced by OpenDDS::DCPS::RtpsUdpReceiveStrategy::deliver_sample(), MessageReceiver(), reset(), and submsg().

bool OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::have_timestamp_

Definition at line 112 of file RtpsUdpReceiveStrategy.h.

Referenced by fill_header(), reset(), and submsg().

GuidPrefix_t OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::local_

Definition at line 105 of file RtpsUdpReceiveStrategy.h.

Referenced by MessageReceiver(), reset(), and submsg().

DCPS::LocatorSeq OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::multicast_reply_locator_list_

Definition at line 111 of file RtpsUdpReceiveStrategy.h.

Referenced by reset(), and submsg().

GuidPrefix_t OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::source_guid_prefix_

Definition at line 108 of file RtpsUdpReceiveStrategy.h.

Referenced by OpenDDS::DCPS::RtpsUdpReceiveStrategy::deliver_sample(), fill_header(), MessageReceiver(), reset(), and submsg().

RTPS::VendorId_t OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::source_vendor_

Definition at line 107 of file RtpsUdpReceiveStrategy.h.

Referenced by MessageReceiver(), reset(), and submsg().

RTPS::ProtocolVersion_t OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::source_version_

Definition at line 106 of file RtpsUdpReceiveStrategy.h.

Referenced by MessageReceiver(), reset(), and submsg().

RTPS::Time_t OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::timestamp_

Definition at line 113 of file RtpsUdpReceiveStrategy.h.

Referenced by fill_header(), MessageReceiver(), reset(), and submsg().

DCPS::LocatorSeq OpenDDS::DCPS::RtpsUdpReceiveStrategy::MessageReceiver::unicast_reply_locator_list_

Definition at line 110 of file RtpsUdpReceiveStrategy.h.

Referenced by reset(), and submsg().


The documentation for this struct was generated from the following files:
Generated on Fri Feb 12 20:06:37 2016 for OpenDDS by  doxygen 1.4.7