OpenDDS  Snapshot(2023/04/28-20:55)
Public Member Functions | Protected Member Functions | List of all members
OpenDDS::RTPS::Sedp::TypeLookupRequestWriter Class Reference
Inheritance diagram for OpenDDS::RTPS::Sedp::TypeLookupRequestWriter:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::RTPS::Sedp::TypeLookupRequestWriter:
Collaboration graph
[legend]

Public Member Functions

 TypeLookupRequestWriter (const DCPS::GUID_t &pub_id, Sedp &sedp, ACE_INT64 seq_init=1)
 
virtual ~TypeLookupRequestWriter ()
 
bool send_type_lookup_request (const XTypes::TypeIdentifierSeq &type_ids, const DCPS::GUID_t &reader, const DCPS::SequenceNumber &rpc_sequence, CORBA::Long tl_kind)
 
- Public Member Functions inherited from OpenDDS::RTPS::Sedp::Writer
 Writer (const DCPS::GUID_t &pub_id, Sedp &sedp, ACE_INT64 seq_init=1)
 
virtual ~Writer ()
 
bool assoc (const DCPS::AssociationData &subscription)
 
void transport_assoc_done (int flags, const DCPS::GUID_t &remote)
 
void data_delivered (const DCPS::DataSampleElement *)
 
void data_dropped (const DCPS::DataSampleElement *, bool by_transport)
 
void data_acked (const GUID_t &remote)
 
void control_delivered (const DCPS::Message_Block_Ptr &sample)
 
void control_dropped (const DCPS::Message_Block_Ptr &sample, bool dropped_by_transport)
 
void notify_publication_disconnected (const DCPS::ReaderIdSeq &)
 
void notify_publication_reconnected (const DCPS::ReaderIdSeq &)
 
void notify_publication_lost (const DCPS::ReaderIdSeq &)
 
void remove_associations (const DCPS::ReaderIdSeq &, bool)
 
void replay_durable_data_for (const DCPS::GUID_t &remote_sub_id)
 
void retrieve_inline_qos_data (InlineQosData &) const
 
const DCPS::SequenceNumberget_seq () const
 
DDS::ReturnCode_t write_parameter_list (const ParameterList &plist, const DCPS::GUID_t &reader, DCPS::SequenceNumber &sequence)
 
void end_historic_samples (const DCPS::GUID_t &reader)
 
void request_ack (const DCPS::GUID_t &reader)
 
void send_deferred_samples (const GUID_t &reader)
 
- Public Member Functions inherited from OpenDDS::DCPS::TransportSendListener
virtual ~TransportSendListener ()
 
virtual SendControlStatus send_control_customized (const DataLinkSet_rch &links, const DataSampleHeader &header, ACE_Message_Block *msg, void *extra)
 
virtual void transport_discovery_change ()
 
- Public Member Functions inherited from OpenDDS::DCPS::RcObject
virtual ~RcObject ()
 
virtual void _add_ref ()
 
virtual void _remove_ref ()
 
long ref_count () const
 
WeakObject_get_weak_object () const
 
- Public Member Functions inherited from OpenDDS::RTPS::Sedp::Endpoint
 Endpoint (const DCPS::GUID_t &repo_id, Sedp &sedp)
 
virtual ~Endpoint ()
 
bool check_transport_qos (const DCPS::TransportInst &)
 
DCPS::GUID_t get_guid () const
 
DDS::DomainId_t domain_id () const
 
CORBA::Long get_priority_value (const DCPS::AssociationData &) const
 
void set_crypto_handles (DDS::Security::ParticipantCryptoHandle p, DDS::Security::NativeCryptoHandle e=DDS::HANDLE_NIL)
 
DDS::Security::ParticipantCryptoHandle get_crypto_handle () const
 
DDS::Security::NativeCryptoHandle get_endpoint_crypto_handle () const
 
void shutting_down ()
 
OPENDDS_STRING get_instance_name (const DCPS::GUID_t &id) const
 
EntityId_t counterpart_entity_id () const
 
GUID_t make_counterpart_guid (const DCPS::GUID_t &remote_part) const
 
bool associated_with_counterpart (const DCPS::GUID_t &remote_part) const
 
bool pending_association_with_counterpart (const DCPS::GUID_t &remote_part) const
 
