📄 a00554.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>OpenDDS: GuidGenerator Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li id="current"><a href="classes.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label> <u>S</u>earch for </label></td>
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
</tr>
</table>
</form>
</li>
</ul></div>
<div class="tabs">
<ul>
<li><a href="classes.html"><span>Alphabetical List</span></a></li>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul></div>
<h1>GuidGenerator Class Reference</h1><!-- doxytag: class="GuidGenerator" -->Create GUID values for use within <a class="el" href="a01300.html">DDS</a>.
<a href="#_details">More...</a>
<p>
<code>#include <GuidGenerator.h></code>
<p>
<a href="a00295.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00554.html#443fcfba62927eac76560ea6885e819b">GuidGenerator</a> (long federation, long participant=0, <a class="el" href="a01275.html#925f8cb698d0e2f03afc7c3e57928d91">OpenDDS::DCPS::EntityKind</a> kind=OpenDDS::DCPS::KIND_PARTICIPANT)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">construct with at least a FederationId value. <a href="#443fcfba62927eac76560ea6885e819b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="a00554.html#3dc1ed316090b86685133634bd134d91">~GuidGenerator</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Virtual destructor. <a href="#3dc1ed316090b86685133634bd134d91"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00552.html">OpenDDS::DCPS::GUID_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00554.html#9951e9257ef2f2036c0c85903de8a445">next</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Obtain the next GUID value. <a href="#9951e9257ef2f2036c0c85903de8a445"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00554.html#960b449a3ac98653f24da89707a99f96">last</a> (long key)</td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a01275.html#925f8cb698d0e2f03afc7c3e57928d91">OpenDDS::DCPS::EntityKind</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00554.html#caa766250f1aa42c53fdf57fc8d3677d">kind_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Type of Entity to generate GUID values for. <a href="#caa766250f1aa42c53fdf57fc8d3677d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="a00554.html#452667443843713e45cbeb901322437c">federation_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Unique identifier for the repository. <a href="#452667443843713e45cbeb901322437c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="a00554.html#2b67563dd3efe16e7bc06d4290330c6b">participant_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Unique identifier for the DomainParticipant. <a href="#2b67563dd3efe16e7bc06d4290330c6b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="a00554.html#95257aab9989d1b9061b02a4958b36c7">lastKey_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Unique value for the EntityKey. <a href="#95257aab9989d1b9061b02a4958b36c7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">CORBA::Octet </td><td class="memItemRight" valign="bottom"><a class="el" href="a00554.html#67eb2dc8fef19a99631780dfd5972a8e">kindCode_</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Cached entityKind encoded value. <a href="#67eb2dc8fef19a99631780dfd5972a8e"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Create GUID values for use within <a class="el" href="a01300.html">DDS</a>.
<p>
Internal to the <a class="el" href="a01301.html">OpenDDS</a> repository, the Repository Identifiers that uniquely identify all <a class="el" href="a01300.html">DDS</a> Entities within the service managed by this (and other federated) repositories consist of GUID values.<p>
These GUID (Global Unique IDentifiers?) values are based on the RTPS specification (formal/08-04-09) GUID values. They use the same structure. The VendorId value is applied in the first 2 bytes of the prefix. The remainder of the Participant Id value is composed of the <a class="el" href="a01301.html">OpenDDS</a> specific Federation Id value (the identifier of the repository where the Entity was created) and a DomainParticipant identifier within that repository. In addition to the standard EntityKind values, the EntityKind byte has an added value of ENTITYKIND_OPENDDS_TOPIC allowed to permit the use of GUID values for Topic entities as well. This is an <a class="el" href="a01301.html">OpenDDS</a> specific extension.<p>
The EntityKey field is used to distinguish Topics, Publications and Subscriptions within a single Participant. Each of these is within its own number (address) space. The EntityKind byte will ensure that identical EntityKey values of these different types will not conflict in the final GUID value.<p>
Values are generated using the specified FederationId and DomainParticipant identifiers. The EntityKey for a type is incremented each time a value is generated.<p>
The ability to reset the last used value is provided to allow the reloading of Entities from persistent storage without inducing conflicts with newly created Entities. This is a simplistic mechanism and requires that all information from the persistent storage be processed *prior* to any new Entities being created within the repository. After this processing is complete, the last used value should be reset to ensure that any new values will not conflict with the restored values.<p>
NOTE: This mechanism does not work well for values that have wrapped around the 24 bit EntityKey space. It is possible to extend the current mapping to overflow into the two '0' bytes (2 and 3) with the Key value number (address) space to increase the possible unique identifiers if this becomes an issue. Doing that would alleviate the need to manage an arena of Key values.<p>
Even though each Domain could have a separate GUID (address) space, since we do not currently include the domain value within the GUID mapping, all domains within a repository will use the same generator instance to ensure no conflicting GUID values. This will restrict the total number of DomainParticipants within *all* domains of a repository to be within the 32 bit (2**32) DomainParticipant address space. It is likely that other limits will be exceeded before this one is approached.<p>
The current mapping of meanings to the GUID component values is:<p>
Content: | VendorId| 0 | 0 | FederationId | DomainParticpant | EntityKey |Kind| GUID_t bytes: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | GuidPrefix_t GUID_t.guidPrefix bytes: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | EntityId_t GUID_t.entityId bytes: | 0 | 1 | 2 | 3 | EntityKey_t GUID_t.entityId.entityKey bytes: | 0 | 1 | 2 |<p>
Where the VendorId value used for <a class="el" href="a01301.html">OpenDDS</a> is the one for Object Computing, Inc. == 0x03.
<p>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="443fcfba62927eac76560ea6885e819b"></a><!-- doxytag: member="GuidGenerator::GuidGenerator" ref="443fcfba62927eac76560ea6885e819b" args="(long federation, long participant=0, OpenDDS::DCPS::EntityKind kind=OpenDDS::DCPS::KIND_PARTICIPANT)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GuidGenerator::GuidGenerator </td>
<td>(</td>
<td class="paramtype">long </td>
<td class="paramname"> <em>federation</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">long </td>
<td class="paramname"> <em>participant</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a01275.html#925f8cb698d0e2f03afc7c3e57928d91">OpenDDS::DCPS::EntityKind</a> </td>
<td class="paramname"> <em>kind</em> = <code>OpenDDS::DCPS::KIND_PARTICIPANT</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
construct with at least a FederationId value.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>federation</em> </td><td>identifier for the repository. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>participant</em> </td><td>identifier for the participant. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>kind</em> </td><td>type of Entities to generate Id values for. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>GUID_t generated unique identifier value.</dd></dl>
If the <code>kind</code> is KIND_PARTICIPANT then the generator will generate Participant GUID values. Otherwise it will generate the specified type of Entity values within the specified Participant.
</div>
</div><p>
<a class="anchor" name="3dc1ed316090b86685133634bd134d91"></a><!-- doxytag: member="GuidGenerator::~GuidGenerator" ref="3dc1ed316090b86685133634bd134d91" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">GuidGenerator::~GuidGenerator </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Virtual destructor.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -