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

Public Member Functions

 TypeLookupReplyReader (const DCPS::GUID_t &sub_id, Sedp &sedp)
 
virtual ~TypeLookupReplyReader ()
 
void get_continuation_point (const GUID_t &guid, const XTypes::TypeIdentifier &remote_ti, XTypes::OctetSeq32 &cont_point) const
 
void cleanup (const DCPS::GUID_t &guid, const XTypes::TypeIdentifier &ti)
 
- Public Member Functions inherited from OpenDDS::RTPS::Sedp::Reader
 Reader (const DCPS::GUID_t &sub_id, Sedp &sedp)
 
virtual ~Reader ()
 
bool assoc (const DCPS::AssociationData &publication)
 
void data_received (const DCPS::ReceivedDataSample &sample)
 
void notify_subscription_disconnected (const DCPS::WriterIdSeq &)
 
void notify_subscription_reconnected (const DCPS::WriterIdSeq &)
 
void notify_subscription_lost (const DCPS::WriterIdSeq &)
 
void remove_associations (const DCPS::WriterIdSeq &, bool)
 
- Public Member Functions inherited from OpenDDS::DCPS::TransportReceiveListener
virtual ~TransportReceiveListener ()
 
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
 

Private Types

typedef std::pair< XTypes::OctetSeq32, XTypes::TypeIdentifierSeqContinuationPair
 

Private Member Functions

virtual void data_received_i (const DCPS::ReceivedDataSample &sample, const DCPS::EntityId_t &entity_id, DCPS::Serializer &ser, DCPS::Extensibility extensibility)
 
bool process_type_lookup_reply (const DCPS::ReceivedDataSample &, DCPS::Serializer &ser, bool is_discovery_protected)
 
bool process_get_types_reply (const XTypes::TypeLookup_Reply &reply)
 
bool process_get_dependencies_reply (const DCPS::ReceivedDataSample &sample, const XTypes::TypeLookup_Reply &reply, const DCPS::SequenceNumber &seq_num, bool is_discovery_protected)
 
typedef OPENDDS_MAP (XTypes::TypeIdentifier, ContinuationPair) RemoteDependencies
 
typedef OPENDDS_MAP_CMP (GUID_t, RemoteDependencies, GUID_tKeyLessThan) DependenciesMap
 

Private Attributes

DependenciesMap dependencies_
 

Additional Inherited Members

- Public Types inherited from OpenDDS::DCPS::TransportClient
enum  { ASSOC_OK = 1, ASSOC_ACTIVE = 2 }
 
- Protected Member Functions inherited from OpenDDS::DCPS::TransportReceiveListener
 TransportReceiveListener ()
 
- Protected Member Functions inherited from OpenDDS::DCPS::RcObject
 RcObject ()
 
- Protected Member Functions inherited from OpenDDS::DCPS::TransportClient
void cdr_encapsulation (bool encap)
 
- 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 725 of file Sedp.h.

Member Typedef Documentation

◆ ContinuationPair

Definition at line 752 of file Sedp.h.

Constructor & Destructor Documentation

◆ TypeLookupReplyReader()

OpenDDS::RTPS::Sedp::TypeLookupReplyReader::TypeLookupReplyReader ( const DCPS::GUID_t sub_id,
Sedp sedp 
)
inline

Definition at line 727 of file Sedp.h.

References OpenDDS::XTypes::extensibility().

728  : Reader(sub_id, sedp)
729  {}
Reader(const DCPS::GUID_t &sub_id, Sedp &sedp)
Definition: Sedp.h:612

◆ ~TypeLookupReplyReader()

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

Definition at line 3623 of file Sedp.cpp.

3624 {
3625 }

Member Function Documentation

◆ cleanup()

void OpenDDS::RTPS::Sedp::TypeLookupReplyReader::cleanup ( const DCPS::GUID_t guid,
const XTypes::TypeIdentifier ti 
)

Definition at line 3834 of file Sedp.cpp.

References OpenDDS::DCPS::make_part_guid().

