OpenDDS  Snapshot(2023/04/28-20:55)
RepoIdConverter.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_REPOIDCONVERTER_H
9 #define OPENDDS_DCPS_REPOIDCONVERTER_H
10 
11 #include "dds/DdsDcpsInfrastructureC.h"
12 #include "dds/DdsDcpsInfoUtilsC.h"
13 
14 #include "GuidConverter.h"
15 
16 #include "dcps_export.h"
17 
19 
20 namespace OpenDDS {
21 
22 namespace Federator {
23  // reproducing type created by dds/InfoRepo/Federator.idl
24  typedef ::CORBA::Long RepoKey;
25 }
26 
27 namespace DCPS {
28  typedef ::CORBA::Long ParticipantId;
29 
30 /**
31  * @class RepoIdConverter
32  *
33  * @brief Conversion processing and value testing utilities for
34  DCPS Information Repository identifiers.
35  *
36  * This class encapsulates the conversion of a GUID_t value to and from
37  * other types used within OpenDDS.
38  *
39  * Currently the RepoId is a typedef for GUID_t. This class assumes
40  * responsibility for insulating users from future change.
41  *
42  * Currently the RepoId is mapped from various internal values.
43  * These mappings are:
44  *
45  * byte structure reference content
46  * ---- --------------------- --------------------------
47  * 0 GUID_t.guidPrefix[ 0] == VendorId_t == 0x00 for OCI (used for OpenDDS)
48  * 1 GUID_t.guidPrefix[ 1] == VendorId_t == 0x03 for OCI (used for OpenDDS)
49  * 2 GUID_t.guidPrefix[ 2] == 0x00
50  * 3 GUID_t.guidPrefix[ 3] == 0x00
51  *
52  * 4 GUID_t.guidPrefix[ 4] == federation id (MS byte)
53  * 5 GUID_t.guidPrefix[ 5] == federation id
54  * 6 GUID_t.guidPrefix[ 6] == federation id
55  * 7 GUID_t.guidPrefix[ 7] == federation id (LS byte)
56  *
57  * 8 GUID_t.guidPrefix[ 8] == particpant id (MS byte)
58  * 9 GUID_t.guidPrefix[ 9] == particpant id
59  * 10 GUID_t.guidPrefix[10] == particpant id
60  * 11 GUID_t.guidPrefix[11] == particpant id (LS byte)
61  *
62  * 12 GUID_t.entityId.entityKey[ 0] == entity id[0] (MS byte)
63  * 13 GUID_t.entityId.entityKey[ 1] == entity id[1]
64  * 14 GUID_t.entityId.entityKey[ 2] == entity id[2] (LS byte)
65  * 15 GUID_t.entityId.entityKind == entity kind
66  */
68 public:
69  RepoIdConverter(const GUID_t& repoId);
70 
71  ~RepoIdConverter();
72 
73  /// Get the federeation id from the GUID
74  OpenDDS::Federator::RepoKey federationId() const;
75 
76  /// Get the participant id from the GUID
77  ParticipantId participantId() const;
78 };
79 
80 } // namespace DCPS
81 } // namespace OpenDDS
82 
84 
85 #endif /* DCPS_REPOIDCONVERTER_H */
Conversion processing and value testing utilities for DCPS Information Repository identifiers...
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
Conversion processing and value testing utilities for RTPS GUID_t types.
Definition: GuidConverter.h:62
::CORBA::Long ParticipantId
::CORBA::Long RepoKey
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28