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

Public Member Functions

 TypeLookupRequestReader (const DCPS::GUID_t &sub_id, Sedp &sedp)
 
virtual ~TypeLookupRequestReader ()
 
- 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 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_request (DCPS::Serializer &ser, XTypes::TypeLookup_Reply &type_lookup_reply)
 
bool process_get_types_request (const XTypes::TypeLookup_Request &type_lookup_request, XTypes::TypeLookup_Reply &type_lookup_reply)
 
bool process_get_dependencies_request (const XTypes::TypeLookup_Request &request, XTypes::TypeLookup_Reply &reply)
 
void gen_continuation_point (XTypes::OctetSeq32 &cont_point) const
 

Private Attributes

OPENDDS_STRING instance_name_
 

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 692 of file Sedp.h.

Constructor & Destructor Documentation

◆ TypeLookupRequestReader()

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

Definition at line 694 of file Sedp.h.

References OpenDDS::XTypes::extensibility().

695  : Reader(sub_id, sedp)
696  {
698  }
OPENDDS_STRING get_instance_name(const DCPS::GUID_t &id) const
Definition: Sedp.h:405
Reader(const DCPS::GUID_t &sub_id, Sedp &sedp)
Definition: Sedp.h:612

◆ ~TypeLookupRequestReader()

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

Definition at line 3619 of file Sedp.cpp.

3620 {
3621 }

Member Function Documentation

◆ data_received_i()

void OpenDDS::RTPS::Sedp::TypeLookupRequestReader::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 4470 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_READER, OpenDDS::RTPS::ENTITYID_TL_SVC_REPLY_READER_SECURE, OpenDDS::DCPS::ENTITYID_TL_SVC_REQ_WRITER, OpenDDS::RTPS::ENTITYID_TL_SVC_REQ_WRITER_SECURE, OpenDDS::DCPS::ReceivedDataSample::header_, LM_DEBUG, LM_ERROR, OpenDDS::DCPS::make_id(), OpenDDS::DCPS::DataSampleHeader::publication_id_, OpenDDS::RTPS::Sedp::Endpoint::sedp_, OpenDDS::RTPS::Sedp::type_lookup_reply_secure_writer_, and OpenDDS::RTPS::Sedp::type_lookup_reply_writer_.

4474 {
4475  if (DCPS::DCPS_debug_level > 8) {
4476  ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::TypeLookupRequestReader::data_received_i: from %C\n",
4477  DCPS::LogGuid(sample.header_.publication_id_).c_str()));
4478  }
4479 
4480  XTypes::TypeLookup_Reply type_lookup_reply;
4481  if (!process_type_lookup_request(ser, type_lookup_reply)) {
4482  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Sedp::TypeLookupRequestReader::data_received_i - ")
4483  ACE_TEXT("failed to take type lookup request\n")));
4484  return;
4485  }
4486 
4487 #ifdef OPENDDS_SECURITY
4488  if (entity_id == ENTITYID_TL_SVC_REQ_WRITER_SECURE) {
4489  const DCPS::GUID_t reader = make_id(sample.header_.publication_id_, ENTITYID_TL_SVC_REPLY_READER_SECURE);
4490  if (!sedp_.type_lookup_reply_secure_writer_->send_type_lookup_reply(type_lookup_reply, reader)) {
4491  if (DCPS::DCPS_debug_level) {
4492  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Sedp::TypeLookupRequestReader::data_received_i - ")
4493  ACE_TEXT("failed to send secure type lookup reply\n")));
4494  }
4495  return;
4496  }
4497  } else if (entity_id == ENTITYID_TL_SVC_REQ_WRITER) {
4498 #endif
4499  const DCPS::GUID_t reader = make_id(sample.header_.publication_id_, ENTITYID_TL_SVC_REPLY_READER);
4500  if (!sedp_.type_lookup_reply_writer_->send_type_lookup_reply(type_lookup_reply, reader)) {
4501  if (DCPS::DCPS_debug_level) {
4502  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Sedp::TypeLookupRequestReader::data_received_i - ")
4503  ACE_TEXT("failed to send type lookup reply\n")));
4504  }
4505  return;
4506  }
4507 #ifdef OPENDDS_SECURITY
4508  }
4509 #else
4510  ACE_UNUSED_ARG(entity_id);
4511 #endif
4512 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
TypeLookupReplyWriter_rch type_lookup_reply_writer_
Definition: Sedp.h:1293
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER
Definition: GuidUtils.h:52
const EntityId_t ENTITYID_TL_SVC_REPLY_READER
Definition: GuidUtils.h:55
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER_SECURE
Definition: MessageTypes.h:90
const EntityId_t ENTITYID_TL_SVC_REPLY_READER_SECURE
Definition: MessageTypes.h:93
TypeLookupReplyWriter_rch type_lookup_reply_secure_writer_
Definition: Sedp.h:1296
bool process_type_lookup_request(DCPS::Serializer &ser, XTypes::TypeLookup_Reply &type_lookup_reply)
Definition: Sedp.cpp:3737
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200