3836 {
3837  const GUID_t part_guid = DCPS::make_part_guid(guid);
3838  const DependenciesMap::iterator it = dependencies_.find(part_guid);
3839  if (it != dependencies_.end() && it->second.find(type_id) != it->second.end()) {
3840  it->second.erase(type_id);
3841  }
3842 
3843  if (it != dependencies_.end() && it->second.empty()) {
3844  dependencies_.erase(it);
3845  }
3846 }
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216

◆ data_received_i()

void OpenDDS::RTPS::Sedp::TypeLookupReplyReader::data_received_i ( const DCPS::ReceivedDataSample sample,
const DCPS::EntityId_t entity_id,
DCPS::Serializer ser,
DCPS::Extensibility  extensibility 
)
privatevirtual

Implements OpenDDS::RTPS::Sedp::Reader.

Definition at line 4514 of file Sedp.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::ENTITYID_TL_SVC_REPLY_WRITER, OpenDDS::RTPS::ENTITYID_TL_SVC_REPLY_WRITER_SECURE, OpenDDS::DCPS::ReceivedDataSample::header_, LM_DEBUG, LM_ERROR, and OpenDDS::DCPS::DataSampleHeader::publication_id_.

4519 {
4520  if (DCPS::DCPS_debug_level > 8) {
4521  ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::TypeLookupReplyReader::data_received_i: from %C\n",
4522  DCPS::LogGuid(sample.header_.publication_id_).c_str()));
4523  }
4524 
4525 #ifdef OPENDDS_SECURITY
4526  if (remote_id == ENTITYID_TL_SVC_REPLY_WRITER_SECURE) {
4527  if (!process_type_lookup_reply(sample, ser, true)) {
4528  if (DCPS::DCPS_debug_level) {
4529  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Sedp::TypeLookupReplyReader::data_received_i - ")
4530  ACE_TEXT("failed to process secure type lookup reply\n")));
4531  }
4532  return;
4533  }
4534  } else if (remote_id == ENTITYID_TL_SVC_REPLY_WRITER) {
4535 #endif
4536  if (!process_type_lookup_reply(sample, ser, false)) {
4537  if (DCPS::DCPS_debug_level) {
4538  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Sedp::TypeLookupReplyReader::data_received_i - ")
4539  ACE_TEXT("failed to process type lookup reply\n")));
4540  }
4541  return;
4542  }
4543 #ifdef OPENDDS_SECURITY
4544  }
4545 #else
4546  ACE_UNUSED_ARG(remote_id);
4547 #endif
4548 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
bool process_type_lookup_reply(const DCPS::ReceivedDataSample &, DCPS::Serializer &ser, bool is_discovery_protected)
Definition: Sedp.cpp:3848
const EntityId_t ENTITYID_TL_SVC_REPLY_WRITER_SECURE
Definition: MessageTypes.h:92
const EntityId_t ENTITYID_TL_SVC_REPLY_WRITER
Definition: GuidUtils.h:54
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30

◆ get_continuation_point()

void OpenDDS::RTPS::Sedp::TypeLookupReplyReader::get_continuation_point ( const GUID_t guid,
const XTypes::TypeIdentifier remote_ti,
XTypes::OctetSeq32 cont_point 
) const

Definition at line 3821 of file Sedp.cpp.

References OpenDDS::DCPS::make_part_guid().

3824 {
3825  const GUID_t part_guid = DCPS::make_part_guid(guid);
3826  const DependenciesMap::const_iterator it = dependencies_.find(part_guid);
3827  if (it == dependencies_.end() || it->second.find(remote_ti) == it->second.end()) {
3828  cont_point.length(0);
3829  } else {
3830  cont_point = it->second.find(remote_ti)->second.first;
3831  }
3832 }
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216

◆ OPENDDS_MAP()

typedef OpenDDS::RTPS::Sedp::TypeLookupReplyReader::OPENDDS_MAP ( XTypes::TypeIdentifier  ,
ContinuationPair   
)
private

◆ OPENDDS_MAP_CMP()

