#include <RtpsDiscovery.h>
Inheritance diagram for OpenDDS::RTPS::RtpsDiscovery:
Public Member Functions | |
RtpsDiscovery (const RepoKey &key) | |
~RtpsDiscovery () | |
virtual OpenDDS::DCPS::AddDomainStatus | add_domain_participant (DDS::DomainId_t domain, const DDS::DomainParticipantQos &qos) |
virtual bool | supports_liveliness () const |
virtual void | signal_liveliness (const DDS::DomainId_t domain_id, const OpenDDS::DCPS::RepoId &part_id, DDS::LivelinessQosPolicyKind kind) |
ACE_Time_Value | resend_period () const |
void | resend_period (const ACE_Time_Value &period) |
u_short | pb () const |
void | pb (u_short port_base) |
u_short | dg () const |
void | dg (u_short domain_gain) |
u_short | pg () const |
void | pg (u_short participant_gain) |
u_short | d0 () const |
void | d0 (u_short offset_zero) |
u_short | d1 () const |
void | d1 (u_short offset_one) |
u_short | dx () const |
void | dx (u_short offset_two) |
unsigned char | ttl () const |
void | ttl (unsigned char time_to_live) |
OPENDDS_STRING | sedp_local_address () const |
void | sedp_local_address (const OPENDDS_STRING &mi) |
bool | sedp_multicast () const |
void | sedp_multicast (bool sm) |
OPENDDS_STRING | multicast_interface () const |
void | multicast_interface (const OPENDDS_STRING &mi) |
OPENDDS_STRING | default_multicast_group () const |
void | default_multicast_group (const OPENDDS_STRING &group) |
typedef | OPENDDS_VECTOR (OPENDDS_STRING) AddrVec |
const AddrVec & | spdp_send_addrs () const |
AddrVec & | spdp_send_addrs () |
Private Attributes | |
ACE_Time_Value | resend_period_ |
u_short | pb_ |
u_short | dg_ |
u_short | pg_ |
u_short | d0_ |
u_short | d1_ |
u_short | dx_ |
unsigned char | ttl_ |
bool | sedp_multicast_ |
OPENDDS_STRING | multicast_interface_ |
OPENDDS_STRING | sedp_local_address_ |
OPENDDS_STRING | default_multicast_group_ |
AddrVec | spdp_send_addrs_ |
FUTURE: handle > 1 group. | |
GuidGenerator | guid_gen_ |
Guids will be unique within this RTPS configuration. | |
Friends | |
class | ::DDS_TEST |
Classes | |
class | Config |
class | StaticInitializer |
This class implements the Discovery interface for Rtps-based discovery.
Definition at line 40 of file RtpsDiscovery.h.
OpenDDS::RTPS::RtpsDiscovery::RtpsDiscovery | ( | const RepoKey & | key | ) | [explicit] |
Definition at line 40 of file RtpsDiscovery.cpp.
Referenced by OpenDDS::RTPS::RtpsDiscovery::Config::discovery_config().
00041 : DCPS::PeerDiscovery<Spdp>(key) 00042 , resend_period_(30 /*seconds*/) // see RTPS v2.1 9.6.1.4.2 00043 , pb_(7400) // see RTPS v2.1 9.6.1.3 for PB, DG, PG, D0, D1 defaults 00044 , dg_(250) 00045 , pg_(2) 00046 , d0_(get_default_d0(0)) 00047 , d1_(10) 00048 , dx_(2) 00049 , ttl_(1) 00050 , sedp_multicast_(true) 00051 , default_multicast_group_("239.255.0.1") 00052 { 00053 }
OpenDDS::RTPS::RtpsDiscovery::~RtpsDiscovery | ( | ) |
DCPS::AddDomainStatus OpenDDS::RTPS::RtpsDiscovery::add_domain_participant | ( | DDS::DomainId_t | domain, | |
const DDS::DomainParticipantQos & | qos | |||
) | [virtual] |
Implements OpenDDS::DCPS::Discovery.
Definition at line 262 of file RtpsDiscovery.cpp.
References OpenDDS::DCPS::ENTITYID_PARTICIPANT, guid_gen_, OpenDDS::DCPS::GUID_UNKNOWN, OpenDDS::DCPS::AddDomainStatus::id, OpenDDS::DCPS::PeerDiscovery< Participant >::lock_, OpenDDS::DCPS::PeerDiscovery< Participant >::participants_, and OpenDDS::RTPS::GuidGenerator::populate().
00264 { 00265 DCPS::AddDomainStatus ads = {OpenDDS::DCPS::RepoId(), false /*federated*/}; 00266 ACE_GUARD_RETURN(ACE_Thread_Mutex, g, lock_, ads); 00267 guid_gen_.populate(ads.id); 00268 ads.id.entityId = ENTITYID_PARTICIPANT; 00269 try { 00270 const DCPS::RcHandle<Spdp> spdp = new Spdp(domain, ads.id, qos, this); 00271 // ads.id may change during Spdp constructor 00272 participants_[domain][ads.id] = spdp; 00273 } catch (const std::exception& e) { 00274 ads.id = GUID_UNKNOWN; 00275 ACE_ERROR((LM_ERROR, "(%P|%t) RtpsDiscovery::add_domain_participant() - " 00276 "failed to initialize RTPS Simple Participant Discovery Protocol: %C\n", 00277 e.what())); 00278 } 00279 return ads; 00280 }
void OpenDDS::RTPS::RtpsDiscovery::d0 | ( | u_short | offset_zero | ) | [inline] |
u_short OpenDDS::RTPS::RtpsDiscovery::d0 | ( | ) | const [inline] |
Definition at line 77 of file RtpsDiscovery.h.
Referenced by OpenDDS::RTPS::RtpsDiscovery::Config::discovery_config(), and OpenDDS::RTPS::Spdp::SpdpTransport::SpdpTransport().
00077 { return d0_; }
void OpenDDS::RTPS::RtpsDiscovery::d1 | ( | u_short | offset_one | ) | [inline] |
u_short OpenDDS::RTPS::RtpsDiscovery::d1 | ( | ) | const [inline] |
Definition at line 82 of file RtpsDiscovery.h.
Referenced by OpenDDS::RTPS::RtpsDiscovery::Config::discovery_config(), and OpenDDS::RTPS::Spdp::SpdpTransport::open_unicast_socket().
00082 { return d1_; }
void OpenDDS::RTPS::RtpsDiscovery::default_multicast_group | ( | const OPENDDS_STRING & | group | ) | [inline] |
Definition at line 113 of file RtpsDiscovery.h.
00113 { 00114 default_multicast_group_ = group; 00115 }
OPENDDS_STRING OpenDDS::RTPS::RtpsDiscovery::default_multicast_group | ( | ) | const [inline] |
Definition at line 112 of file RtpsDiscovery.h.
Referenced by OpenDDS::RTPS::RtpsDiscovery::Config::discovery_config(), and OpenDDS::RTPS::Spdp::SpdpTransport::SpdpTransport().
00112 { return default_multicast_group_; }
void OpenDDS::RTPS::RtpsDiscovery::dg | ( | u_short | domain_gain | ) | [inline] |
u_short OpenDDS::RTPS::RtpsDiscovery::dg | ( | ) | const [inline] |
Definition at line 67 of file RtpsDiscovery.h.
Referenced by OpenDDS::RTPS::RtpsDiscovery::Config::discovery_config(), and OpenDDS::RTPS::Spdp::SpdpTransport::SpdpTransport().
00067 { return dg_; }
void OpenDDS::RTPS::RtpsDiscovery::dx | ( | u_short | offset_two | ) | [inline] |
u_short OpenDDS::RTPS::RtpsDiscovery::dx | ( | ) | const [inline] |
Definition at line 87 of file RtpsDiscovery.h.
Referenced by OpenDDS::RTPS::RtpsDiscovery::Config::discovery_config().
00087 { return dx_; }
void OpenDDS::RTPS::RtpsDiscovery::multicast_interface | ( | const OPENDDS_STRING & | mi | ) | [inline] |
OPENDDS_STRING OpenDDS::RTPS::RtpsDiscovery::multicast_interface | ( | ) | const [inline] |
Definition at line 107 of file RtpsDiscovery.h.
Referenced by OpenDDS::RTPS::Spdp::SpdpTransport::SpdpTransport().
00107 { return multicast_interface_; }
typedef OpenDDS::RTPS::RtpsDiscovery::OPENDDS_VECTOR | ( | OPENDDS_STRING | ) |
void OpenDDS::RTPS::RtpsDiscovery::pb | ( | u_short | port_base | ) | [inline] |
u_short OpenDDS::RTPS::RtpsDiscovery::pb | ( | ) | const [inline] |
Definition at line 62 of file RtpsDiscovery.h.
Referenced by OpenDDS::RTPS::RtpsDiscovery::Config::discovery_config(), and OpenDDS::RTPS::Spdp::SpdpTransport::SpdpTransport().
00062 { return pb_; }
void OpenDDS::RTPS::RtpsDiscovery::pg | ( | u_short | participant_gain | ) | [inline] |
u_short OpenDDS::RTPS::RtpsDiscovery::pg | ( | ) | const [inline] |
Definition at line 72 of file RtpsDiscovery.h.
Referenced by OpenDDS::RTPS::RtpsDiscovery::Config::discovery_config(), and OpenDDS::RTPS::Spdp::SpdpTransport::open_unicast_socket().
00072 { return pg_; }
void OpenDDS::RTPS::RtpsDiscovery::resend_period | ( | const ACE_Time_Value & | period | ) | [inline] |
ACE_Time_Value OpenDDS::RTPS::RtpsDiscovery::resend_period | ( | ) | const [inline] |
Definition at line 57 of file RtpsDiscovery.h.
Referenced by OpenDDS::RTPS::Spdp::SpdpTransport::open().
00057 { return resend_period_; }
void OpenDDS::RTPS::RtpsDiscovery::sedp_local_address | ( | const OPENDDS_STRING & | mi | ) | [inline] |
OPENDDS_STRING OpenDDS::RTPS::RtpsDiscovery::sedp_local_address | ( | ) | const [inline] |
void OpenDDS::RTPS::RtpsDiscovery::sedp_multicast | ( | bool | sm | ) | [inline] |
bool OpenDDS::RTPS::RtpsDiscovery::sedp_multicast | ( | ) | const [inline] |
void OpenDDS::RTPS::RtpsDiscovery::signal_liveliness | ( | const DDS::DomainId_t | domain_id, | |
const OpenDDS::DCPS::RepoId & | part_id, | |||
DDS::LivelinessQosPolicyKind | kind | |||
) | [virtual] |
Reimplemented from OpenDDS::DCPS::Discovery.
Definition at line 283 of file RtpsDiscovery.cpp.
References OpenDDS::DCPS::PeerDiscovery< Participant >::get_part().
00286 { 00287 get_part(domain_id, part_id)->signal_liveliness(kind); 00288 }
AddrVec& OpenDDS::RTPS::RtpsDiscovery::spdp_send_addrs | ( | ) | [inline] |
const AddrVec& OpenDDS::RTPS::RtpsDiscovery::spdp_send_addrs | ( | ) | const [inline] |
Definition at line 118 of file RtpsDiscovery.h.
Referenced by OpenDDS::RTPS::RtpsDiscovery::Config::discovery_config(), and OpenDDS::RTPS::Spdp::SpdpTransport::SpdpTransport().
00118 { return spdp_send_addrs_; }
virtual bool OpenDDS::RTPS::RtpsDiscovery::supports_liveliness | ( | ) | const [inline, virtual] |
void OpenDDS::RTPS::RtpsDiscovery::ttl | ( | unsigned char | time_to_live | ) | [inline] |
unsigned char OpenDDS::RTPS::RtpsDiscovery::ttl | ( | ) | const [inline] |
Definition at line 92 of file RtpsDiscovery.h.
Referenced by OpenDDS::RTPS::RtpsDiscovery::Config::discovery_config(), and OpenDDS::RTPS::Spdp::SpdpTransport::open_unicast_socket().
00092 { return ttl_; }
friend class ::DDS_TEST [friend] |
Definition at line 145 of file RtpsDiscovery.h.
u_short OpenDDS::RTPS::RtpsDiscovery::d0_ [private] |
Definition at line 123 of file RtpsDiscovery.h.
u_short OpenDDS::RTPS::RtpsDiscovery::d1_ [private] |
Definition at line 123 of file RtpsDiscovery.h.
OPENDDS_STRING OpenDDS::RTPS::RtpsDiscovery::default_multicast_group_ [private] |
Definition at line 127 of file RtpsDiscovery.h.
u_short OpenDDS::RTPS::RtpsDiscovery::dg_ [private] |
Definition at line 123 of file RtpsDiscovery.h.
u_short OpenDDS::RTPS::RtpsDiscovery::dx_ [private] |
Definition at line 123 of file RtpsDiscovery.h.
Guids will be unique within this RTPS configuration.
Definition at line 131 of file RtpsDiscovery.h.
Referenced by add_domain_participant().
OPENDDS_STRING OpenDDS::RTPS::RtpsDiscovery::multicast_interface_ [private] |
Definition at line 126 of file RtpsDiscovery.h.
u_short OpenDDS::RTPS::RtpsDiscovery::pb_ [private] |
Definition at line 123 of file RtpsDiscovery.h.
u_short OpenDDS::RTPS::RtpsDiscovery::pg_ [private] |
Definition at line 123 of file RtpsDiscovery.h.
ACE_Time_Value OpenDDS::RTPS::RtpsDiscovery::resend_period_ [private] |
Definition at line 122 of file RtpsDiscovery.h.
OPENDDS_STRING OpenDDS::RTPS::RtpsDiscovery::sedp_local_address_ [private] |
Definition at line 126 of file RtpsDiscovery.h.
bool OpenDDS::RTPS::RtpsDiscovery::sedp_multicast_ [private] |
Definition at line 125 of file RtpsDiscovery.h.
AddrVec OpenDDS::RTPS::RtpsDiscovery::spdp_send_addrs_ [private] |
unsigned char OpenDDS::RTPS::RtpsDiscovery::ttl_ [private] |
Definition at line 124 of file RtpsDiscovery.h.