OpenDDS::RTPS::RtpsDiscovery Class Reference

Discovery Strategy class that implements RTPS discovery. More...

#include <RtpsDiscovery.h>

Inheritance diagram for OpenDDS::RTPS::RtpsDiscovery:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::RTPS::RtpsDiscovery:

Collaboration graph
[legend]
List of all members.

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

Detailed Description

Discovery Strategy class that implements RTPS discovery.

This class implements the Discovery interface for Rtps-based discovery.

Definition at line 40 of file RtpsDiscovery.h.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 55 of file RtpsDiscovery.cpp.

00056 {
00057 }


Member Function Documentation

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]

Definition at line 78 of file RtpsDiscovery.h.

00078                                {
00079     d0_ = offset_zero;
00080   }

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]

Definition at line 83 of file RtpsDiscovery.h.

00083                               {
00084     d1_ = offset_one;
00085   }

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]

Definition at line 68 of file RtpsDiscovery.h.

00068                                {
00069     dg_ = domain_gain;
00070   }

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]

Definition at line 88 of file RtpsDiscovery.h.

00088                               {
00089     dx_ = offset_two;
00090   }

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]

Definition at line 108 of file RtpsDiscovery.h.

00108                                                      {
00109     multicast_interface_ = mi;
00110   }

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]

Definition at line 63 of file RtpsDiscovery.h.

00063                              {
00064     pb_ = port_base;
00065   }

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]

Definition at line 73 of file RtpsDiscovery.h.

00073                                     {
00074     pg_ = participant_gain;
00075   }

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]

Definition at line 58 of file RtpsDiscovery.h.

00058                                                    {
00059     resend_period_ = period;
00060   }

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]

Definition at line 98 of file RtpsDiscovery.h.

00098                                                     {
00099     sedp_local_address_ = mi;
00100   }

OPENDDS_STRING OpenDDS::RTPS::RtpsDiscovery::sedp_local_address (  )  const [inline]

Definition at line 97 of file RtpsDiscovery.h.

00097 { return sedp_local_address_; }

void OpenDDS::RTPS::RtpsDiscovery::sedp_multicast ( bool  sm  )  [inline]

Definition at line 103 of file RtpsDiscovery.h.

00103                                {
00104     sedp_multicast_ = sm;
00105   }

bool OpenDDS::RTPS::RtpsDiscovery::sedp_multicast (  )  const [inline]

Definition at line 102 of file RtpsDiscovery.h.

00102 { return sedp_multicast_; }

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]

Definition at line 119 of file RtpsDiscovery.h.

00119 { return spdp_send_addrs_; }

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]

Reimplemented from OpenDDS::DCPS::Discovery.

Definition at line 49 of file RtpsDiscovery.h.

00049 { return true; }

void OpenDDS::RTPS::RtpsDiscovery::ttl ( unsigned char  time_to_live  )  [inline]

Definition at line 93 of file RtpsDiscovery.h.

00093                                        {
00094     ttl_ = time_to_live;
00095   }

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_; }


Friends And Related Function Documentation

friend class ::DDS_TEST [friend]

Definition at line 145 of file RtpsDiscovery.h.


Member Data Documentation

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.

GuidGenerator OpenDDS::RTPS::RtpsDiscovery::guid_gen_ [private]

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]

FUTURE: handle > 1 group.

Definition at line 128 of file RtpsDiscovery.h.

unsigned char OpenDDS::RTPS::RtpsDiscovery::ttl_ [private]

Definition at line 124 of file RtpsDiscovery.h.


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