typedef OpenDDS::RTPS::Sedp::TypeLookupReplyReader::OPENDDS_MAP_CMP ( GUID_t  ,
RemoteDependencies  ,
GUID_tKeyLessThan   
)
private

◆ process_get_dependencies_reply()

bool OpenDDS::RTPS::Sedp::TypeLookupReplyReader::process_get_dependencies_reply ( const DCPS::ReceivedDataSample sample,
const XTypes::TypeLookup_Reply reply,
const DCPS::SequenceNumber seq_num,
bool  is_discovery_protected 
)
private

Definition at line 3990 of file Sedp.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::XTypes::Sequence< T >::append(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::SequenceNumber::getValue(), OpenDDS::DCPS::GUID_t::guidPrefix, OpenDDS::DCPS::ReceivedDataSample::header_, LM_DEBUG, LM_ERROR, OpenDDS::DCPS::make_part_guid(), OpenDDS::RTPS::Sedp::orig_seq_numbers_, OpenDDS::DCPS::DataSampleHeader::publication_id_, OpenDDS::RTPS::Sedp::Endpoint::sedp_, OpenDDS::RTPS::Sedp::send_type_lookup_request(), OpenDDS::RTPS::Sedp::type_lookup_service_, and OpenDDS::RTPS::Sedp::type_lookup_service_sequence_number_.

3993 {
3994  if (DCPS::DCPS_debug_level > 8) {
3995  ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::TypeLookupReplyReader::process_get_dependencies_reply - "
3996  "seq %q\n", seq_num.getValue()));
3997  }
3998 
3999  if (reply._cxx_return.getTypeDependencies().result().continuation_point.length() != 0 &&
4000  reply._cxx_return.getTypeDependencies().result().dependent_typeids.length() == 0) {
4001  if (DCPS::DCPS_debug_level) {
4002  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: "
4003  "Sedp::TypeLookupReplyReader::process_get_dependencies_reply - "
4004  "received reply with no data\n"));
4005  }
4006  return false;
4007  }
4008 
4009  const XTypes::TypeLookup_getTypeDependencies_Out& data = reply._cxx_return.getTypeDependencies().result();
4010  const DCPS::GUID_t remote_id = sample.header_.publication_id_;
4011 
4012  const XTypes::TypeIdentifier remote_ti = sedp_.orig_seq_numbers_[seq_num].type_id;
4013  const GUID_t part_guid = DCPS::make_part_guid(remote_id.guidPrefix);
4014  XTypes::TypeIdentifierSeq& deps = dependencies_[part_guid][remote_ti].second;
4015  for (unsigned i = 0; i < data.dependent_typeids.length(); ++i) {
4016  const XTypes::TypeIdentifier& ti = data.dependent_typeids[i].type_id;
4017  // Optimization - only store TypeIdentifiers for which TypeObjects haven't
4018  // already been in the type objects cache yet
4019  if (!sedp_.type_lookup_service_->type_object_in_cache(ti)) {
4020  deps.append(ti);
4021  }
4022  }
4023  dependencies_[part_guid][remote_ti].first = data.continuation_point;
4024 
4025  // Update internal data
4027  sedp_.orig_seq_numbers_[seq_num]));
4028  sedp_.orig_seq_numbers_.erase(seq_num);
4029 
4030  if (data.continuation_point.length() == 0) { // Get all type objects
4031  deps.append(remote_ti);
4032  if (!sedp_.send_type_lookup_request(deps, remote_id, is_discovery_protected, true, sedp_.type_lookup_service_sequence_number_)) {
4033  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Sedp::TypeLookupReplyReader::process_get_dependencies_reply - ")
4034  ACE_TEXT("failed to send getTypes request\n")));
4035  return false;
4036  }
4037  } else { // Get more dependencies
4038  XTypes::TypeIdentifierSeq type_ids;
4039  type_ids.append(remote_ti);
4040  if (!sedp_.send_type_lookup_request(type_ids, remote_id, is_discovery_protected, false, sedp_.type_lookup_service_sequence_number_)) {
4041  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Sedp::TypeLookupReplyReader::process_get_dependencies_reply - ")
4042  ACE_TEXT("failed to send getTypeDependencies request\n")));
4043  return false;
4044  }
4045  }
4046 
4047  return true;
4048 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
bool send_type_lookup_request(const XTypes::TypeIdentifierSeq &type_ids, const DCPS::GUID_t &reader, bool is_discovery_protected, bool send_get_types, const SequenceNumber &seq_num)
Definition: Sedp.cpp:3064
XTypes::TypeLookupService_rch type_lookup_service_
Definition: Sedp.h:1240
DCPS::SequenceNumber type_lookup_service_sequence_number_
Definition: Sedp.h:1245
OrigSeqNumberMap orig_seq_numbers_
Definition: Sedp.h:1241
Sequence< TypeIdentifier > TypeIdentifierSeq
Definition: TypeObject.h:830
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30