◆ gen_continuation_point()

void OpenDDS::RTPS::Sedp::TypeLookupRequestReader::gen_continuation_point ( XTypes::OctetSeq32 cont_point) const
private

Definition at line 3796 of file Sedp.cpp.

3797 {
3798  // We are sending all dependencies of requested types in 1 reply, and thus
3799  // the continuation_point will be "absent" by setting its length to zero.
3800  cont_point.length(0);
3801 }

◆ process_get_dependencies_request()

bool OpenDDS::RTPS::Sedp::TypeLookupRequestReader::process_get_dependencies_request ( const XTypes::TypeLookup_Request request,
XTypes::TypeLookup_Reply reply 
)
private

Definition at line 3803 of file Sedp.cpp.

References OpenDDS::XTypes::TypeLookup_Request::data, OpenDDS::XTypes::TypeLookup_Call::getTypeDependencies, OpenDDS::XTypes::TypeLookup_Request::header, OpenDDS::XTypes::TypeLookup_Reply::header, DDS::RPC::ReplyHeader::relatedRequestId, DDS::RPC::RequestHeader::requestId, OpenDDS::XTypes::TypeLookup_getTypeDependencies_Result::result, OpenDDS::RTPS::Sedp::Endpoint::sedp_, and OpenDDS::RTPS::Sedp::type_lookup_service_.

3806 {
3807  // Send all dependencies (may be empty) of the requested types
3808  XTypes::TypeLookup_getTypeDependencies_Out result;
3809  sedp_.type_lookup_service_->get_type_dependencies(request.data.getTypeDependencies().type_ids,
3810  result.dependent_typeids);
3811  gen_continuation_point(result.continuation_point);
3812 
3813  XTypes::TypeLookup_getTypeDependencies_Result typeDependencies;
3814  typeDependencies.result(result);
3815  reply._cxx_return.getTypeDependencies(typeDependencies);
3816 
3817  reply.header.relatedRequestId = request.header.requestId;
3818  return true;
3819 }
XTypes::TypeLookupService_rch type_lookup_service_
Definition: Sedp.h:1240
void gen_continuation_point(XTypes::OctetSeq32 &cont_point) const
Definition: Sedp.cpp:3796

◆ process_get_types_request()

bool OpenDDS::RTPS::Sedp::TypeLookupRequestReader::process_get_types_request ( const XTypes::TypeLookup_Request type_lookup_request,
XTypes::TypeLookup_Reply type_lookup_reply 
)
private

Definition at line 3771 of file Sedp.cpp.

References ACE_ERROR, OpenDDS::XTypes::TypeLookup_Request::data, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::XTypes::TypeLookup_Call::getTypes, OpenDDS::XTypes::TypeLookup_Request::header, OpenDDS::XTypes::TypeLookup_Reply::header, LM_ERROR, DDS::RPC::ReplyHeader::relatedRequestId, DDS::RPC::RequestHeader::requestId, OpenDDS::XTypes::TypeLookup_getTypes_Result::result, OpenDDS::RTPS::Sedp::Endpoint::sedp_, and OpenDDS::RTPS::Sedp::type_lookup_service_.