bool associated_with_counterpart_if_not_pending (const DCPS::GUID_t &remote_part) const
 
RcHandle< DCPS::BitSubscriberget_builtin_subscriber_proxy () const
 
- Public Member Functions inherited from OpenDDS::DCPS::TransportClient
void use_datalink (const GUID_t &remote_id, const DataLink_rch &link)
 
 TransportClient ()
 
virtual ~TransportClient ()
 
void enable_transport (bool reliable, bool durable)
 
void enable_transport_using_config (bool reliable, bool durable, const TransportConfig_rch &tc)
 
bool swap_bytes () const
 
bool cdr_encapsulation () const
 
const TransportLocatorSeqconnection_info () const
 
void populate_connection_info ()
 
bool is_reliable () const
 
bool associate (const AssociationData &peer, bool active)
 
void disassociate (const GUID_t &peerId)
 
void stop_associating ()
 
void stop_associating (const GUID_t *repos, CORBA::ULong length)
 
void send_final_acks ()
 
void transport_stop ()
 
void register_for_reader (const GUID_t &participant, const GUID_t &writerid, const GUID_t &readerid, const TransportLocatorSeq &locators, OpenDDS::DCPS::DiscoveryListener *listener)
 
void unregister_for_reader (const GUID_t &participant, const GUID_t &writerid, const GUID_t &readerid)
 
void register_for_writer (const GUID_t &participant, const GUID_t &readerid, const GUID_t &writerid, const TransportLocatorSeq &locators, DiscoveryListener *listener)
 
void unregister_for_writer (const GUID_t &participant, const GUID_t &readerid, const GUID_t &writerid)
 
void update_locators (const GUID_t &remote, const TransportLocatorSeq &locators)
 
WeakRcHandle< ICE::Endpointget_ice_endpoint ()
 
bool send_response (const GUID_t &peer, const DataSampleHeader &header, Message_Block_Ptr payload)
 
void send (SendStateDataSampleList send_list, ACE_UINT64 transaction_id=0)
 
SendControlStatus send_w_control (SendStateDataSampleList send_list, const DataSampleHeader &header, Message_Block_Ptr msg, const GUID_t &destination)
 
SendControlStatus send_control (const DataSampleHeader &header, Message_Block_Ptr msg)
 
SendControlStatus send_control_to (const DataSampleHeader &header, Message_Block_Ptr msg, const GUID_t &destination)
 
bool remove_sample (const DataSampleElement *sample)
 
bool remove_all_msgs ()
 
virtual void add_link (const DataLink_rch &link, const GUID_t &peer)
 
void terminate_send_if_suspended ()
 
bool associated_with (const GUID_t &remote) const
 
bool pending_association_with (const GUID_t &remote) const
 
GUID_t repo_id () const
 
void data_acked (const GUID_t &remote)
 
bool is_leading (const GUID_t &reader_id) const
 

Protected Member Functions

virtual bool deferrable () const
 
- Protected Member Functions inherited from OpenDDS::RTPS::Sedp::Writer
typedef OPENDDS_MAP (DCPS::SequenceNumber, DCPS::DataSampleElement *) PerReaderDeferredSamples
 
typedef OPENDDS_MAP (GUID_t, PerReaderDeferredSamples) DeferredSamples
 
void send_sample (DCPS::Message_Block_Ptr payload, size_t size, const DCPS::GUID_t &reader, DCPS::SequenceNumber &sequence, bool historic=false)
 
void send_sample_i (DCPS::DataSampleElement *el)
 
void set_header_fields (DCPS::DataSampleHeader &dsh, size_t size, const DCPS::GUID_t &reader, DCPS::SequenceNumber &sequence, bool historic_sample=false, DCPS::MessageId id=DCPS::SAMPLE_DATA)
 
void write_control_msg (DCPS::Message_Block_Ptr payload, size_t size, DCPS::MessageId id, DCPS::SequenceNumber seq=DCPS::SequenceNumber())
 
- Protected Member Functions inherited from OpenDDS::DCPS::TransportSendListener
 TransportSendListener ()
 
- Protected Member Functions inherited from OpenDDS::DCPS::RcObject
 RcObject ()
 
- Protected Member Functions inherited from OpenDDS::DCPS::TransportClient
void cdr_encapsulation (bool encap)
 

Additional Inherited Members