◆ process_get_types_reply()

bool OpenDDS::RTPS::Sedp::TypeLookupReplyReader::process_get_types_reply ( const XTypes::TypeLookup_Reply reply)
private

Definition at line 3954 of file Sedp.cpp.

References ACE_DEBUG, ACE_ERROR, OpenDDS::DCPS::DCPS_debug_level, LM_DEBUG, LM_ERROR, DDS::RETCODE_OK, OpenDDS::DCPS::retcode_to_string(), OpenDDS::RTPS::Sedp::Endpoint::sedp_, and OpenDDS::RTPS::Sedp::type_lookup_service_.

3955 {
3956  if (DCPS::DCPS_debug_level > 8) {
3957  ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::TypeLookupReplyReader::process_get_types_reply\n"));
3958  }
3959 
3960  if (reply._cxx_return.getType()._d() != DDS::RETCODE_OK) {
3961  if (DCPS::DCPS_debug_level) {
3962  ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::TypeLookupReplyReader::process_get_types_reply - "
3963  "received reply with return code %C\n",
3964  DCPS::retcode_to_string(reply._cxx_return.getType()._d())));
3965  }
3966  return false;
3967  }
3968 
3969  if (reply._cxx_return.getType().result().types.length() == 0) {
3970  if (DCPS::DCPS_debug_level) {
3971  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: Sedp::TypeLookupReplyReader::process_get_types_reply - "
3972  "received reply with no data\n"));
3973  }
3974  return false;
3975  }
3976 
3977  sedp_.type_lookup_service_->add_type_objects_to_cache(reply._cxx_return.getType().result().types);
3978 
3979  if (reply._cxx_return.getType().result().complete_to_minimal.length() != 0) {
3980  if (DCPS::DCPS_debug_level >= 4) {
3981  ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::TypeLookupReplyReader::process_get_types_reply - "
3982  "received reply with non-empty complete to minimal map\n"));
3983  }
3984  sedp_.type_lookup_service_->update_type_identifier_map(reply._cxx_return.getType().result().complete_to_minimal);
3985  }
3986 
3987  return true;
3988 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
XTypes::TypeLookupService_rch type_lookup_service_
Definition: Sedp.h:1240
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
const char * retcode_to_string(DDS::ReturnCode_t value)
Definition: DCPS_Utils.cpp:29
const ReturnCode_t RETCODE_OK

◆ process_type_lookup_reply()

bool OpenDDS::RTPS::Sedp::TypeLookupReplyReader::process_type_lookup_reply ( const DCPS::ReceivedDataSample sample,
DCPS::Serializer ser,
bool  is_discovery_protected 
)
private

