OpenDDS
Snapshot(2023/04/07-19:43)
|
Conversion processing and value testing utilities for RTPS GUID_t types. More...
#include <GuidConverter.h>
Public Member Functions | |
GuidConverter (const GUID_t &guid) | |
Construct from a GUID_t. More... | |
virtual | ~GuidConverter () |
Virtual destructor (this is a base class). More... | |
long | checksum () const |
Calculate the CRC32 checksum. More... | |
long | vendorId () const |
Extract the VendorId value. More... | |
long | entityId () const |
Extract the EntityId value. More... | |
long | entityKey () const |
Extract the EntityKey value. More... | |
EntityKind | entityKind () const |
Extract the EntityKind value. More... | |
bool | isBuiltinDomainEntity () const |
Returns true if the GUID represents a builtin type domain entity. More... | |
bool | isUserDomainEntity () const |
Returns true if the GUID represents a user defined type domain entity. More... | |
bool | isWriter () const |
Returns true if the GUID represents a writer entity. More... | |
bool | isReader () const |
Returns true if the GUID represents a reader entity. More... | |
bool | isTopic () const |
Returns true if the GUID represents a topic entity. More... | |
operator OPENDDS_STRING () const | |
Convert to diagnostic string. More... | |
OPENDDS_STRING | uniqueParticipantId () const |
Protected Attributes | |
const GUID_t | guid_ |
Conversion processing and value testing utilities for RTPS GUID_t types.
This class encapsulates the conversion of a GUID_t value to and from other types used within OpenDDS. This class handles opaque GUID_t values only. For specific access, the appropriate subclass must instead be used.
Since the GUID_t type is formed of octets in network order, we do all processing byte by byte to avoid any endian issues.
Currently the GUID_t is mapped from various internal values. These mappings are:
byte structure reference content
0 GUID_t.guidPrefix[ 0] == VendorId_t == 0x01 for OCI (used for OpenDDS) 1 GUID_t.guidPrefix[ 1] == VendorId_t == 0x03 for OCI (used for OpenDDS) 2 GUID_t.guidPrefix[ 2] == 0x00 3 GUID_t.guidPrefix[ 3] == 0x00
4 GUID_t.guidPrefix[ 4] == <private> (MS byte) 5 GUID_t.guidPrefix[ 5] == <private> 6 GUID_t.guidPrefix[ 6] == <private> 7 GUID_t.guidPrefix[ 7] == <private> (LS byte)
8 GUID_t.guidPrefix[ 8] == <private> (MS byte) 9 GUID_t.guidPrefix[ 9] == <private> 10 GUID_t.guidPrefix[10] == <private> 11 GUID_t.guidPrefix[11] == <private> (LS byte)
12 GUID_t.entityId.entityKey[ 0] == entity id[0] (MS byte) 13 GUID_t.entityId.entityKey[ 1] == entity id[1] 14 GUID_t.entityId.entityKey[ 2] == entity id[2] (LS byte) 15 GUID_t.entityId.entityKind == entity kind
Definition at line 62 of file GuidConverter.h.
OpenDDS::DCPS::GuidConverter::GuidConverter | ( | const GUID_t & | guid | ) |
|
virtual |
long OpenDDS::DCPS::GuidConverter::checksum | ( | ) | const |
Calculate the CRC32 checksum.
Definition at line 32 of file GuidConverter.cpp.
References ACE::crc32(), and guid_.
Referenced by Update::PersistenceUpdater::IdType_ExtId::hash(), and operator OPENDDS_STRING().
long OpenDDS::DCPS::GuidConverter::entityId | ( | ) | const |
Extract the EntityId value.
Definition at line 45 of file GuidConverter.cpp.
References OpenDDS::DCPS::GUID_t::entityId, entityKey(), OpenDDS::DCPS::EntityId_t::entityKind, and guid_.
long OpenDDS::DCPS::GuidConverter::entityKey | ( | ) | const |
Extract the EntityKey value.
Definition at line 52 of file GuidConverter.cpp.
References OpenDDS::DCPS::GUID_t::entityId, OpenDDS::DCPS::EntityId_t::entityKey, and guid_.
Referenced by TAO_DDS_DCPSInfo_i::add_publication(), TAO_DDS_DCPSInfo_i::add_subscription(), TAO_DDS_DCPSInfo_i::add_topic(), and entityId().
EntityKind OpenDDS::DCPS::GuidConverter::entityKind | ( | ) | const |
Extract the EntityKind value.
Definition at line 60 of file GuidConverter.cpp.
References OpenDDS::DCPS::GUID_t::entityId, OpenDDS::DCPS::EntityId_t::entityKind, OpenDDS::DCPS::ENTITYKIND_BUILTIN_PARTICIPANT, OpenDDS::DCPS::ENTITYKIND_BUILTIN_READER_NO_KEY, OpenDDS::DCPS::ENTITYKIND_BUILTIN_READER_WITH_KEY, OpenDDS::DCPS::ENTITYKIND_BUILTIN_TOPIC, OpenDDS::DCPS::ENTITYKIND_BUILTIN_UNKNOWN, OpenDDS::DCPS::ENTITYKIND_BUILTIN_WRITER_NO_KEY, OpenDDS::DCPS::ENTITYKIND_BUILTIN_WRITER_WITH_KEY, OpenDDS::DCPS::ENTITYKIND_OPENDDS_NIL_WRITER, OpenDDS::DCPS::ENTITYKIND_OPENDDS_PUBLISHER, OpenDDS::DCPS::ENTITYKIND_OPENDDS_SUBSCRIBER, OpenDDS::DCPS::ENTITYKIND_OPENDDS_TOPIC, OpenDDS::DCPS::ENTITYKIND_OPENDDS_USER, OpenDDS::DCPS::ENTITYKIND_USER_READER_NO_KEY, OpenDDS::DCPS::ENTITYKIND_USER_READER_WITH_KEY, OpenDDS::DCPS::ENTITYKIND_USER_UNKNOWN, OpenDDS::DCPS::ENTITYKIND_USER_WRITER_NO_KEY, OpenDDS::DCPS::ENTITYKIND_USER_WRITER_WITH_KEY, guid_, OpenDDS::DCPS::KIND_BUILTIN_READER, OpenDDS::DCPS::KIND_BUILTIN_TOPIC, OpenDDS::DCPS::KIND_BUILTIN_WRITER, OpenDDS::DCPS::KIND_PARTICIPANT, OpenDDS::DCPS::KIND_PUBLISHER, OpenDDS::DCPS::KIND_SUBSCRIBER, OpenDDS::DCPS::KIND_UNKNOWN, OpenDDS::DCPS::KIND_USER, OpenDDS::DCPS::KIND_USER_READER, OpenDDS::DCPS::KIND_USER_TOPIC, and OpenDDS::DCPS::KIND_USER_WRITER.
Referenced by OpenDDS::DCPS::DomainParticipantImpl::get_discovered_participant_data(), OpenDDS::DCPS::DomainParticipantImpl::get_discovered_participants(), isReader(), isTopic(), and isWriter().
bool OpenDDS::DCPS::GuidConverter::isBuiltinDomainEntity | ( | ) | const |
Returns true if the GUID represents a builtin type domain entity.
Definition at line 105 of file GuidConverter.cpp.
References OpenDDS::DCPS::GUID_t::entityId, OpenDDS::DCPS::EntityId_t::entityKind, OpenDDS::DCPS::ENTITYKIND_BUILTIN_READER_NO_KEY, OpenDDS::DCPS::ENTITYKIND_BUILTIN_READER_WITH_KEY, OpenDDS::DCPS::ENTITYKIND_BUILTIN_TOPIC, OpenDDS::DCPS::ENTITYKIND_BUILTIN_WRITER_NO_KEY, OpenDDS::DCPS::ENTITYKIND_BUILTIN_WRITER_WITH_KEY, and guid_.
Referenced by OpenDDS::RTPS::Sedp::populate_origination_locator(), and OpenDDS::RTPS::Sedp::remote_knows_about_local_i().
bool OpenDDS::DCPS::GuidConverter::isReader | ( | ) | const |
Returns true if the GUID represents a reader entity.
Definition at line 143 of file GuidConverter.cpp.
References entityKind(), OpenDDS::DCPS::KIND_BUILTIN_READER, and OpenDDS::DCPS::KIND_USER_READER.
Referenced by OpenDDS::DCPS::RtpsUdpDataLink::accumulate_addresses(), OpenDDS::DCPS::RtpsUdpDataLink::associated(), OpenDDS::DCPS::RtpsUdpReceiveStrategy::check_encoded(), OpenDDS::DCPS::RtpsUdpDataLink::client_stop(), OpenDDS::DCPS::TcpDataLink::do_association_actions(), OpenDDS::DCPS::StaticEndpointManager::match_endpoints(), OpenDDS::RTPS::Sedp::match_endpoints(), OpenDDS::RTPS::Sedp::populate_origination_locator(), OpenDDS::RTPS::Sedp::process_association_records_i(), OpenDDS::DCPS::RtpsUdpDataLink::release_reservations_i(), OpenDDS::RTPS::Sedp::remove_remote_crypto_handle(), OpenDDS::RTPS::Sedp::request_remote_complete_type_objects(), and OpenDDS::RTPS::Sedp::stop_ice().
bool OpenDDS::DCPS::GuidConverter::isTopic | ( | ) | const |
Returns true if the GUID represents a topic entity.
Definition at line 149 of file GuidConverter.cpp.
References entityKind(), OpenDDS::DCPS::KIND_BUILTIN_TOPIC, and OpenDDS::DCPS::KIND_USER_TOPIC.
Referenced by OpenDDS::DCPS::DomainParticipantImpl::get_discovered_topic_data(), and OpenDDS::DCPS::DomainParticipantImpl::get_discovered_topics().
bool OpenDDS::DCPS::GuidConverter::isUserDomainEntity | ( | ) | const |
Returns true if the GUID represents a user defined type domain entity.
Definition at line 121 of file GuidConverter.cpp.
References OpenDDS::DCPS::GUID_t::entityId, OpenDDS::DCPS::EntityId_t::entityKind, OpenDDS::DCPS::ENTITYKIND_OPENDDS_TOPIC, OpenDDS::DCPS::ENTITYKIND_USER_READER_NO_KEY, OpenDDS::DCPS::ENTITYKIND_USER_READER_WITH_KEY, OpenDDS::DCPS::ENTITYKIND_USER_WRITER_NO_KEY, OpenDDS::DCPS::ENTITYKIND_USER_WRITER_WITH_KEY, and guid_.
Referenced by OpenDDS::RTPS::Sedp::resend_user_crypto_tokens().
bool OpenDDS::DCPS::GuidConverter::isWriter | ( | ) | const |
Returns true if the GUID represents a writer entity.
Definition at line 137 of file GuidConverter.cpp.
References entityKind(), OpenDDS::DCPS::KIND_BUILTIN_WRITER, and OpenDDS::DCPS::KIND_USER_WRITER.
Referenced by OpenDDS::DCPS::RtpsUdpDataLink::accumulate_addresses(), OpenDDS::DCPS::MulticastSession::add_remote(), OpenDDS::DCPS::RtpsUdpDataLink::associated(), OpenDDS::DCPS::RtpsUdpDataLink::get_addresses_i(), OpenDDS::DCPS::RtpsUdpDataLink::release_reservations_i(), OpenDDS::RTPS::Sedp::remote_knows_about_local_i(), OpenDDS::RTPS::Sedp::remove_remote_crypto_handle(), OpenDDS::DCPS::MulticastSession::remove_remote_i(), OpenDDS::DCPS::ShmemDataLink::request_ack_received(), OpenDDS::RTPS::Sedp::request_remote_complete_type_objects(), OpenDDS::RTPS::Sedp::start_ice(), and OpenDDS::RTPS::Sedp::stop_ice().
OpenDDS::DCPS::GuidConverter::operator OPENDDS_STRING | ( | ) | const |
Convert to diagnostic string.
Definition at line 155 of file GuidConverter.cpp.
References checksum(), guid_, OPENDDS_STRING, OpenDDS::DCPS::to_dds_string(), and OpenDDS::DCPS::to_string().
OPENDDS_STRING OpenDDS::DCPS::GuidConverter::uniqueParticipantId | ( | ) | const |
Definition at line 192 of file GuidConverter.cpp.
References guid_, OpenDDS::DCPS::GUID_t::guidPrefix, OPENDDS_END_VERSIONED_NAMESPACE_DECL, and ACE_OS::snprintf().
Referenced by OpenDDS::DCPS::TransportRegistry::bind_config(), OpenDDS::DCPS::DomainParticipantImpl::get_unique_id(), and OpenDDS::RTPS::Sedp::init().
long OpenDDS::DCPS::GuidConverter::vendorId | ( | ) | const |
Extract the VendorId value.
Definition at line 38 of file GuidConverter.cpp.
References guid_, and OpenDDS::DCPS::GUID_t::guidPrefix.
|
protected |
Definition at line 109 of file GuidConverter.h.
Referenced by checksum(), entityId(), entityKey(), entityKind(), OpenDDS::DCPS::RepoIdConverter::federationId(), isBuiltinDomainEntity(), isUserDomainEntity(), operator OPENDDS_STRING(), OpenDDS::DCPS::RepoIdConverter::participantId(), uniqueParticipantId(), and vendorId().