3774 {
3775  XTypes::TypeLookup_getTypes_Out result;
3776  sedp_.type_lookup_service_->get_type_objects(type_lookup_request.data.getTypes().type_ids,
3777  result.types);
3778  if (result.types.length() > 0) {
3779  result.complete_to_minimal.length(0);
3780 
3781  XTypes::TypeLookup_getTypes_Result typeResult;
3782  typeResult.result(result);
3783 
3784  type_lookup_reply._cxx_return.getType(typeResult);
3785 
3786  type_lookup_reply.header.relatedRequestId = type_lookup_request.header.requestId;
3787  return true;
3788  }
3789  if (DCPS::DCPS_debug_level) {
3790  ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: Sedp::TypeLookupRequestReader::process_get_types_request: "
3791  "No types received\n"));
3792  }
3793  return false;
3794 }
#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

◆ process_type_lookup_request()

bool OpenDDS::RTPS::Sedp::TypeLookupRequestReader::process_type_lookup_request ( DCPS::Serializer ser,
XTypes::TypeLookup_Reply type_lookup_reply 
)
private

Definition at line 3737 of file Sedp.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::XTypes::TypeLookup_Request::data, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::SequenceNumber::getValue(), OpenDDS::XTypes::TypeLookup_Request::header, LM_DEBUG, LM_ERROR, OPENDDS_STRING, DDS::RPC::RequestHeader::requestId, DDS::SampleIdentity::sequence_number, OpenDDS::RTPS::to_opendds_seqnum(), OpenDDS::XTypes::TypeLookup_getDependencies_HashId, OpenDDS::XTypes::TypeLookup_getTypes_HashId, and DDS::SampleIdentity::writer_guid.

3739 {
3740  XTypes::TypeLookup_Request type_lookup_request;
3741  if (!(ser >> type_lookup_request)) {
3742  if (DCPS::DCPS_debug_level) {
3743  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Sedp::TypeLookupRequestReader::process_type_lookup_request - ")
3744  ACE_TEXT("failed to deserialize type lookup request\n")));
3745  }
3746  return false;
3747  }
3748 
3749  if (DCPS::DCPS_debug_level >= 8) {
3750  const DDS::SampleIdentity& request_id = type_lookup_request.header.requestId;
3751  ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::TypeLookupReplyWriter::process_type_lookup_request: "
3752  "from %C seq: %q\n",
3753  DCPS::LogGuid(request_id.writer_guid).c_str(),
3754  to_opendds_seqnum(request_id.sequence_number).getValue()));
3755  }
3756 
3757  if (OPENDDS_STRING(type_lookup_request.header.instanceName) != instance_name_) {
3758  return true;
3759  }
3760 
3761  switch (type_lookup_request.data._d()) {
3763  return process_get_types_request(type_lookup_request, type_lookup_reply);
3765  return process_get_dependencies_request(type_lookup_request, type_lookup_reply);
3766  default:
3767  return false;
3768  }
3769 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
bool process_get_types_request(const XTypes::TypeLookup_Request &type_lookup_request, XTypes::TypeLookup_Reply &type_lookup_reply)
Definition: Sedp.cpp:3771
const long TypeLookup_getTypes_HashId
Definition: TypeLookup.idl:26
#define OPENDDS_STRING
OpenDDS::DCPS::GUID_t writer_guid
Definition: RtpsRpc.idl:21
OpenDDS::RTPS::SequenceNumber_t sequence_number
Definition: RtpsRpc.idl:22
const long TypeLookup_getDependencies_HashId
Definition: TypeLookup.idl:27
ACE_TEXT("TCP_Factory")
bool process_get_dependencies_request(const XTypes::TypeLookup_Request &request, XTypes::TypeLookup_Reply &reply)
Definition: Sedp.cpp:3803
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DCPS::SequenceNumber to_opendds_seqnum(const RTPS::SequenceNumber_t &rtps_seqnum)
Definition: MessageUtils.h:132

Member Data Documentation

◆ instance_name_

OPENDDS_STRING OpenDDS::RTPS::Sedp::TypeLookupRequestReader::instance_name_
private

Definition at line 720 of file Sedp.h.


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