- Public Types inherited from OpenDDS::DCPS::TransportClient
enum  { ASSOC_OK = 1, ASSOC_ACTIVE = 2 }
 
- Protected Attributes inherited from OpenDDS::RTPS::Sedp::Writer
DeferredSamples deferred_samples_
 
DCPS::SequenceNumber seq_
 
- Protected Attributes inherited from OpenDDS::RTPS::Sedp::Endpoint
DCPS::GUID_t repo_id_
 
Sedpsedp_
 
AtomicBool shutting_down_
 
DDS::Security::ParticipantCryptoHandle participant_crypto_handle_
 
DDS::Security::NativeCryptoHandle endpoint_crypto_handle_
 

Detailed Description

Definition at line 563 of file Sedp.h.

Constructor & Destructor Documentation

◆ TypeLookupRequestWriter()

OpenDDS::RTPS::Sedp::TypeLookupRequestWriter::TypeLookupRequestWriter ( const DCPS::GUID_t pub_id,
Sedp sedp,
ACE_INT64  seq_init = 1 
)
inline

Definition at line 565 of file Sedp.h.

References OpenDDS::RTPS::Sedp::send_type_lookup_request().

566  : Writer(pub_id, sedp, seq_init)
567  {}
Writer(const DCPS::GUID_t &pub_id, Sedp &sedp, ACE_INT64 seq_init=1)
Definition: Sedp.cpp:3180

◆ ~TypeLookupRequestWriter()

OpenDDS::RTPS::Sedp::TypeLookupRequestWriter::~TypeLookupRequestWriter ( )
virtual

Definition at line 3611 of file Sedp.cpp.

3612 {
3613 }

Member Function Documentation

◆ deferrable()

virtual bool OpenDDS::RTPS::Sedp::TypeLookupRequestWriter::deferrable ( ) const
inlineprotectedvirtual

Reimplemented from OpenDDS::RTPS::Sedp::Writer.

Definition at line 578 of file Sedp.h.

579  {
580  return true;
581  }

◆ send_type_lookup_request()

bool OpenDDS::RTPS::Sedp::TypeLookupRequestWriter::send_type_lookup_request ( const XTypes::TypeIdentifierSeq type_ids,
const DCPS::GUID_t reader,
const DCPS::SequenceNumber rpc_sequence,
CORBA::Long  tl_kind 
)

Definition at line 3627 of file Sedp.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_Message_Block::cont(), OpenDDS::XTypes::TypeLookup_Request::data, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::FINAL, OpenDDS::RTPS::Sedp::Endpoint::get_guid(), OpenDDS::RTPS::Sedp::Endpoint::get_instance_name(), OpenDDS::DCPS::DataSampleHeader::get_max_serialized_size(), OpenDDS::RTPS::Spdp::get_participant_discovered_at(), OpenDDS::XTypes::TypeLookup_Call::getTypeDependencies, OpenDDS::XTypes::TypeLookup_Call::getTypes, OpenDDS::DCPS::SequenceNumber::getValue(), OpenDDS::XTypes::TypeLookup_Request::header, LM_DEBUG, LM_ERROR, OpenDDS::DCPS::log_progress(), ACE_Message_Block::MB_DATA, OpenDDS::DCPS::move(), DDS::RPC::RequestHeader::requestId, OpenDDS::RTPS::Sedp::Endpoint::sedp_, OpenDDS::RTPS::Sedp::Writer::send_sample(), OpenDDS::RTPS::Sedp::Writer::seq_, DDS::SampleIdentity::sequence_number, OpenDDS::DCPS::serialized_size(), OpenDDS::DCPS::EncapsulationHeader::serialized_size, OpenDDS::RTPS::Sedp::spdp_, OpenDDS::RTPS::to_rtps_seqnum(), OpenDDS::DCPS::transport_debug, OpenDDS::RTPS::Sedp::type_lookup_reply_reader_, OpenDDS::XTypes::TypeLookup_getDependencies_HashId, OpenDDS::XTypes::TypeLookup_getTypes_HashId, and DDS::SampleIdentity::writer_guid.