Definition at line 3848 of file Sedp.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::RTPS::Sedp::Endpoint::get_guid(), OpenDDS::RTPS::Spdp::get_participant_discovered_at(), OpenDDS::DCPS::SequenceNumber::getValue(), OpenDDS::XTypes::TypeLookup_Reply::header, OpenDDS::DCPS::ReceivedDataSample::header_, LM_DEBUG, LM_ERROR, LM_WARNING, OpenDDS::RTPS::Sedp::lock_, OpenDDS::DCPS::log_level, OpenDDS::DCPS::log_progress(), OpenDDS::RTPS::Sedp::match_continue(), OpenDDS::RTPS::Sedp::matching_data_buffer_, OpenDDS::RTPS::Sedp::orig_seq_numbers_, OpenDDS::DCPS::DataSampleHeader::publication_id_, DDS::RPC::ReplyHeader::relatedRequestId, DDS::RETCODE_OK, OpenDDS::RTPS::Sedp::Endpoint::sedp_, DDS::SampleIdentity::sequence_number, OpenDDS::RTPS::Sedp::spdp_, OpenDDS::RTPS::to_opendds_seqnum(), OpenDDS::DCPS::transport_debug, OpenDDS::XTypes::TypeLookup_getDependencies_HashId, OpenDDS::XTypes::TypeLookup_getTypes_HashId, OpenDDS::DCPS::LogLevel::Warning, and DDS::SampleIdentity::writer_guid.

3850 {
3851  XTypes::TypeLookup_Reply type_lookup_reply;
3852  if (!(ser >> type_lookup_reply)) {
3853  if (DCPS::DCPS_debug_level) {
3854  ACE_ERROR((LM_ERROR,
3855  ACE_TEXT("(%P|%t) ERROR: Sedp::TypeLookupReplyReader::process_type_lookup_reply - ")
3856  ACE_TEXT("failed to deserialize type lookup reply\n")));
3857  }
3858  return false;
3859  }
3860 
3861  const DDS::SampleIdentity& request_id = type_lookup_reply.header.relatedRequestId;
3862  const DCPS::SequenceNumber seq_num = to_opendds_seqnum(request_id.sequence_number);
3863  if (DCPS::DCPS_debug_level >= 8) {
3864  ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::TypeLookupReplyReader::process_type_lookup_reply - "
3865  "from %C seq %q\n",
3866  DCPS::LogGuid(request_id.writer_guid).c_str(),
3867  seq_num.getValue()));
3868  }
3869 
3872  log_progress("receive type lookup reply", get_guid(), sample.header_.publication_id_, sedp_.spdp_.get_participant_discovered_at(sample.header_.publication_id_));
3873  }
3874  const OrigSeqNumberMap::const_iterator seq_num_it = sedp_.orig_seq_numbers_.find(seq_num);
3875  if (seq_num_it == sedp_.orig_seq_numbers_.end()) {
3876  ACE_DEBUG((LM_WARNING,
3877  ACE_TEXT("(%P|%t) WARNING: Sedp::TypeLookupReplyReader::process_type_lookup_reply - ")
3878  ACE_TEXT("could not find request corresponding to the reply from %C seq %q\n"),
3879  DCPS::LogGuid(request_id.writer_guid).c_str(), seq_num.getValue()));
3880  return false;
3881  }
3882 
3883  bool success;
3884  const ACE_CDR::Long kind = type_lookup_reply._cxx_return._d();
3885  switch (kind) {
3887  success = process_get_types_reply(type_lookup_reply);
3888  break;
3890  success = process_get_dependencies_reply(sample, type_lookup_reply, seq_num, is_discovery_protected);
3891  break;
3892  default:
3893  if (DCPS::DCPS_debug_level) {
3894  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: "
3895  "Sedp::TypeLookupReplyReader::process_type_lookup_reply - "
3896  "reply kind is %d\n", kind));
3897  }
3898  return false;
3899  }
3900 
3901  if (kind == XTypes::TypeLookup_getTypes_HashId) {
3902  if (DCPS::DCPS_debug_level > 8) {
3903  ACE_DEBUG((LM_DEBUG,
3904  "(%P|%t) Sedp::TypeLookupReplyReader::process_type_lookup_reply - "
3905  "got the reply for the final request in the sequence\n"));
3906  }
3907  const DCPS::SequenceNumber key_seq_num = seq_num_it->second.seq_number;
3908 
3909  // Cleanup data
3910  cleanup(sample.header_.publication_id_, seq_num_it->second.type_id);
3911  sedp_.orig_seq_numbers_.erase(seq_num);
3912 
3913  if (success) {
3914  MatchingDataIter it;
3915  for (it = sedp_.matching_data_buffer_.begin(); it != sedp_.matching_data_buffer_.end(); ++it) {
3916  const DCPS::SequenceNumber& seqnum_minimal = it->second.rpc_seqnum_minimal;
3917  const DCPS::SequenceNumber& seqnum_complete = it->second.rpc_seqnum_complete;
3918  if (seqnum_minimal == key_seq_num || seqnum_complete == key_seq_num) {
3919  if (seqnum_minimal == key_seq_num) {
3920  it->second.got_minimal = true;
3921  } else {
3922  it->second.got_complete = true;
3923  }
3924 
3925  if (it->first.type_obj_req_cond) {
3926  it->first.type_obj_req_cond->done(DDS::RETCODE_OK);
3927  sedp_.matching_data_buffer_.erase(it);
3928  return true;
3929  } else if (it->second.got_minimal && it->second.got_complete) {
3930  // All remote type objects are obtained, continue the matching process
3931  const GUID_t writer = it->first.writer();
3932  const GUID_t reader = it->first.reader();
3933  sedp_.matching_data_buffer_.erase(it);
3934  sedp_.match_continue(writer, reader);
3935  return true;
3936  }
3937  break;
3938  }
3939  }
3940 
3941  if (it == sedp_.matching_data_buffer_.end()) {
3943  ACE_ERROR((LM_WARNING, "(%P|%t) WARNING: Sedp::TypeLookupReplyReader::process_type_lookup_reply: "
3944  "RPC sequence number %q: No data found in matching data buffer\n",
3945  key_seq_num.getValue()));
3946  }
3947  }
3948  }
3949  }
3950 
3951  return success;
3952 }
DCPS::GUID_t get_guid() const
Definition: Sedp.h:364
#define ACE_DEBUG(X)
ACE_Thread_Mutex & lock_
Definition: Sedp.h:1228
#define ACE_ERROR(X)
void cleanup(const DCPS::GUID_t &guid, const XTypes::TypeIdentifier &ti)
Definition: Sedp.cpp:3834
OpenDDS_Dcps_Export TransportDebug transport_debug
Definition: debug.cpp:26
MatchingDataMap matching_data_buffer_
Definition: Sedp.h:1242
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
OrigSeqNumberMap orig_seq_numbers_
Definition: Sedp.h:1241
bool process_get_types_reply(const XTypes::TypeLookup_Reply &reply)
Definition: Sedp.cpp:3954
MatchingDataMap::iterator MatchingDataIter
Definition: Sedp.h:1119
OpenDDS::DCPS::GUID_t writer_guid
Definition: RtpsRpc.idl:21
OpenDDS::RTPS::SequenceNumber_t sequence_number
Definition: RtpsRpc.idl:22
void match_continue(const GUID_t &writer, const GUID_t &reader)
Definition: Sedp.cpp:7049
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
const long TypeLookup_getDependencies_HashId
Definition: TypeLookup.idl:27
DCPS::MonotonicTime_t get_participant_discovered_at() const
Definition: Spdp.cpp:4461
bool process_get_dependencies_reply(const DCPS::ReceivedDataSample &sample, const XTypes::TypeLookup_Reply &reply, const DCPS::SequenceNumber &seq_num, bool is_discovery_protected)
Definition: Sedp.cpp:3990
ACE_TEXT("TCP_Factory")
ACE_INT32 Long
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
OpenDDS_Dcps_Export LogLevel log_level
const ReturnCode_t RETCODE_OK
DCPS::SequenceNumber to_opendds_seqnum(const RTPS::SequenceNumber_t &rtps_seqnum)
Definition: MessageUtils.h:132

Member Data Documentation

◆ dependencies_

DependenciesMap OpenDDS::RTPS::Sedp::TypeLookupReplyReader::dependencies_
private

Definition at line 760 of file Sedp.h.


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