3632 {
3633  if (DCPS::DCPS_debug_level >= 8) {
3634  ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::TypeLookupRequestWriter::send_type_lookup_request: "
3635  "to %C seq: %q\n", DCPS::LogGuid(reader).c_str(), rpc_sequence.getValue()));
3636  }
3638  log_progress("send type lookup request", get_guid(), reader, sedp_.spdp_.get_participant_discovered_at(reader));
3639  }
3640 
3641  if (tl_kind != XTypes::TypeLookup_getTypes_HashId &&
3643  if (DCPS::DCPS_debug_level) {
3644  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: "
3645  "Sedp::TypeLookupRequestWriter::send_type_lookup_request: tl_kind is %u\n",
3646  tl_kind));
3647  }
3648  return false;
3649  }
3650 
3651  XTypes::TypeLookup_Request type_lookup_request;
3652  type_lookup_request.header.requestId.writer_guid = get_guid();
3653  type_lookup_request.header.requestId.sequence_number = to_rtps_seqnum(rpc_sequence);
3654  type_lookup_request.header.instanceName = get_instance_name(reader).c_str();
3655 
3656  if (tl_kind == XTypes::TypeLookup_getTypes_HashId) {
3657  XTypes::TypeLookup_getTypes_In types;
3658  types.type_ids = type_ids;
3659  type_lookup_request.data.getTypes(types);
3660  } else {
3661  XTypes::TypeLookup_getTypeDependencies_In typeDependencies;
3662  typeDependencies.type_ids = type_ids;
3663  sedp_.type_lookup_reply_reader_->get_continuation_point(reader, type_ids[0],
3664  typeDependencies.continuation_point);
3665  type_lookup_request.data.getTypeDependencies(typeDependencies);
3666  }
3667 
3668  // Determine message length
3669  const size_t size = DCPS::EncapsulationHeader::serialized_size +
3670  DCPS::serialized_size(type_lookup_encoding, type_lookup_request);
3671 
3672  // Build and send type lookup message
3673  DCPS::Message_Block_Ptr payload(
3674  new ACE_Message_Block(
3677  new ACE_Message_Block(size)));
3678  Serializer serializer(payload->cont(), type_lookup_encoding);
3679  DCPS::EncapsulationHeader encap;
3680  bool success = true;
3681  if (encap.from_encoding(serializer.encoding(), DCPS::FINAL) &&
3682  serializer << encap && serializer << type_lookup_request) {
3683  DCPS::SequenceNumber sn(seq_++);
3684  send_sample(move(payload), size, reader, sn);
3685  } else {
3686  if (DCPS::DCPS_debug_level) {
3687  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: "
3688  "Sedp::TypeLookupRequestWriter::send_type_lookup_request: serialization failed\n"));
3689  }
3690  success = false;
3691  }
3692 
3693  return success;
3694 }
DCPS::GUID_t get_guid() const
Definition: Sedp.h:364
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
OpenDDS_Dcps_Export TransportDebug transport_debug
Definition: debug.cpp:26
T::rv_reference move(T &p)
Definition: unique_ptr.h:141
void serialized_size(const Encoding &encoding, size_t &size, const SequenceNumber &)
void OpenDDS_Dcps_Export log_progress(const char *activity, const GUID_t &local, const GUID_t &remote, const MonotonicTime_t &start_time, const GUID_t &reference)
Definition: Logging.cpp:20
const long TypeLookup_getTypes_HashId
Definition: TypeLookup.idl:26
TypeLookupReplyReader_rch type_lookup_reply_reader_
Definition: Sedp.h:1314
static size_t get_max_serialized_size()
Similar to IDL compiler generated methods.
const long TypeLookup_getDependencies_HashId
Definition: TypeLookup.idl:27
OPENDDS_STRING get_instance_name(const DCPS::GUID_t &id) const
Definition: Sedp.h:405
unique_ptr< ACE_Message_Block, Message_Block_Deleter > Message_Block_Ptr
DCPS::MonotonicTime_t get_participant_discovered_at() const
Definition: Spdp.cpp:4461
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
RTPS::SequenceNumber_t to_rtps_seqnum(const DCPS::SequenceNumber &opendds_seqnum)
Definition: MessageUtils.h:139
void send_sample(DCPS::Message_Block_Ptr payload, size_t size, const DCPS::GUID_t &reader, DCPS::SequenceNumber &sequence, bool historic=false)
Definition: Sedp.cpp:3247
static const size_t serialized_size
Definition: Serializer.h:251
DCPS::SequenceNumber seq_
Definition: Sedp.h:505

The documentation for this class was generated from the following files: